v0.10.0
Public Member Functions | Private Attributes | List of all members
OpElasticTools::OpLogStrain Struct Reference

#include <users_modules/multifield_plasticity/src/ElasticOperators.hpp>

Inheritance diagram for OpElasticTools::OpLogStrain:
[legend]
Collaboration diagram for OpElasticTools::OpLogStrain:
[legend]

Public Member Functions

 OpLogStrain (const std::string field_name, boost::shared_ptr< CommonData > common_data_ptr)
 
MoFEMErrorCode doWork (int side, EntityType type, EntData &data)
 [Calculate strain] More...
 

Private Attributes

boost::shared_ptr< CommonDatacommonDataPtr
 

Detailed Description

Definition at line 774 of file ElasticOperators.hpp.

Constructor & Destructor Documentation

◆ OpLogStrain()

OpElasticTools::OpLogStrain::OpLogStrain ( const std::string  field_name,
boost::shared_ptr< CommonData common_data_ptr 
)

Definition at line 77 of file ElasticOperators.cpp.

79  : DomainEleOp(field_name, DomainEleOp::OPROW),
80  commonDataPtr(common_data_ptr) {
81  // Operator is only executed for vertices
82  std::fill(&doEntities[MBEDGE], &doEntities[MBMAXTYPE], false);
83 }
boost::shared_ptr< CommonData > commonDataPtr
DomainEle::UserDataOperator DomainEleOp

Member Function Documentation

◆ doWork()

MoFEMErrorCode OpElasticTools::OpLogStrain::doWork ( int  side,
EntityType  type,
EntData data 
)

[Calculate strain]

Definition at line 86 of file ElasticOperators.cpp.

86  {
88  const size_t nb_gauss_pts = commonDataPtr->mGradPtr->size2();
89  commonDataPtr->mStrainPtr->resize(6, nb_gauss_pts);
90  commonDataPtr->mDeformationGradient->resize(9, nb_gauss_pts, false);
91  commonDataPtr->matC->resize(6, nb_gauss_pts, false);
92  commonDataPtr->matEigenVal->resize(3, nb_gauss_pts, false);
93  commonDataPtr->matEigenVector->resize(9, nb_gauss_pts, false);
94  commonDataPtr->detF->resize(nb_gauss_pts, false);
95 
96  auto t_grad = getFTensor2FromMat<3, 3>(*(commonDataPtr->mGradPtr));
97  auto F = getFTensor2FromMat<3, 3>(*(commonDataPtr->mDeformationGradient));
98  auto C = getFTensor2SymmetricFromMat<3>(*(commonDataPtr->matC));
99  auto t_eigen = getFTensor1FromMat<3>(*(commonDataPtr->matEigenVal));
100  auto t_eigen_vec = getFTensor2FromMat<3, 3>(*(commonDataPtr->matEigenVector));
101  auto t_detF = getFTensor0FromVec(*(commonDataPtr->detF));
102  auto t_strain = getFTensor2SymmetricFromMat<3>(*(commonDataPtr->mStrainPtr));
103 
104  for (size_t gg = 0; gg != nb_gauss_pts; ++gg) {
105  F(i, j) = t_grad(i, j) + kronecker_delta(i, j);
106 
107  double det;
109  t_detF = det;
110 
111  C(i, j) = F(k, i) ^ F(k, j);
112 
113  CHKERR get_eigen_val_and_proj_lapack(C, t_eigen, t_eigen_vec);
114  auto lnC = get_ln_X_lapack(C, t_eigen, t_eigen_vec);
115  t_strain(i, j) = 0.5 * lnC(i, j);
116 
117  ++t_eigen;
118  ++t_eigen_vec;
119  ++C;
120  ++t_detF;
121  ++F;
122  ++t_grad;
123  ++t_strain;
124  }
125 
127 }
auto get_ln_X_lapack(const Tensor2_symmetric< T1, 3 > &X, Tensor1< T2, 3 > &lambda, Tensor2< T3, 3, 3 > &eig_vec)
static FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
Definition: Templates.hpp:143
boost::shared_ptr< CommonData > commonDataPtr
MoFEMErrorCode determinantTensor3by3(T1 &t, T2 &det)
Calculate determinant 3 by 3.
Definition: Templates.hpp:571
FTensor::Index< 'j', 2 > j
Definition: ElasticOps.hpp:27
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
MoFEMErrorCode get_eigen_val_and_proj_lapack(const Tensor2_symmetric< T, 3 > &X, Tensor1< T, 3 > &lambda, Tensor2< T, 3, 3 > &eig_vec)
FTensor::Index< 'k', 2 > k
Definition: ElasticOps.hpp:28
FTensor::Index< 'i', 2 > i
[Common data]
Definition: ElasticOps.hpp:26
#define CHKERR
Inline error check.
Definition: definitions.h:604
Tensor2_Expr< Kronecker_Delta< T >, T, Dim0, Dim1, i, j > kronecker_delta(const Index< i, Dim0 > &, const Index< j, Dim1 > &)
Rank 2.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415

Member Data Documentation

◆ commonDataPtr

boost::shared_ptr<CommonData> OpElasticTools::OpLogStrain::commonDataPtr
private

Definition at line 780 of file ElasticOperators.hpp.


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