v0.9.0
Public Member Functions | Public Attributes | List of all members
Hooke< TYPE > Struct Template Reference

Hook equation. More...

#include <users_modules/basic_finite_elements/nonlinear_elastic_materials/src/Hooke.hpp>

Inheritance diagram for Hooke< TYPE >:
[legend]
Collaboration diagram for Hooke< TYPE >:
[legend]

Public Member Functions

 Hooke ()
 
virtual MoFEMErrorCode calculateP_PiolaKirchhoffI (const NonlinearElasticElement::BlockData block_data, boost::shared_ptr< const NumeredEntFiniteElement > fe_ptr)
 Hooke equation. More...
 
virtual MoFEMErrorCode calculateElasticEnergy (const NonlinearElasticElement::BlockData block_data, boost::shared_ptr< const NumeredEntFiniteElement > fe_ptr)
 calculate density of strain energy More...
 
- Public Member Functions inherited from NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI< TYPE >
virtual ~FunctionsToCalculatePiolaKirchhoffI ()
 
MoFEMErrorCode dEterminant (ublas::matrix< TYPE, ublas::row_major, ublas::bounded_array< TYPE, 9 >> &a, TYPE &det)
 Calculate determinant of 3x3 matrix. More...
 
MoFEMErrorCode iNvert (TYPE det, ublas::matrix< TYPE, ublas::row_major, ublas::bounded_array< TYPE, 9 >> &a, ublas::matrix< TYPE, ublas::row_major, ublas::bounded_array< TYPE, 9 >> &inv_a)
 Calculate inverse of 3x3 matrix. More...
 
MoFEMErrorCode calculateC_CauchyDeformationTensor ()
 
MoFEMErrorCode calculateE_GreenStrain ()
 
MoFEMErrorCode calculateS_PiolaKirchhoffII ()
 
virtual MoFEMErrorCode setUserActiveVariables (int &nb_active_variables)
 add additional active variables More...
 
virtual MoFEMErrorCode setUserActiveVariables (VectorDouble &activeVariables)
 Add additional independent variables More complex physical models depend on gradient of defamation and some additional variables. For example can depend on temperature. This function adds additional independent variables to the model. More...
 
virtual MoFEMErrorCode calculateSiGma_EshelbyStress (const BlockData block_data, boost::shared_ptr< const NumeredEntFiniteElement > fe_ptr)
 Calculate Eshelby stress. More...
 
virtual MoFEMErrorCode getDataOnPostProcessor (std::map< std::string, std::vector< VectorDouble >> &field_map, std::map< std::string, std::vector< MatrixDouble >> &grad_map)
 Do operations when pre-process. More...
 

Public Attributes

ublas::matrix< TYPE > ePs
 
TYPE tR
 
- Public Attributes inherited from NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI< TYPE >
double lambda
 
double mu
 
ublas::matrix< TYPE, ublas::row_major, ublas::bounded_array< TYPE, 9 > > F
 
ublas::matrix< TYPE, ublas::row_major, ublas::bounded_array< TYPE, 9 > > C
 
ublas::matrix< TYPE, ublas::row_major, ublas::bounded_array< TYPE, 9 > > E
 
ublas::matrix< TYPE, ublas::row_major, ublas::bounded_array< TYPE, 9 > > S
 
ublas::matrix< TYPE, ublas::row_major, ublas::bounded_array< TYPE, 9 > > invF
 
ublas::matrix< TYPE, ublas::row_major, ublas::bounded_array< TYPE, 9 > > P
 
ublas::matrix< TYPE, ublas::row_major, ublas::bounded_array< TYPE, 9 > > SiGma
 
ublas::matrix< TYPE, ublas::row_major, ublas::bounded_array< TYPE, 9 > > h
 
ublas::matrix< TYPE, ublas::row_major, ublas::bounded_array< TYPE, 9 > > H
 
ublas::matrix< TYPE, ublas::row_major, ublas::bounded_array< TYPE, 9 > > invH
 
TYPE J
 
TYPE eNergy
 
TYPE detH
 
int gG
 Gauss point number. More...
 
CommonDatacommonDataPtr
 
MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperatoropPtr
 pointer to finite element tetrahedral operator More...
 

Detailed Description

template<typename TYPE>
struct Hooke< TYPE >

Hook equation.

Examples
cell_forces.cpp.

Definition at line 31 of file Hooke.hpp.

Constructor & Destructor Documentation

◆ Hooke()

template<typename TYPE >
Hooke< TYPE >::Hooke ( )

Definition at line 35 of file Hooke.hpp.

Member Function Documentation

◆ calculateElasticEnergy()

template<typename TYPE >
virtual MoFEMErrorCode Hooke< TYPE >::calculateElasticEnergy ( const NonlinearElasticElement::BlockData  block_data,
boost::shared_ptr< const NumeredEntFiniteElement >  fe_ptr 
)
virtual

calculate density of strain energy

\(\Psi = \frac{1}{2}\lambda(\textrm{tr}[\varepsilon])^2+\mu\varepsilon:\varepsilon\)

Reimplemented from NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI< TYPE >.

Definition at line 77 of file Hooke.hpp.

79  {
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  }
#define LAMBDA(E, NU)
Definition: fem_tools.h:32
ublas::matrix< TYPE, ublas::row_major, ublas::bounded_array< TYPE, 9 > > F
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:501
ublas::matrix< TYPE > ePs
Definition: Hooke.hpp:38
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:508
TYPE tR
Definition: Hooke.hpp:39
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
#define MU(E, NU)
Definition: fem_tools.h:33

◆ calculateP_PiolaKirchhoffI()

template<typename TYPE >
virtual MoFEMErrorCode Hooke< TYPE >::calculateP_PiolaKirchhoffI ( const NonlinearElasticElement::BlockData  block_data,
boost::shared_ptr< const NumeredEntFiniteElement >  fe_ptr 
)
virtual

Hooke equation.

\(\sigma = \lambda\textrm{tr}[\varepsilon]+2\mu\varepsilon\)

Reimplemented from NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI< TYPE >.

Definition at line 46 of file Hooke.hpp.

48  {
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  }
#define LAMBDA(E, NU)
Definition: fem_tools.h:32
ublas::matrix< TYPE, ublas::row_major, ublas::bounded_array< TYPE, 9 > > F
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:501
ublas::matrix< TYPE, ublas::row_major, ublas::bounded_array< TYPE, 9 > > P
ublas::matrix< TYPE > ePs
Definition: Hooke.hpp:38
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:508
TYPE tR
Definition: Hooke.hpp:39
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
#define MU(E, NU)
Definition: fem_tools.h:33

Member Data Documentation

◆ ePs

template<typename TYPE >
ublas::matrix<TYPE> Hooke< TYPE >::ePs

Definition at line 38 of file Hooke.hpp.

◆ tR

template<typename TYPE >
TYPE Hooke< TYPE >::tR

Definition at line 39 of file Hooke.hpp.


The documentation for this struct was generated from the following file: