v0.14.0
Public Member Functions | Public Attributes | List of all members
MyMat_double< TYPE > Struct Template Reference
Inheritance diagram for MyMat_double< TYPE >:
[legend]
Collaboration diagram for MyMat_double< TYPE >:
[legend]

Public Member Functions

 MyMat_double ()
 
virtual MoFEMErrorCode calculateP_PiolaKirchhoffI (const NonlinearElasticElement::BlockData block_data, boost::shared_ptr< const NumeredEntFiniteElement > fe_ptr)
 
- Public Member Functions inherited from NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI< TYPE >
 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

bool doAotherwiseB
 
MatrixDouble D_lambda
 
MatrixDouble D_mu
 
MatrixDouble D
 
VectorBoundedArray< TYPE, 6 > sTrain
 
VectorBoundedArray< TYPE, 6 > sTrain0
 
VectorBoundedArray< TYPE, 6 > sTress
 
FTensor::Index< 'i', 3 > i
 
FTensor::Index< 'j', 3 > j
 
FTensor::Index< 'k', 3 > k
 
- Public Attributes inherited from NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI< TYPE >
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...
 

Additional Inherited Members

- Static Protected Member Functions inherited from NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI< TYPE >
static auto resizeAndSet (MatrixBoundedArray< TYPE, 9 > &m)
 

Detailed Description

template<typename TYPE>
struct MyMat_double< TYPE >

Definition at line 21 of file stability.cpp.

Constructor & Destructor Documentation

◆ MyMat_double()

template<typename TYPE >
MyMat_double< TYPE >::MyMat_double ( )
inline

Definition at line 26 of file stability.cpp.

26 : doAotherwiseB(true){};

Member Function Documentation

◆ calculateP_PiolaKirchhoffI()

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

Definition at line 35 of file stability.cpp.

37  {
39  double lambda = LAMBDA(block_data.E, block_data.PoissonRatio);
40  double mu = MU(block_data.E, block_data.PoissonRatio);
41  if (D_lambda.size1() == 0) {
42  D_lambda.resize(6, 6);
43  D_lambda.clear();
44  for (int rr = 0; rr < 3; rr++) {
45  for (int cc = 0; cc < 3; cc++) {
46  D_lambda(rr, cc) = 1;
47  }
48  }
49  }
50  if (D_mu.size1() == 0) {
51  D_mu.resize(6, 6);
52  D_mu.clear();
53  for (int rr = 0; rr < 6; rr++) {
54  D_mu(rr, rr) = rr < 3 ? 2 : 1;
55  }
56  }
57  D.resize(6, 6);
58  noalias(D) = lambda * D_lambda + mu * D_mu;
59 
60  if (doAotherwiseB) {
61  sTrain.resize(6);
62  sTress.resize(6);
63 
64  sTrain[0] = this->F(0, 0) - 1;
65  sTrain[1] = this->F(1, 1) - 1;
66  sTrain[2] = this->F(2, 2) - 1;
67  sTrain[3] = this->F(0, 1) + this->F(1, 0);
68  sTrain[4] = this->F(1, 2) + this->F(2, 1);
69  sTrain[5] = this->F(0, 2) + this->F(2, 0);
70 
71  sTress.clear();
72  for (int ii = 0; ii != 6; ++ii)
73  for (int jj = 0; jj != 6; ++jj)
74  sTress(ii) += D(ii, jj) * sTrain(jj);
75 
76  this->P(0, 0) = sTress[0];
77  this->P(1, 1) = sTress[1];
78  this->P(2, 2) = sTress[2];
79  this->P(0, 1) = this->P(1, 0) = sTress[3];
80  this->P(1, 2) = this->P(2, 1) = sTress[4];
81  this->P(0, 2) = this->P(2, 0) = sTress[5];
82 
83  } else {
84 
85  sTrain0.resize(6, 0);
86 
87  sTress.clear();
88  for (int ii = 0; ii != 6; ++ii)
89  for (int jj = 0; jj != 6; ++jj)
90  sTress(ii) += D(ii, jj) * sTrain(jj);
91 
92  // noalias(sTress) = prod(D, sTrain0);
93  this->sigmaCauchy(0, 0) = sTress[0];
94  this->sigmaCauchy(1, 1) = sTress[1];
95  this->sigmaCauchy(2, 2) = sTress[2];
96  this->sigmaCauchy(0, 1) = this->sigmaCauchy(1, 0) = sTress[3];
97  this->sigmaCauchy(1, 2) = this->sigmaCauchy(2, 1) = sTress[4];
98  this->sigmaCauchy(0, 2) = this->sigmaCauchy(2, 0) = sTress[5];
99 
100  auto J = determinantTensor3by3(this->F);
101  CHKERR invertTensor3by3(this->F, J, this->invF);
102 
103  this->t_P(i, j) = this->t_sigmaCauchy(i, k) * this->t_invF(j, k);
104  this->t_P(i, j) *= J;
105  }
106 
108  }

Member Data Documentation

◆ D

