GRINS-0.7.0
physics_factory_plane_stress_solids.C
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // GRINS - General Reacting Incompressible Navier-Stokes
5 //
6 // Copyright (C) 2014-2016 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 // This class
27 
28 // GRINS
30 #include "grins/hookes_law.h"
31 #include "grins/hookes_law_1d.h"
33 #include "grins/mooney_rivlin.h"
34 
35 // Physics whose factories we're instantiating
36 #include "grins/elastic_membrane.h"
38 
39 namespace GRINS
40 {
41  template<template<typename> class DerivedPhysics>
42  libMesh::UniquePtr<Physics> PhysicsFactoryPlaneStressSolids<DerivedPhysics>::build_physics( const GetPot& input,
43  const std::string& physics_name )
44  {
45  std::string core_physics = this->find_core_physics_name(physics_name);
46 
47  std::string model = "none";
48  std::string strain_energy = "none";
49 
51  core_physics,
52  model,
53  strain_energy );
54 
55  libMesh::UniquePtr<Physics> new_physics;
56 
57  if( model == std::string("hookes_law") )
58  new_physics.reset( new DerivedPhysics<HookesLaw>
59  (physics_name,input, false /*is_compressible*/) );
60 
61  else if( model == std::string("incompressible_hyperelasticity") )
62  {
63  if( strain_energy == std::string("mooney_rivlin") )
64  {
65  new_physics.reset( new DerivedPhysics<IncompressiblePlaneStressHyperelasticity<MooneyRivlin> >(physics_name,input,false /*is_compressible*/) );
66  }
67  else
68  {
69  std::string error = "ERROR: Invalid strain_energy "+strain_energy+"!\n";
70  error += " Valid values are: mooney_rivlin\n";
71  libmesh_error_msg(error);
72  }
73 
74  }
75  else
76  {
77  std::string error = "Error: Invalid stress-strain model: "+model+"!\n";
78  error += " Valid values are: hookes_law\n";
79  error += " incompressible_hyperelasticity\n";
80  libmesh_error_msg(error);
81  }
82 
83  libmesh_assert(new_physics);
84 
85  return new_physics;
86  }
87 
88  // Instantiate all the "variable density flow" Physics factories.
91 
94 
95 } // end namespace GRINS
GRINS namespace.
static PhysicsName elastic_membrane()
virtual libMesh::UniquePtr< Physics > build_physics(const GetPot &input, const std::string &physics_name)
PhysicsFactoryPlaneStressSolids< ElasticMembraneRayleighDamping > grins_factory_elastic_membrane_rayleigh_damping(PhysicsNaming::elastic_membrane_rayleigh_damping(), PhysicsNaming::elastic_membrane())
PhysicsFactoryPlaneStressSolids< ElasticMembrane > grins_factory_elastic_membrane(PhysicsNaming::elastic_membrane(), PhysicsNaming::elastic_membrane())
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.
static PhysicsName elastic_membrane_rayleigh_damping()

Generated on Thu Jun 2 2016 21:52:28 for GRINS-0.7.0 by  doxygen 1.8.10