v0.14.0
Public Member Functions | Private Attributes | List of all members
HenckyOps::OpHenckyTangentImpl< DIM, GAUSS, DomainEleOp > Struct Template Reference

#include <users_modules/tutorials/vec-2/src/HenckyOps.hpp>

Inheritance diagram for HenckyOps::OpHenckyTangentImpl< DIM, GAUSS, DomainEleOp >:
[legend]
Collaboration diagram for HenckyOps::OpHenckyTangentImpl< DIM, GAUSS, DomainEleOp >:
[legend]

Public Member Functions

 OpHenckyTangentImpl (const std::string field_name, boost::shared_ptr< CommonData > common_data, boost::shared_ptr< MatrixDouble > mat_D_ptr=nullptr)
 
MoFEMErrorCode doWork (int side, EntityType type, EntData &data)
 

Private Attributes

boost::shared_ptr< CommonDatacommonDataPtr
 
boost::shared_ptr< MatrixDouble > matDPtr
 

Detailed Description

template<int DIM, typename DomainEleOp>
struct HenckyOps::OpHenckyTangentImpl< DIM, GAUSS, DomainEleOp >

Definition at line 470 of file HenckyOps.hpp.

Constructor & Destructor Documentation

◆ OpHenckyTangentImpl()

template<int DIM, typename DomainEleOp >
HenckyOps::OpHenckyTangentImpl< DIM, GAUSS, DomainEleOp >::OpHenckyTangentImpl ( const std::string  field_name,
boost::shared_ptr< CommonData common_data,
boost::shared_ptr< MatrixDouble >  mat_D_ptr = nullptr 
)
inline

Definition at line 471 of file HenckyOps.hpp.

474  : DomainEleOp(field_name, DomainEleOp::OPROW),
475  commonDataPtr(common_data) {
476  std::fill(&DomainEleOp::doEntities[MBEDGE],
477  &DomainEleOp::doEntities[MBMAXTYPE], false);
478  if (mat_D_ptr)
479  matDPtr = mat_D_ptr;
480  else
481  matDPtr = commonDataPtr->matDPtr;
482  }

Member Function Documentation

◆ doWork()

template<int DIM, typename DomainEleOp >
MoFEMErrorCode HenckyOps::OpHenckyTangentImpl< DIM, GAUSS, DomainEleOp >::doWork ( int  side,
EntityType  type,
EntData data 
)
inline

Definition at line 484 of file HenckyOps.hpp.

484  {
486 
495 
496  constexpr auto t_kd = FTensor::Kronecker_Delta<int>();
497  // const size_t nb_gauss_pts = matGradPtr->size2();
498  const size_t nb_gauss_pts = DomainEleOp::getGaussPts().size2();
499  constexpr auto size_symm = (DIM * (DIM + 1)) / 2;
500  commonDataPtr->matTangent.resize(DIM * DIM * DIM * DIM, nb_gauss_pts);
501  auto dP_dF =
502  getFTensor4FromMat<DIM, DIM, DIM, DIM, 1>(commonDataPtr->matTangent);
503 
504  auto t_D = getFTensor4DdgFromMat<DIM, DIM, 0>(*matDPtr);
505  auto t_eig_val = getFTensor1FromMat<DIM>(commonDataPtr->matEigVal);
506  auto t_eig_vec = getFTensor2FromMat<DIM, DIM>(commonDataPtr->matEigVec);
507  auto t_T = getFTensor2SymmetricFromMat<DIM>(commonDataPtr->matHenckyStress);
508  auto t_S =
509  getFTensor2SymmetricFromMat<DIM>(commonDataPtr->matSecondPiolaStress);
510  auto t_grad = getFTensor2FromMat<DIM, DIM>(*(commonDataPtr->matGradPtr));
511  auto t_logC_dC = getFTensor4DdgFromMat<DIM, DIM>(commonDataPtr->matLogCdC);
512 
513  for (size_t gg = 0; gg != nb_gauss_pts; ++gg) {
514 
515 #ifdef HENCKY_SMALL_STRAIN
516  dP_dF(i, j, k, l) = t_D(i, j, k, l);
517 #else
518 
520  t_F(i, j) = t_grad(i, j) + t_kd(i, j);
521 
525  eig(i) = t_eig_val(i);
526  eigen_vec(i, j) = t_eig_vec(i, j);
527  T(i, j) = t_T(i, j);
528 
529  // rare case when two eigen values are equal
530  auto nb_uniq = get_uniq_nb<DIM>(&eig(0));
531 
533  dC_dF(i, j, k, l) = (t_kd(i, l) * t_F(k, j)) + (t_kd(j, l) * t_F(k, i));
534 
535  auto TL =
536  EigenMatrix::getDiffDiffMat(eig, eigen_vec, f, d_f, dd_f, T, nb_uniq);
537 
538  TL(i, j, k, l) *= 4;
539  FTensor::Ddg<double, DIM, DIM> P_D_P_plus_TL;
540  P_D_P_plus_TL(i, j, k, l) =
541  TL(i, j, k, l) +
542  (t_logC_dC(i, j, o, p) * t_D(o, p, m, n)) * t_logC_dC(m, n, k, l);
543  P_D_P_plus_TL(i, j, k, l) *= 0.5;
544  dP_dF(i, j, m, n) = t_kd(i, m) * (t_kd(k, n) * t_S(k, j));
545  dP_dF(i, j, m, n) +=
546  t_F(i, k) * (P_D_P_plus_TL(k, j, o, p) * dC_dF(o, p, m, n));
547 
548 #endif
549 
550  ++dP_dF;
551 
552  ++t_grad;
553  ++t_eig_val;
554  ++t_eig_vec;
555  ++t_logC_dC;
556  ++t_S;
557  ++t_T;
558  ++t_D;
559  }
560 
562  }

