GRINS-0.8.0
physics_factory_one_d_stress_solids.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // GRINS - General Reacting Incompressible Navier-Stokes
5 //
6 // Copyright (C) 2014-2017 Paul T. Bauman, Roy H. Stogner
7 // Copyright (C) 2010-2013 The PECOS Development Team
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the Version 2.1 GNU Lesser General
11 // Public License as published by the Free Software Foundation.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
21 // Boston, MA 02110-1301 USA
22 //
23 //-----------------------------------------------------------------------el-
24 
25 #ifndef GRINS_PHYSICS_FACTORY_ONE_D_STRESS_SOLIDS_H
26 #define GRINS_PHYSICS_FACTORY_ONE_D_STRESS_SOLIDS_H
27 
28 // GRINS
31 #include "grins/hookes_law_1d.h"
32 
33 namespace GRINS
34 {
35  template<template<typename> class DerivedPhysics>
37  {
38  public:
39  PhysicsFactoryOneDStressSolids( const std::string& physics_name,
40  const std::string& core_physics_name )
41  : PhysicsFactoryWithCore(physics_name,core_physics_name)
42  {}
43 
45 
46  protected:
47 
48  virtual libMesh::UniquePtr<Physics> build_physics( const GetPot& input,
49  const std::string& physics_name );
50 
51  };
52 
53  template<template<typename> class DerivedPhysics>
54  inline
55  libMesh::UniquePtr<Physics> PhysicsFactoryOneDStressSolids<DerivedPhysics>::build_physics( const GetPot& input,
56  const std::string& physics_name )
57  {
58  std::string core_physics = this->find_core_physics_name(physics_name);
59 
60  std::string model = "none";
61  std::string strain_energy = "none";
62 
64  core_physics,
65  model,
66  strain_energy );
67 
68  libMesh::UniquePtr<Physics> new_physics;
69 
70  if( model == std::string("hookes_law") )
71  {
72  new_physics.reset( new DerivedPhysics<HookesLaw1D>
73  (physics_name,input, false /*is_compressible*/) );
74  }
75  else
76  {
77  std::string error = "Error: Invalid stress-strain model: "+model+"!\n";
78  error += " Valid values are: hookes_law\n";
79  libmesh_error_msg(error);
80  }
81 
82  libmesh_assert(new_physics);
83 
84  return new_physics;
85  }
86 
87 } // end namespace GRINS
88 
89 #endif // GRINS_PHYSICS_FACTORY_ONE_D_STRESS_SOLIDS_H
PhysicsFactoryOneDStressSolids(const std::string &physics_name, const std::string &core_physics_name)
PhysicsFactory base class for Physics that may have a related "core" Physics.
GRINS namespace.
virtual libMesh::UniquePtr< Physics > build_physics(const GetPot &input, const std::string &physics_name)
static void parse_stress_strain_model(const GetPot &input, const std::string &physics, std::string &model, std::string &strain_energy)
Determine stress-strain law used by solid mechanics classes.

Generated on Tue Dec 19 2017 12:47:28 for GRINS-0.8.0 by  doxygen 1.8.9.1