v0.13.0
Public Member Functions | Public Attributes | Static Protected Member Functions | List of all members
NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI< TYPE > Struct Template Reference

Implementation of elastic (non-linear) St. Kirchhoff equation. More...

#include <users_modules/basic_finite_elements/src/NonLinearElasticElement.hpp>

Inheritance diagram for NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI< TYPE >:
[legend]
Collaboration diagram for NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI< TYPE >:
[legend]

Public Member Functions

 FunctionsToCalculatePiolaKirchhoffI ()
 
virtual ~FunctionsToCalculatePiolaKirchhoffI ()=default
 
MoFEMErrorCode calculateC_CauchyDeformationTensor ()
 
MoFEMErrorCode calculateE_GreenStrain ()
 
MoFEMErrorCode calculateS_PiolaKirchhoffII ()
 
virtual MoFEMErrorCode calculateP_PiolaKirchhoffI (const BlockData block_data, boost::shared_ptr< const NumeredEntFiniteElement > fe_ptr)
 Function overload to implement user material. More...
 
virtual MoFEMErrorCode calculateCauchyStress (const BlockData block_data, boost::shared_ptr< const NumeredEntFiniteElement > fe_ptr)
 Function overload to implement user material. More...
 
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 calculateElasticEnergy (const BlockData block_data, boost::shared_ptr< const NumeredEntFiniteElement > fe_ptr)
 Calculate elastic energy density. 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

FTensor::Index< 'i', 3 > i
 
FTensor::Index< 'j', 3 > j
 
FTensor::Index< 'k', 3 > k
 
double lambda
 
double mu
 
MatrixBoundedArray< TYPE, 9 > F
 
MatrixBoundedArray< TYPE, 9 > C
 
MatrixBoundedArray< TYPE, 9 > E
 
MatrixBoundedArray< TYPE, 9 > S
 
MatrixBoundedArray< TYPE, 9 > invF
 
MatrixBoundedArray< TYPE, 9 > P
 
MatrixBoundedArray< TYPE, 9 > sIGma
 
MatrixBoundedArray< TYPE, 9 > h
 
MatrixBoundedArray< TYPE, 9 > H
 
MatrixBoundedArray< TYPE, 9 > invH
 
MatrixBoundedArray< TYPE, 9 > sigmaCauchy
 
FTensor::Tensor2< FTensor::PackPtr< TYPE *, 0 >, 3, 3 > t_F
 
FTensor::Tensor2< FTensor::PackPtr< TYPE *, 0 >, 3, 3 > t_C
 
FTensor::Tensor2< FTensor::PackPtr< TYPE *, 0 >, 3, 3 > t_E
 
FTensor::Tensor2< FTensor::PackPtr< TYPE *, 0 >, 3, 3 > t_S
 
FTensor::Tensor2< FTensor::PackPtr< TYPE *, 0 >, 3, 3 > t_invF
 
FTensor::Tensor2< FTensor::PackPtr< TYPE *, 0 >, 3, 3 > t_P
 
FTensor::Tensor2< FTensor::PackPtr< TYPE *, 0 >, 3, 3 > t_sIGma
 
FTensor::Tensor2< FTensor::PackPtr< TYPE *, 0 >, 3, 3 > t_h
 
FTensor::Tensor2< FTensor::PackPtr< TYPE *, 0 >, 3, 3 > t_H
 
FTensor::Tensor2< FTensor::PackPtr< TYPE *, 0 >, 3, 3 > t_invH
 
FTensor::Tensor2< FTensor::PackPtr< TYPE *, 0 >, 3, 3 > t_sigmaCauchy
 
TYPE J
 
TYPE eNergy
 
TYPE detH
 
TYPE detF
 
int gG
 Gauss point number. More...
 
CommonDatacommonDataPtr
 
MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperatoropPtr
 pointer to finite element tetrahedral operator More...
 

Static Protected Member Functions

static auto resizeAndSet (MatrixBoundedArray< TYPE, 9 > &m)
 

Detailed Description

template<typename TYPE>
struct NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI< TYPE >

Implementation of elastic (non-linear) St. Kirchhoff equation.

Examples
NeoHookean.hpp.

Definition at line 143 of file NonLinearElasticElement.hpp.

Constructor & Destructor Documentation

◆ FunctionsToCalculatePiolaKirchhoffI()

Definition at line 149 of file NonLinearElasticElement.hpp.

