v0.13.1
Loading...
Searching...
No Matches
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 */
18template <typename TYPE>
19struct 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 */
34 virtual MoFEMErrorCode calculateP_PiolaKirchhoffI(
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 */
65 virtual MoFEMErrorCode calculateElasticEnergy(
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__
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:440
#define MU(E, NU)
Definition: fem_tools.h:23
#define LAMBDA(E, NU)
Definition: fem_tools.h:22
Hook equation.
Definition: Hooke.hpp:21
TYPE tR
Definition: Hooke.hpp:27
virtual MoFEMErrorCode calculateP_PiolaKirchhoffI(const NonlinearElasticElement::BlockData block_data, boost::shared_ptr< const NumeredEntFiniteElement > fe_ptr)
Hooke equation.
Definition: Hooke.hpp:34
virtual MoFEMErrorCode calculateElasticEnergy(const NonlinearElasticElement::BlockData block_data, boost::shared_ptr< const NumeredEntFiniteElement > fe_ptr)
calculate density of strain energy
Definition: Hooke.hpp:65
ublas::matrix< TYPE > ePs
Definition: Hooke.hpp:26
Hooke()
Definition: Hooke.hpp:23
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