34 #ifndef OOMPH_ELASTICITY_TENSOR_HEADER 35 #define OOMPH_ELASTICITY_TENSOR_HEADER 39 #include <oomph-lib-config.h> 42 #include "../generic/oomph_utilities.h" 65 static const unsigned Index[3][3][3][3];
77 const unsigned &k,
const unsigned &l)
const 79 if((i > 2) || (j > 2) || (k> 2) || (l>2))
81 std::ostringstream error_message;
84 error_message <<
"Range Error : Index 1 " << i
85 <<
" is not in the range (0,2)";
89 error_message <<
"Range Error : Index 2 " << j
90 <<
" is not in the range (0,2)";
95 error_message <<
"Range Error : Index 2 " << k
96 <<
" is not in the range (0,2)";
101 error_message <<
"Range Error : Index 4 " << l
102 <<
" is not in the range (0,2)";
107 OOMPH_CURRENT_FUNCTION,
108 OOMPH_EXCEPTION_LOCATION);
125 const unsigned &k,
const unsigned &l)
const 137 const unsigned &k,
const unsigned &l,
140 std::stringstream error_stream;
141 error_stream <<
"Broken base implementation.\n" 142 <<
"Must be overloaded for specific storage schemes.\n";
144 OOMPH_CURRENT_FUNCTION,
145 OOMPH_EXCEPTION_LOCATION);
167 static const unsigned StaticIndex[21];
181 double lambda=E*nu/((1.0+nu)*(1.0-2.0*nu));
182 double mu=E/(2.0*(1.0+nu));
183 this->set_lame_coefficients(lambda,mu);
196 double lambda=E*nu/((1.0+nu)*(1.0-2.0*nu));
197 double mu=E/(2.0*(1.0+nu));
198 this->set_lame_coefficients(lambda,mu);
208 this->set_lame_coefficients(lame[0],lame[1]);
221 double lambda=
E*nu/((1.0+nu)*(1.0-2.0*nu));
222 double mu=
E/(2.0*(1.0+nu));
223 this->set_lame_coefficients(lambda,mu);
229 {
return C[StaticIndex[
i]];}
237 C[1] = lambda + 2.0*mu;
261 for(
unsigned i=0;
i<21;
i++) {C[
i] = 0.0;}
270 const unsigned &k,
const unsigned &l,
const double &value)
272 C[this->
Index[
i][j][k][l]] = value;
virtual void set_value(const unsigned &i, const unsigned &j, const unsigned &k, const unsigned &l, const double &value)
Allow the values to be set (virtual function that must be overloaded if values can be set directly...
double independent_component(const unsigned &i) const
Overload the independent coefficient function.
ElasticityTensor()
Empty Constructor.
GeneralElasticityTensor()
Empy Constructor.
IsotropicElasticityTensor(const double &nu, const double &E)
Constructor. Passing in the values of the Poisson's ratio and Young's modulus (interpreted as the rat...
double independent_component(const unsigned &i) const
Overload the independent coefficient function.
void set_value(const unsigned &i, const unsigned &j, const unsigned &k, const unsigned &l, const double &value)
Allow the values to be set.
double operator()(const unsigned &i, const unsigned &j, const unsigned &k, const unsigned &l) const
Return the appropriate independent component via the index translation scheme (const version)...
void update_constitutive_parameters(const double &nu, const double &E=1.0)
Update parameters: Specify values of the Poisson's ratio and (optionally) Young's modulus (interprete...
static const unsigned Index[3][3][3][3]
Translation table from the four indices to the corresponding independent component.
virtual ~ElasticityTensor()
Empty virtual Destructor.
IsotropicElasticityTensor(const Vector< double > &lame)
Constructur. Passing in the values of the two lame coefficients directly (interpreted as the ratios o...
void range_check(const unsigned &i, const unsigned &j, const unsigned &k, const unsigned &l) const
Helper range checking function (Note that this only captures over-runs in 3D but errors are likely to...
void set_lame_coefficients(const double &lambda, const double &mu)
virtual double independent_component(const unsigned &i) const
IsotropicElasticityTensor(const double &nu)
Constructor. Passing in the value of the Poisson's ratio. Stresses and tractions in the governing equ...