155  }
FTensor::Tensor2< FTensor::PackPtr< TYPE *, 0 >, 3, 3 > t_h
FTensor::Tensor2< FTensor::PackPtr< TYPE *, 0 >, 3, 3 > t_invH
FTensor::Tensor2< FTensor::PackPtr< TYPE *, 0 >, 3, 3 > t_C
FTensor::Tensor2< FTensor::PackPtr< TYPE *, 0 >, 3, 3 > t_sIGma
FTensor::Tensor2< FTensor::PackPtr< TYPE *, 0 >, 3, 3 > t_F
FTensor::Tensor2< FTensor::PackPtr< TYPE *, 0 >, 3, 3 > t_sigmaCauchy
FTensor::Tensor2< FTensor::PackPtr< TYPE *, 0 >, 3, 3 > t_P
FTensor::Tensor2< FTensor::PackPtr< TYPE *, 0 >, 3, 3 > t_H
FTensor::Tensor2< FTensor::PackPtr< TYPE *, 0 >, 3, 3 > t_E
FTensor::Tensor2< FTensor::PackPtr< TYPE *, 0 >, 3, 3 > t_invF
FTensor::Tensor2< FTensor::PackPtr< TYPE *, 0 >, 3, 3 > t_S
static auto resizeAndSet(MatrixBoundedArray< TYPE, 9 > &m)

◆ ~FunctionsToCalculatePiolaKirchhoffI()

Member Function Documentation

◆ calculateC_CauchyDeformationTensor()

template<typename TYPE >
MoFEMErrorCode NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI< TYPE >::calculateC_CauchyDeformationTensor ( )
Examples
NeoHookean.hpp.

Definition at line 173 of file NonLinearElasticElement.hpp.

173  {
175  t_C(i, j) = t_F(k, i) * t_F(k, j);
177  }
#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

◆ calculateCauchyStress()

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

Function overload to implement user material.

Calculation of Piola Kirchhoff I is implemented by user. Tangent matrix user implemented physical equation is calculated using automatic differentiation.

\(\mathbf{S} = \lambda\textrm{tr}[\mathbf{E}]\mathbf{I}+2\mu\mathbf{E}\)

Notes:
Number of actual Gauss point is accessed from variable gG.
Access to operator data structures is available by variable opPtr.
Access to common data is by commonDataPtr.

Parameters
block_dataused to give access to material parameters
fe_ptrpointer to element data structures

For details look to:
NONLINEAR CONTINUUM MECHANICS FOR FINITE ELEMENT ANALYSIS, Javier Bonet, Richard D. Wood

Definition at line 253 of file NonLinearElasticElement.hpp.

255  {
257  sigmaCauchy.resize(3, 3);
258  t_sigmaCauchy(i, j) = t_P(i, k) * t_F(j, k);
261  }
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
static auto determinantTensor3by3(T &t)
Calculate the determinant of a 3x3 matrix or a tensor of rank 2.
Definition: Templates.hpp:1161

◆ calculateE_GreenStrain()

template<typename TYPE >
MoFEMErrorCode NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI< TYPE >::calculateE_GreenStrain ( )

Definition at line 179 of file NonLinearElasticElement.hpp.

179  {
181  constexpr auto t_kd = FTensor::Kronecker_Delta<double>();
182  t_E(i, j) = 0.5 * (t_C(i, j) - t_kd(i, j));
184  }
Kronecker Delta class.
constexpr auto t_kd

◆ calculateElasticEnergy()

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

Calculate elastic energy density.

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

Reimplemented in SmallStrainTranverslyIsotropic< TYPE >, SmallStrainTranverslyIsotropic< double >, SmallStrainTranverslyIsotropic< adouble >, NeoHookean< TYPE >, and Hooke< TYPE >.

Definition at line 305 of file NonLinearElasticElement.hpp.

307  {
309  lambda = LAMBDA(block_data.E, block_data.PoissonRatio);
310  mu = MU(block_data.E, block_data.PoissonRatio);
313  TYPE trace = 0;
314  eNergy = 0;
315  for (int ii = 0; ii < 3; ii++) {
316  trace += E(ii, ii);
317  for (int jj = 0; jj < 3; jj++) {
318  TYPE e = E(ii, jj);
319  eNergy += mu * e * e;
320  }
321  }
322  eNergy += 0.5 * lambda * trace * trace;
324  }
#define CHKERR
Inline error check.
Definition: definitions.h:548
#define MU(E, NU)
Definition: fem_tools.h:33
#define LAMBDA(E, NU)
Definition: fem_tools.h:32
double trace(FTensor::Tensor2_symmetric< T, SPACE_DIM > &t_stress)
Definition: PlasticOps.hpp:351
@ TYPE
Definition: inflate.h:32

◆ calculateP_PiolaKirchhoffI()

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

Function overload to implement user material.

Calculation of Piola Kirchhoff I is implemented by user. Tangent matrix user implemented physical equation is calculated using automatic differentiation.

