34 #include "libmesh/getpot.h"
35 #include "libmesh/tensor_value.h"
47 std::string warning =
"WARNING: Use of this constructor is DEPRECATED.\n";
48 warning +=
" Please update to use constructor with input material name.\n";
64 "Materials/"+material+
"/StressStrainLaw/HookesLaw/lambda",
65 "Physics/HookesLaw/lambda");
67 "Materials/"+material+
"/StressStrainLaw/HookesLaw/mu",
68 "Physics/HookesLaw/mu");
70 "Materials/"+material+
"/StressStrainLaw/HookesLaw/E",
71 "Physics/HookesLaw/E");
73 "Materials/"+material+
"/StressStrainLaw/HookesLaw/nu",
74 "Physics/HookesLaw/nu");
77 if( input.have_variable(
"Materials/"+material+
"/StressStrainLaw/HookesLaw/lambda") &&
78 input.have_variable(
"Materials/"+material+
"/StressStrainLaw/HookesLaw/mu") )
82 libMesh::Real lambda = input(
"Physics/HookesLaw/lambda", 0.0);
83 libMesh::Real mu = input(
"Physics/HookesLaw/mu", 0.0);
84 _E = mu*(3*lambda + 2*mu)/(lambda+mu);
85 _nu = lambda/(2*(lambda+mu));
87 else if( input.have_variable(
"Materials/"+material+
"/StressStrainLaw/HookesLaw/E") &&
88 input.have_variable(
"Materials/"+material+
"/StressStrainLaw/HookesLaw/nu") )
91 (
_E, input,
"Materials/"+material+
"/StressStrainLaw/HookesLaw/E", 0.0);
93 (
_nu, input,
"Materials/"+material+
"/StressStrainLaw/HookesLaw/nu", 0.0);
96 else if( input.have_variable(
"Physics/HookesLaw/lambda") &&
97 input.have_variable(
"Physics/HookesLaw/mu") )
100 "StressStrainLaw/HookesLaw/lambda" );
102 "StressStrainLaw/HookesLaw/mu" );
105 libMesh::Real lambda = input(
"Physics/HookesLaw/lambda", 0.0);
106 libMesh::Real mu = input(
"Physics/HookesLaw/mu", 0.0);
107 _E = mu*(3*lambda + 2*mu)/(lambda+mu);
108 _nu = lambda/(2*(lambda+mu));
110 else if( input.have_variable(
"Physics/HookesLaw/E") &&
111 input.have_variable(
"Physics/HookesLaw/nu") )
114 "StressStrainLaw/HookesLaw/E" );
116 "StressStrainLaw/HookesLaw/nu" );
123 libmesh_error_msg(
"ERROR: Could not find consistent HookesLaw input!");
128 libmesh_error_msg(
"ERROR: Detected non-positive Young's modulus!");
133 std::string warning =
"WARNING: Detected non-positive Poisson's ratio";
146 if( ( !input.have_variable(
"Physics/HookesLaw/lambda") ||
147 !input.have_variable(
"Physics/HookesLaw/mu") ) &&
148 ( !input.have_variable(
"Physics/HookesLaw/E") ||
149 !input.have_variable(
"Physics/HookesLaw/nu") ) )
151 std::cerr <<
"Error: Must specify either Lame constants lambda and mu or" << std::endl
152 <<
" Young's modulus and Poisson's ratio." << std::endl;
156 if( input.have_variable(
"Physics/HookesLaw/lambda") &&
157 input.have_variable(
"Physics/HookesLaw/mu") )
161 libMesh::Real lambda = input(
"Physics/HookesLaw/lambda", 0.0);
162 libMesh::Real mu = input(
"Physics/HookesLaw/mu", 0.0);
163 _E = mu*(3*lambda + 2*mu)/(lambda+mu);
164 _nu = lambda/(2*(lambda+mu));
168 if( input.have_variable(
"Physics/HookesLaw/E") )
170 (
_E, input,
"Physics/HookesLaw/E", 0.0);
172 if( input.have_variable(
"Physics/HookesLaw/nu") )
174 (
_nu, input,
"Physics/HookesLaw/nu", 0.0);
187 libMesh::Real strain = 0.5*(G_cov(0,0) - g_cov(0,0));
189 stress(0,0) = (this->
_E)*g_contra(0,0)*g_contra(0,0)*strain;
204 C(0,0,0,0) = this->
_E*g_contra(0,0)*g_contra(0,0);
214 libmesh_not_implemented();
virtual void set_parameter(libMesh::Number ¶m_variable, const GetPot &input, const std::string ¶m_name, libMesh::Number param_default)
Each subclass can simultaneously read a parameter value from.
libMesh::Real _E
Lam\'{e} constant.
libMesh::Real _nu
Lam\'{e} constant.
#define grins_warning(message)
void compute_stress_and_elasticity_imp(unsigned int dim, const libMesh::TensorValue< libMesh::Real > &g_contra, const libMesh::TensorValue< libMesh::Real > &g_cov, const libMesh::TensorValue< libMesh::Real > &G_contra, const libMesh::TensorValue< libMesh::Real > &G_cov, libMesh::TensorValue< libMesh::Real > &stress, ElasticityTensor &C)
Hooke's law specialized for one-dimensional problems.
void compute_stress_imp(unsigned int dim, const libMesh::TensorValue< libMesh::Real > &g_contra, const libMesh::TensorValue< libMesh::Real > &g_cov, const libMesh::TensorValue< libMesh::Real > &G_contra, const libMesh::TensorValue< libMesh::Real > &G_cov, libMesh::TensorValue< libMesh::Real > &stress)
ParameterUser base class. Utility methods for subclasses.
void read_input_options(const GetPot &input)
Parse properties from input.
static void dep_input_warning(const std::string &old_option, const std::string &property)
Helper function for parsing/maintaing backward compatibility.
static void duplicate_input_test(const GetPot &input, const std::string &option1, const std::string &option2)
Helper function for parsing/maintaing backward compatibility.
libMesh::Real compute_33_stress_imp(const libMesh::TensorValue< libMesh::Real > &g_contra, const libMesh::TensorValue< libMesh::Real > &g_cov, const libMesh::TensorValue< libMesh::Real > &G_contra, const libMesh::TensorValue< libMesh::Real > &G_cov)