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

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

Inheritance diagram for HenckyOps::OpHenckyTangentImpl< DIM, GAUSS, DomainEleOp, S >:
[legend]
Collaboration diagram for HenckyOps::OpHenckyTangentImpl< DIM, GAUSS, DomainEleOp, S >:
[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, int S>
struct HenckyOps::OpHenckyTangentImpl< DIM, GAUSS, DomainEleOp, S >

Definition at line 452 of file HenckyOps.hpp.

Constructor & Destructor Documentation

◆ OpHenckyTangentImpl()

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

Definition at line 453 of file HenckyOps.hpp.

456  : DomainEleOp(field_name, DomainEleOp::OPROW),
457  commonDataPtr(common_data) {
458  std::fill(&DomainEleOp::doEntities[MBEDGE],
459  &DomainEleOp::doEntities[MBMAXTYPE], false);
460  if (mat_D_ptr)
461  matDPtr = mat_D_ptr;
462  else
463  matDPtr = commonDataPtr->matDPtr;
464  }

Member Function Documentation

◆ doWork()

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

Definition at line 466 of file HenckyOps.hpp.

466  {
468 
477 
478  constexpr auto t_kd = FTensor::Kronecker_Delta<int>();
479  // const size_t nb_gauss_pts = matGradPtr->size2();
480  const size_t nb_gauss_pts = DomainEleOp::getGaussPts().size2();
481  commonDataPtr->matTangent.resize(DIM * DIM * DIM * DIM, nb_gauss_pts);
482  auto dP_dF =
483  getFTensor4FromMat<DIM, DIM, DIM, DIM, 1>(commonDataPtr->matTangent);
484 
485  auto t_D = getFTensor4DdgFromMat<DIM, DIM, S>(*matDPtr);
486  auto t_eig_val = getFTensor1FromMat<DIM>(commonDataPtr->matEigVal);
487  auto t_eig_vec = getFTensor2FromMat<DIM, DIM>(commonDataPtr->matEigVec);
488  auto t_T = getFTensor2SymmetricFromMat<DIM>(commonDataPtr->matHenckyStress);
489  auto t_S =
490  getFTensor2SymmetricFromMat<DIM>(commonDataPtr->matSecondPiolaStress);
491  auto t_grad = getFTensor2FromMat<DIM, DIM>(*(commonDataPtr->matGradPtr));
492  auto t_logC_dC = getFTensor4DdgFromMat<DIM, DIM>(commonDataPtr->matLogCdC);
493 
494  for (size_t gg = 0; gg != nb_gauss_pts; ++gg) {
495 
496 #ifdef HENCKY_SMALL_STRAIN
497  dP_dF(i, j, k, l) = t_D(i, j, k, l);
498 #else
499 
501  t_F(i, j) = t_grad(i, j) + t_kd(i, j);
502 
503  // rare case when two eigen values are equal
504  auto nb_uniq = get_uniq_nb<DIM>(&t_eig_val(0));
506  dC_dF(i, j, k, l) = (t_kd(i, l) * t_F(k, j)) + (t_kd(j, l) * t_F(k, i));
507 
508  auto TL = EigenMatrix::getDiffDiffMat(t_eig_val, t_eig_vec, f, d_f, dd_f,
509  t_T, nb_uniq);
510  TL(i, j, k, l) *= 4;
511  FTensor::Ddg<double, DIM, DIM> P_D_P_plus_TL;
512  P_D_P_plus_TL(i, j, k, l) =
513  TL(i, j, k, l) +
514  (t_logC_dC(i, j, o, p) * t_D(o, p, m, n)) * t_logC_dC(m, n, k, l);
515  P_D_P_plus_TL(i, j, k, l) *= 0.5;
516  dP_dF(i, j, m, n) = t_kd(i, m) * (t_kd(k, n) * t_S(k, j));
517  dP_dF(i, j, m, n) +=
518  t_F(i, k) * (P_D_P_plus_TL(k, j, o, p) * dC_dF(o, p, m, n));
519 
520 #endif
521 
522  ++dP_dF;
523 
524  ++t_grad;
525  ++t_eig_val;
526  ++t_eig_vec;
527  ++t_logC_dC;
528  ++t_S;
529  ++t_T;
530  ++t_D;
531  }
532 
534  }

Member Data Documentation

◆ commonDataPtr

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

Definition at line 537 of file HenckyOps.hpp.

◆ matDPtr

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

Definition at line 538 of file HenckyOps.hpp.


The documentation for this struct was generated from the following file:
HenckyOps::d_f
auto d_f
Definition: HenckyOps.hpp:16
FTensor::Kronecker_Delta
Kronecker Delta class.
Definition: Kronecker_Delta.hpp:15
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
HenckyOps::OpHenckyTangentImpl< DIM, GAUSS, DomainEleOp, S >::matDPtr
boost::shared_ptr< MatrixDouble > matDPtr
Definition: HenckyOps.hpp:538
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
t_kd
constexpr auto t_kd
Definition: free_surface.cpp:139
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
HenckyOps::OpHenckyTangentImpl< DIM, GAUSS, DomainEleOp, S >::commonDataPtr
boost::shared_ptr< CommonData > commonDataPtr
Definition: HenckyOps.hpp:537
m
FTensor::Index< 'm', 3 > m
Definition: shallow_wave.cpp:80
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:429
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
l
FTensor::Index< 'l', 3 > l
Definition: matrix_function.cpp:21
EigenMatrix::getDiffDiffMat
auto getDiffDiffMat(A &&t_val, B &&t_vec, Fun< double > f, Fun< double > d_f, Fun< double > dd_f, C &&t_S, const int nb)
Get the Diff Diff Mat object.
Definition: MatrixFunction.hpp:279