\(\mathbf{S} = \lambda\textrm{tr}[\mathbf{E}]\mathbf{I}+2\mu\mathbf{E}\)

Notes:
Number of actual Gauss point is accessed from variable gG.
Access to operator data structures is available by variable opPtr.
Access to common data is by commonDataPtr.

Parameters
block_dataused to give access to material parameters
fe_ptrpointer to element data structures

For details look to:
NONLINEAR CONTINUUM MECHANICS FOR FINITE ELEMENT ANALYSIS, Javier Bonet, Richard D. Wood

Reimplemented in VolumeLengthQuality< TYPE >, SmallStrainTranverslyIsotropic< TYPE >, SmallStrainTranverslyIsotropic< double >, SmallStrainTranverslyIsotropic< adouble >, NeoHookean< TYPE >, and Hooke< TYPE >.

Definition at line 217 of file NonLinearElasticElement.hpp.

219  {
221  lambda = LAMBDA(block_data.E, block_data.PoissonRatio);
222  mu = MU(block_data.E, block_data.PoissonRatio);
226  t_P(i, j) = t_F(i, k) * t_S(k, j);
228  }

◆ calculateS_PiolaKirchhoffII()

template<typename TYPE >
MoFEMErrorCode NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI< TYPE >::calculateS_PiolaKirchhoffII ( )

Definition at line 187 of file NonLinearElasticElement.hpp.

187  {
189  constexpr auto t_kd = FTensor::Kronecker_Delta<double>();
190  t_S(i, j) = (2 * mu) * t_E(i, j) + (lambda * t_E(k, k)) * t_kd(i, j);
192  }

◆ calculatesIGma_EshelbyStress()

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

Calculate Eshelby stress.

Definition at line 328 of file NonLinearElasticElement.hpp.

330  {
332  CHKERR calculateP_PiolaKirchhoffI(block_data, fe_ptr);
333  CHKERR calculateElasticEnergy(block_data, fe_ptr);
334  constexpr auto t_kd = FTensor::Kronecker_Delta<double>();
335  t_sIGma(i, j) = t_kd(i, j) * eNergy - t_F(k, i) * t_P(k, j);
337  }
virtual MoFEMErrorCode calculateP_PiolaKirchhoffI(const BlockData block_data, boost::shared_ptr< const NumeredEntFiniteElement > fe_ptr)
Function overload to implement user material.
virtual MoFEMErrorCode calculateElasticEnergy(const BlockData block_data, boost::shared_ptr< const NumeredEntFiniteElement > fe_ptr)
Calculate elastic energy density.

◆ getDataOnPostProcessor()

template<typename TYPE >
virtual MoFEMErrorCode NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI< TYPE >::getDataOnPostProcessor ( std::map< std::string, std::vector< VectorDouble >> &  field_map,
std::map< std::string, std::vector< MatrixDouble >> &  grad_map 
)
virtual

Do operations when pre-process.

Definition at line 341 of file NonLinearElasticElement.hpp.

343  {
346  }

◆ resizeAndSet()

template<typename TYPE >
static auto NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI< TYPE >::resizeAndSet ( MatrixBoundedArray< TYPE, 9 > &  m)
staticprotected
Examples
NeoHookean.hpp.

Definition at line 349 of file NonLinearElasticElement.hpp.

349  {
350  m.resize(3, 3, false);
352  };
auto getFTensor2FromArray3by3(ublas::matrix< T, L, A > &data, const FTensor::Number< S > &, const size_t rr)
Definition: Templates.hpp:940
FTensor::Index< 'm', 3 > m

◆ setUserActiveVariables() [1/2]

template<typename TYPE >
virtual MoFEMErrorCode NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI< TYPE >::setUserActiveVariables ( int &  nb_active_variables)
virtual

add additional active variables

Note
This member function if used should be implement by template member function Specialization, different implementation needed for TYPE=double or TYPE=adouble

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.

Parameters
nb_active_variablesnumber of active variables
Returns
error code

Reimplemented in MyMat< TYPE >, and SmallStrainTranverslyIsotropicADouble.

Definition at line 277 of file NonLinearElasticElement.hpp.

277  {
280  }

◆ setUserActiveVariables() [2/2]

template<typename TYPE >
virtual MoFEMErrorCode NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI< TYPE >::setUserActiveVariables ( VectorDouble &  activeVariables)
virtual

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.

/note First 9 elements are reserved for gradient of deformation.

Parameters
activeVariablesvector of deepened variables, values after index 9 should be add.
Returns
error code

Reimplemented in MyMat< TYPE >, and SmallStrainTranverslyIsotropicADouble.

