v0.14.0
Hooke.hpp
Go to the documentation of this file.
1 /** \file Hooke.hpp
2  * \ingroup nonlinear_elastic_elem
3  * \brief Implementation of linear elastic material
4  */
5 
6 
7 
8 #ifndef __HOOKE_HPP__
9 #define __HOOKE_HPP__
10 
11 #ifndef WITH_ADOL_C
12 #error "MoFEM need to be compiled with ADOL-C"
13 #endif
14 
15 /** \brief Hook equation
16  * \ingroup nonlinear_elastic_elem
17  */
18 template <typename TYPE>
19 struct Hooke
21  TYPE> {
22 
25 
26  ublas::matrix<TYPE> ePs;
27  TYPE tR;
28 
29  /** \brief Hooke equation
30  *
31  * \f$\sigma = \lambda\textrm{tr}[\varepsilon]+2\mu\varepsilon\f$
32  *
33  */
35  const NonlinearElasticElement::BlockData block_data,
36  boost::shared_ptr<const NumeredEntFiniteElement> fe_ptr) {
38  this->lambda = LAMBDA(block_data.E, block_data.PoissonRatio);
39  this->mu = MU(block_data.E, block_data.PoissonRatio);
40  ePs.resize(3, 3, false);
41  noalias(ePs) = this->F;
42  for (int dd = 0; dd < 3; dd++) {
43  ePs(dd, dd) -= 1;
44  }
45  ePs += trans(ePs);
46  ePs *= 0.5;
47  this->P.resize(3, 3, false);
48  noalias(this->P) = 2 * this->mu * ePs;
49  tR = 0;
50  for (int dd = 0; dd < 3; dd++) {
51  tR += ePs(dd, dd);
52  }
53  for (int dd = 0; dd < 3; dd++) {
54  this->P(dd, dd) += this->lambda * tR;
55  }
57  }
58 
59  /** \brief calculate density of strain energy
60  *
61  * \f$\Psi =
62  * \frac{1}{2}\lambda(\textrm{tr}[\varepsilon])^2+\mu\varepsilon:\varepsilon\f$
63  *
64  */
66  const NonlinearElasticElement::BlockData block_data,
67  boost::shared_ptr<const NumeredEntFiniteElement> fe_ptr) {
69  this->lambda = LAMBDA(block_data.E, block_data.PoissonRatio);
70  this->mu = MU(block_data.E, block_data.PoissonRatio);
71  ePs.resize(3, 3);
72  noalias(ePs) = this->F;
73  for (int dd = 0; dd < 3; dd++) {
74  ePs(dd, dd) -= 1;
75  }
76  ePs += trans(ePs);
77  ePs *= 0.5;
78  this->eNergy = 0;
79  tR = 0;
80  for (int dd = 0; dd < 3; dd++) {
81  tR += ePs(dd, dd);
82  for (int jj = 0; jj < 3; jj++) {
83  this->eNergy += this->mu * ePs(dd, jj) * ePs(dd, jj);
84  }
85  }
86  this->eNergy += 0.5 * this->lambda * tR * tR;
88  }
89 };
90 
91 #endif //__HOOKE_HPP__
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI::FunctionsToCalculatePiolaKirchhoffI
FunctionsToCalculatePiolaKirchhoffI()
Definition: NonLinearElasticElement.hpp:136
NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI::eNergy
TYPE eNergy
Definition: NonLinearElasticElement.hpp:152
NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI
Implementation of elastic (non-linear) St. Kirchhoff equation.
Definition: NonLinearElasticElement.hpp:79
Hooke::tR
TYPE tR
Definition: Hooke.hpp:27
NonlinearElasticElement
structure grouping operators and data used for calculation of nonlinear elastic element
Definition: HookeElement.hpp:27
MoFEM::Exceptions::MoFEMErrorCode
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:56
LAMBDA
#define LAMBDA(E, NU)
Definition: fem_tools.h:22
Hooke::calculateElasticEnergy
virtual MoFEMErrorCode calculateElasticEnergy(const NonlinearElasticElement::BlockData block_data, boost::shared_ptr< const NumeredEntFiniteElement > fe_ptr)
calculate density of strain energy
Definition: Hooke.hpp:65
NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI::F
MatrixBoundedArray< TYPE, 9 > F
Definition: NonLinearElasticElement.hpp:147
Hooke::calculateP_PiolaKirchhoffI
virtual MoFEMErrorCode calculateP_PiolaKirchhoffI(const NonlinearElasticElement::BlockData block_data, boost::shared_ptr< const NumeredEntFiniteElement > fe_ptr)
Hooke equation.
Definition: Hooke.hpp:34
NonlinearElasticElement::BlockData::E
double E
Definition: HookeElement.hpp:34
NonlinearElasticElement::BlockData
data for calculation heat conductivity and heat capacity elements
Definition: HookeElement.hpp:32
NonlinearElasticElement::BlockData::PoissonRatio
double PoissonRatio
Definition: HookeElement.hpp:35
FTensor::dd
const Tensor2_symmetric_Expr< const ddTensor0< T, Dim, i, j >, typename promote< T, double >::V, Dim, i, j > dd(const Tensor0< T * > &a, const Index< i, Dim > index1, const Index< j, Dim > index2, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
Definition: ddTensor0.hpp:33
NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI::mu
double mu
Definition: NonLinearElasticElement.hpp:146
Hooke::ePs
ublas::matrix< TYPE > ePs
Definition: Hooke.hpp:26
MoFEMFunctionBeginHot
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:453
NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI::lambda
double lambda
Definition: NonLinearElasticElement.hpp:146
Hooke::Hooke
Hooke()
Definition: Hooke.hpp:23
NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI::P
MatrixBoundedArray< TYPE, 9 > P
Definition: NonLinearElasticElement.hpp:147
MU
#define MU(E, NU)
Definition: fem_tools.h:23
Hooke
Hook equation.
Definition: Hooke.hpp:19