Member Data Documentation

◆ commonDataPtr

template<int DIM, typename DomainEleOp >
boost::shared_ptr<CommonData> HenckyOps::OpHenckyTangentImpl< DIM, GAUSS, DomainEleOp >::commonDataPtr
private

Definition at line 565 of file HenckyOps.hpp.

◆ matDPtr

template<int DIM, typename DomainEleOp >
boost::shared_ptr<MatrixDouble> HenckyOps::OpHenckyTangentImpl< DIM, GAUSS, DomainEleOp >::matDPtr
private

Definition at line 566 of file HenckyOps.hpp.


The documentation for this struct was generated from the following file:
HenckyOps::OpHenckyTangentImpl< DIM, GAUSS, DomainEleOp >::commonDataPtr
boost::shared_ptr< CommonData > commonDataPtr
Definition: HenckyOps.hpp:565
FTensor::Tensor1
Definition: Tensor1_value.hpp:8
HenckyOps::d_f
auto d_f
Definition: HenckyOps.hpp:16
FTensor::Kronecker_Delta
Kronecker Delta class.
Definition: Kronecker_Delta.hpp:15
FTensor::Tensor2_symmetric
Definition: Tensor2_symmetric_value.hpp:13
FTensor::Tensor2
Definition: Tensor2_value.hpp:16
DomainEleOp
DomainEle::UserDataOperator DomainEleOp
Finire element operator type.
Definition: child_and_parent.cpp:36
HenckyOps::dd_f
auto dd_f
Definition: HenckyOps.hpp:17
FTensor::Tensor4
Definition: Tensor4_value.hpp:18
size_symm
constexpr auto size_symm
Definition: plastic.cpp:42
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
t_kd
constexpr auto t_kd
Definition: free_surface.cpp:137
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
FTensor::Index< 'i', DIM >
convert.n
n
Definition: convert.py:82
HenckyOps::f
auto f
Definition: HenckyOps.hpp:15
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
FTensor::Ddg
Definition: Ddg_value.hpp:7
EigenMatrix::getDiffDiffMat
FTensor::Ddg< double, 3, 3 > getDiffDiffMat(Val< double, 3 > &t_val, Vec< double, 3 > &t_vec, Fun< double > f, Fun< double > d_f, Fun< double > dd_f, FTensor::Tensor2< double, 3, 3 > &t_S, const int nb)
Definition: MatrixFunction.cpp:78
m
FTensor::Index< 'm', 3 > m
Definition: shallow_wave.cpp:80
HenckyOps::OpHenckyTangentImpl< DIM, GAUSS, DomainEleOp >::matDPtr
boost::shared_ptr< MatrixDouble > matDPtr
Definition: HenckyOps.hpp:566
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20
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
l
FTensor::Index< 'l', 3 > l
Definition: matrix_function.cpp:21