Definition at line 295 of file NonLinearElasticElement.hpp.

295  {
298  }

Member Data Documentation

◆ C

template<typename TYPE >
MatrixBoundedArray<TYPE, 9> NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI< TYPE >::C
Examples
NeoHookean.hpp.

Definition at line 160 of file NonLinearElasticElement.hpp.

◆ commonDataPtr

common data shared between entities (f.e. field values at Gauss pts.)

Definition at line 168 of file NonLinearElasticElement.hpp.

◆ detF

Definition at line 165 of file NonLinearElasticElement.hpp.

◆ detH

Definition at line 165 of file NonLinearElasticElement.hpp.

◆ E

template<typename TYPE >
MatrixBoundedArray<TYPE, 9> NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI< TYPE >::E

Definition at line 160 of file NonLinearElasticElement.hpp.

◆ eNergy

Examples
NeoHookean.hpp.

Definition at line 165 of file NonLinearElasticElement.hpp.

◆ F

template<typename TYPE >
MatrixBoundedArray<TYPE, 9> NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI< TYPE >::F
Examples
NeoHookean.hpp.

Definition at line 160 of file NonLinearElasticElement.hpp.

◆ gG

Gauss point number.

Definition at line 167 of file NonLinearElasticElement.hpp.

◆ h

template<typename TYPE >
MatrixBoundedArray<TYPE, 9> NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI< TYPE >::h

Definition at line 160 of file NonLinearElasticElement.hpp.

◆ H

template<typename TYPE >
MatrixBoundedArray<TYPE, 9> NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI< TYPE >::H

Definition at line 160 of file NonLinearElasticElement.hpp.

◆ i

Definition at line 145 of file NonLinearElasticElement.hpp.

◆ invF

template<typename TYPE >
MatrixBoundedArray<TYPE, 9> NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI< TYPE >::invF

Definition at line 160 of file NonLinearElasticElement.hpp.

◆ invH

template<typename TYPE >
MatrixBoundedArray<TYPE, 9> NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI< TYPE >::invH

Definition at line 160 of file NonLinearElasticElement.hpp.

◆ j

Definition at line 146 of file NonLinearElasticElement.hpp.

◆ J

Examples
NeoHookean.hpp.

Definition at line 165 of file NonLinearElasticElement.hpp.

◆ k

Definition at line 147 of file NonLinearElasticElement.hpp.

◆ lambda

template<typename TYPE >
double NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI< TYPE >::lambda
Examples
NeoHookean.hpp.

Definition at line 159 of file NonLinearElasticElement.hpp.

◆ mu

Examples
NeoHookean.hpp.

Definition at line 159 of file NonLinearElasticElement.hpp.

◆ opPtr

pointer to finite element tetrahedral operator

Definition at line 171 of file NonLinearElasticElement.hpp.

◆ P

template<typename TYPE >
MatrixBoundedArray<TYPE, 9> NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI< TYPE >::P

Definition at line 160 of file NonLinearElasticElement.hpp.

◆ S

template<typename TYPE >
MatrixBoundedArray<TYPE, 9> NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI< TYPE >::S

Definition at line 160 of file NonLinearElasticElement.hpp.

◆ sIGma

template<typename TYPE >
MatrixBoundedArray<TYPE, 9> NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI< TYPE >::sIGma

Definition at line 160 of file NonLinearElasticElement.hpp.

◆ sigmaCauchy

template<typename TYPE >
MatrixBoundedArray<TYPE, 9> NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI< TYPE >::sigmaCauchy

Definition at line 161 of file NonLinearElasticElement.hpp.

◆ t_C

Examples
NeoHookean.hpp.

Definition at line 162 of file NonLinearElasticElement.hpp.

◆ t_E

Definition at line 162 of file NonLinearElasticElement.hpp.

◆ t_F

Examples
NeoHookean.hpp.

Definition at line 162 of file NonLinearElasticElement.hpp.

◆ t_h

Definition at line 163 of file NonLinearElasticElement.hpp.

◆ t_H

Definition at line 163 of file NonLinearElasticElement.hpp.

◆ t_invF

Definition at line 163 of file NonLinearElasticElement.hpp.

◆ t_invH

Definition at line 163 of file NonLinearElasticElement.hpp.

◆ t_P

Examples
NeoHookean.hpp.

Definition at line 163 of file NonLinearElasticElement.hpp.

◆ t_S

Examples
NeoHookean.hpp.

Definition at line 162 of file NonLinearElasticElement.hpp.

◆ t_sIGma

Definition at line 163 of file NonLinearElasticElement.hpp.

◆ t_sigmaCauchy

Definition at line 163 of file NonLinearElasticElement.hpp.


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