32 #include "libmesh/getpot.h"
33 #include "libmesh/tensor_value.h"
56 if( ( !input.have_variable(
"Physics/HookesLaw/lambda") ||
57 !input.have_variable(
"Physics/HookesLaw/mu") ) &&
58 ( !input.have_variable(
"Physics/HookesLaw/E") ||
59 !input.have_variable(
"Physics/HookesLaw/nu") ) )
61 std::cerr <<
"Error: Must specify either Lame constants lambda and mu or" << std::endl
62 <<
" Young's modulus and Poisson's ratio." << std::endl;
66 if( input.have_variable(
"Physics/HookesLaw/lambda") &&
67 input.have_variable(
"Physics/HookesLaw/mu") )
71 libMesh::Real lambda = input(
"Physics/HookesLaw/lambda", 0.0);
72 libMesh::Real mu = input(
"Physics/HookesLaw/mu", 0.0);
73 _E = mu*(3*lambda + 2*mu)/(lambda+mu);
74 _nu = lambda/(2*(lambda+mu));
78 if( input.have_variable(
"Physics/HookesLaw/E") )
80 (
_E, input,
"Physics/HookesLaw/E", 0.0);
82 if( input.have_variable(
"Physics/HookesLaw/nu") )
84 (
_nu, input,
"Physics/HookesLaw/nu", 0.0);
97 libMesh::Real strain = 0.5*(G_cov(0,0) - g_cov(0,0));
99 stress(0,0) = (this->
_E)*g_contra(0,0)*g_contra(0,0)*strain;
114 C(0,0,0,0) = this->
_E*g_contra(0,0)*g_contra(0,0);
124 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.
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.
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)