GRINS-0.8.0
physics_factory_plane_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_PLANE_STRESS_SOLIDS_H
26 #define GRINS_PHYSICS_FACTORY_PLANE_STRESS_SOLIDS_H
27 
28 // GRINS
31 #include "grins/hookes_law.h"
32 #include "grins/hookes_law_1d.h"
34 #include "grins/mooney_rivlin.h"
35 
36 namespace GRINS
37 {
38  template<template<typename> class DerivedPhysics>
40  {
41  public:
42  PhysicsFactoryPlaneStressSolids( const std::string& physics_name,
43  const std::string& core_physics_name )
44  : PhysicsFactoryWithCore(physics_name,core_physics_name)
45  {}
46 
48 
49  protected:
50 
51  virtual libMesh::UniquePtr<Physics> build_physics( const GetPot& input,
52  const std::string& physics_name );
53 
54  };
55 
56  template<template<typename> class DerivedPhysics>
57  inline
58  libMesh::UniquePtr<Physics>
60  ( const GetPot& input, const std::string& physics_name )
61  {
62  std::string core_physics = this->find_core_physics_name(physics_name);
63 
64  std::string model = "none";
65  std::string strain_energy = "none";
66 
68  core_physics,
69  model,
70  strain_energy );
71 
72  libMesh::UniquePtr<Physics> new_physics;
73 
74  if( model == std::string("hookes_law") )
75  new_physics.reset( new DerivedPhysics<HookesLaw>
76  (physics_name,input, false /*is_compressible*/) );
77 
78  else if( model == std::string("incompressible_hyperelasticity") )
79  {
80  if( strain_energy == std::string("mooney_rivlin") )
81  {
82  new_physics.reset( new DerivedPhysics<IncompressiblePlaneStressHyperelasticity<MooneyRivlin> >(physics_name,input,false /*is_compressible*/) );
83  }
84  else
85  {
86  std::string error = "ERROR: Invalid strain_energy "+strain_energy+"!\n";
87  error += " Valid values are: mooney_rivlin\n";
88  libmesh_error_msg(error);
89  }
90 
91  }
92  else
93  {
94  std::string error = "Error: Invalid stress-strain model: "+model+"!\n";
95  error += " Valid values are: hookes_law\n";
96  error += " incompressible_hyperelasticity\n";
97  libmesh_error_msg(error);
98  }
99 
100  libmesh_assert(new_physics);
101 
102  return new_physics;
103  }
104 
105 } // end namespace GRINS
106 
107 #endif // GRINS_PHYSICS_FACTORY_PLANE_STRESS_SOLIDS_H
PhysicsFactory base class for Physics that may have a related "core" Physics.
PhysicsFactoryPlaneStressSolids(const std::string &physics_name, const std::string &core_physics_name)
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