v0.13.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 /* This file is part of MoFEM.
7  * MoFEM is free software: you can redistribute it and/or modify it under
8  * the terms of the GNU Lesser General Public License as published by the
9  * Free Software Foundation, either version 3 of the License, or (at your
10  * option) any later version.
11  *
12  * MoFEM is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15  * License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with MoFEM. If not, see <http://www.gnu.org/licenses/>. */
19 
20 #ifndef __HOOKE_HPP__
21 #define __HOOKE_HPP__
22 
23 #ifndef WITH_ADOL_C
24 #error "MoFEM need to be compiled with ADOL-C"
25 #endif
26 
27 /** \brief Hook equation
28  * \ingroup nonlinear_elastic_elem
29  */
30 template <typename TYPE>
31 struct Hooke
33  TYPE> {
34 
37 
38  ublas::matrix<TYPE> ePs;
40 
41  /** \brief Hooke equation
42  *
43  * \f$\sigma = \lambda\textrm{tr}[\varepsilon]+2\mu\varepsilon\f$
44  *
45  */
47  const NonlinearElasticElement::BlockData block_data,
48  boost::shared_ptr<const NumeredEntFiniteElement> fe_ptr) {
50  this->lambda = LAMBDA(block_data.E, block_data.PoissonRatio);
51  this->mu = MU(block_data.E, block_data.PoissonRatio);
52  ePs.resize(3, 3, false);
53  noalias(ePs) = this->F;
54  for (int dd = 0; dd < 3; dd++) {
55  ePs(dd, dd) -= 1;
56  }
57  ePs += trans(ePs);
58  ePs *= 0.5;
59  this->P.resize(3, 3, false);
60  noalias(this->P) = 2 * this->mu * ePs;
61  tR = 0;
62  for (int dd = 0; dd < 3; dd++) {
63  tR += ePs(dd, dd);
64  }
65  for (int dd = 0; dd < 3; dd++) {
66  this->P(dd, dd) += this->lambda * tR;
67  }
69  }
70 
71  /** \brief calculate density of strain energy
72  *
73  * \f$\Psi =
74  * \frac{1}{2}\lambda(\textrm{tr}[\varepsilon])^2+\mu\varepsilon:\varepsilon\f$
75  *
76  */
78  const NonlinearElasticElement::BlockData block_data,
79  boost::shared_ptr<const NumeredEntFiniteElement> fe_ptr) {
81  this->lambda = LAMBDA(block_data.E, block_data.PoissonRatio);
82  this->mu = MU(block_data.E, block_data.PoissonRatio);
83  ePs.resize(3, 3);
84  noalias(ePs) = this->F;
85  for (int dd = 0; dd < 3; dd++) {
86  ePs(dd, dd) -= 1;
87  }
88  ePs += trans(ePs);
89  ePs *= 0.5;
90  this->eNergy = 0;
91  tR = 0;
92  for (int dd = 0; dd < 3; dd++) {
93  tR += ePs(dd, dd);
94  for (int jj = 0; jj < 3; jj++) {
95  this->eNergy += this->mu * ePs(dd, jj) * ePs(dd, jj);
96  }
97  }
98  this->eNergy += 0.5 * this->lambda * tR * tR;
100  }
101 };
102 
103 #endif //__HOOKE_HPP__
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:453
#define MU(E, NU)
Definition: fem_tools.h:33
#define LAMBDA(E, NU)
Definition: fem_tools.h:32
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
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:67
Hook equation.
Definition: Hooke.hpp:33
TYPE tR
Definition: Hooke.hpp:39
virtual MoFEMErrorCode calculateP_PiolaKirchhoffI(const NonlinearElasticElement::BlockData block_data, boost::shared_ptr< const NumeredEntFiniteElement > fe_ptr)
Hooke equation.
Definition: Hooke.hpp:46
virtual MoFEMErrorCode calculateElasticEnergy(const NonlinearElasticElement::BlockData block_data, boost::shared_ptr< const NumeredEntFiniteElement > fe_ptr)
calculate density of strain energy
Definition: Hooke.hpp:77
ublas::matrix< TYPE > ePs
Definition: Hooke.hpp:38
Hooke()
Definition: Hooke.hpp:35
data for calculation heat conductivity and heat capacity elements
Implementation of elastic (non-linear) St. Kirchhoff equation.
structure grouping operators and data used for calculation of nonlinear elastic element
@ TYPE
Definition: inflate.h:32