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 474 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 475 of file HenckyOps.hpp.

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

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 488 of file HenckyOps.hpp.

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

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 569 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 570 of file HenckyOps.hpp.


The documentation for this struct was generated from the following file:
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
HenckyOps::OpHenckyTangentImpl< DIM, GAUSS, DomainEleOp, S >::matDPtr
boost::shared_ptr< MatrixDouble > matDPtr
Definition: HenckyOps.hpp:570
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
HenckyOps::OpHenckyTangentImpl< DIM, GAUSS, DomainEleOp, S >::commonDataPtr
boost::shared_ptr< CommonData > commonDataPtr
Definition: HenckyOps.hpp:569
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