template<typename TYPE >
MatrixDouble MyMat_double< TYPE >::D

Definition at line 28 of file stability.cpp.

◆ D_lambda

template<typename TYPE >
MatrixDouble MyMat_double< TYPE >::D_lambda

Definition at line 26 of file stability.cpp.

◆ D_mu

template<typename TYPE >
MatrixDouble MyMat_double< TYPE >::D_mu

Definition at line 28 of file stability.cpp.

◆ doAotherwiseB

template<typename TYPE >
bool MyMat_double< TYPE >::doAotherwiseB

Definition at line 25 of file stability.cpp.

◆ i

template<typename TYPE >
FTensor::Index<'i', 3> MyMat_double< TYPE >::i

Definition at line 31 of file stability.cpp.

◆ j

template<typename TYPE >
FTensor::Index<'j', 3> MyMat_double< TYPE >::j

Definition at line 32 of file stability.cpp.

◆ k

template<typename TYPE >
FTensor::Index<'k', 3> MyMat_double< TYPE >::k

Definition at line 33 of file stability.cpp.

◆ sTrain

template<typename TYPE >
VectorBoundedArray<TYPE, 6> MyMat_double< TYPE >::sTrain

Definition at line 29 of file stability.cpp.

◆ sTrain0

template<typename TYPE >
VectorBoundedArray<TYPE, 6> MyMat_double< TYPE >::sTrain0

Definition at line 29 of file stability.cpp.

◆ sTress

template<typename TYPE >
VectorBoundedArray<TYPE, 6> MyMat_double< TYPE >::sTress

Definition at line 29 of file stability.cpp.


The documentation for this struct was generated from the following file:
MyMat_double::D_mu
MatrixDouble D_mu
Definition: stability.cpp:28
NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI::t_P
FTensor::Tensor2< FTensor::PackPtr< TYPE *, 0 >, 3, 3 > t_P
Definition: NonLinearElasticElement.hpp:150
MyMat_double::i
FTensor::Index< 'i', 3 > i
Definition: stability.cpp:31
LAMBDA
#define LAMBDA(E, NU)
Definition: fem_tools.h:22
NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI::t_sigmaCauchy
FTensor::Tensor2< FTensor::PackPtr< TYPE *, 0 >, 3, 3 > t_sigmaCauchy
Definition: NonLinearElasticElement.hpp:150
MoFEM::invertTensor3by3
MoFEMErrorCode invertTensor3by3(ublas::matrix< T, L, A > &jac_data, ublas::vector< T, A > &det_data, ublas::matrix< T, L, A > &inv_jac_data)
Calculate inverse of tensor rank 2 at integration points.
Definition: Templates.hpp:1559
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:535
MyMat_double::doAotherwiseB
bool doAotherwiseB
Definition: stability.cpp:25
NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI::F
MatrixBoundedArray< TYPE, 9 > F
Definition: NonLinearElasticElement.hpp:147
NonlinearElasticElement::BlockData::E
double E
Definition: HookeElement.hpp:34
MyMat_double::k
FTensor::Index< 'k', 3 > k
Definition: stability.cpp:33
MyMat_double::sTrain0
VectorBoundedArray< TYPE, 6 > sTrain0
Definition: stability.cpp:29
MyMat_double::D
MatrixDouble D
Definition: stability.cpp:28
NonlinearElasticElement::BlockData::PoissonRatio
double PoissonRatio
Definition: HookeElement.hpp:35
NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI::J
TYPE J
Definition: NonLinearElasticElement.hpp:152
MyMat_double::D_lambda
MatrixDouble D_lambda
Definition: stability.cpp:26
MoFEM::determinantTensor3by3
static auto determinantTensor3by3(T &t)
Calculate the determinant of a 3x3 matrix or a tensor of rank 2.
Definition: Templates.hpp:1511
NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI::mu
double mu
Definition: NonLinearElasticElement.hpp:146
MyMat_double::sTress
VectorBoundedArray< TYPE, 6 > sTress
Definition: stability.cpp:29
MyMat_double::sTrain
VectorBoundedArray< TYPE, 6 > sTrain
Definition: stability.cpp:29
NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI::sigmaCauchy
MatrixBoundedArray< TYPE, 9 > sigmaCauchy
Definition: NonLinearElasticElement.hpp:148
NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI::lambda
double lambda
Definition: NonLinearElasticElement.hpp:146
MyMat_double::j
FTensor::Index< 'j', 3 > j
Definition: stability.cpp:32
NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI::invF
MatrixBoundedArray< TYPE, 9 > invF
Definition: NonLinearElasticElement.hpp:147
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI::P
MatrixBoundedArray< TYPE, 9 > P
Definition: NonLinearElasticElement.hpp:147
NonlinearElasticElement::FunctionsToCalculatePiolaKirchhoffI::t_invF
FTensor::Tensor2< FTensor::PackPtr< TYPE *, 0 >, 3, 3 > t_invF
Definition: NonLinearElasticElement.hpp:150
MU
#define MU(E, NU)
Definition: fem_tools.h:23