v0.15.0
Loading...
Searching...
No Matches
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 541 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 542 of file HenckyOps.hpp.

545 : DomainEleOp(field_name, DomainEleOp::OPROW),
546 commonDataPtr(common_data) {
547 std::fill(&DomainEleOp::doEntities[MBEDGE],
548 &DomainEleOp::doEntities[MBMAXTYPE], false);
549 if (mat_D_ptr)
550 matDPtr = mat_D_ptr;
551 else
552 matDPtr = commonDataPtr->matDPtr;
553 }
DomainEle::UserDataOperator DomainEleOp
Finire element operator type.
constexpr auto field_name

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

555 {
557
558 FTensor::Index<'i', DIM> i;
559 FTensor::Index<'j', DIM> j;
560 FTensor::Index<'k', DIM> k;
561 FTensor::Index<'l', DIM> l;
562 FTensor::Index<'m', DIM> m;
563 FTensor::Index<'n', DIM> n;
564 FTensor::Index<'o', DIM> o;
565 FTensor::Index<'p', DIM> p;
566
567 constexpr auto t_kd = FTensor::Kronecker_Delta<int>();
568 // const size_t nb_gauss_pts = matGradPtr->size2();
569 const size_t nb_gauss_pts = DomainEleOp::getGaussPts().size2();
570 commonDataPtr->matTangent.resize(DIM * DIM * DIM * DIM, nb_gauss_pts);
571 auto dP_dF =
572 getFTensor4FromMat<DIM, DIM, DIM, DIM, 1>(commonDataPtr->matTangent);
573
574 auto t_D = getFTensor4DdgFromMat<DIM, DIM, S>(*matDPtr);
575 auto t_eig_val = getFTensor1FromMat<DIM>(commonDataPtr->matEigVal);
576 auto t_eig_vec = getFTensor2FromMat<DIM, DIM>(commonDataPtr->matEigVec);
577 auto t_T = getFTensor2SymmetricFromMat<DIM>(commonDataPtr->matHenckyStress);
578 auto t_S =
579 getFTensor2SymmetricFromMat<DIM>(commonDataPtr->matSecondPiolaStress);
580 auto t_grad = getFTensor2FromMat<DIM, DIM>(*(commonDataPtr->matGradPtr));
581 auto t_logC_dC = getFTensor4DdgFromMat<DIM, DIM>(commonDataPtr->matLogCdC);
582
583 for (size_t gg = 0; gg != nb_gauss_pts; ++gg) {
584
585#ifdef HENCKY_SMALL_STRAIN
586 dP_dF(i, j, k, l) = t_D(i, j, k, l);
587#else
588
590 t_F(i, j) = t_grad(i, j) + t_kd(i, j);
591
592 // rare case when two eigen values are equal
593 auto nb_uniq = get_uniq_nb<DIM>(&t_eig_val(0));
595 dC_dF(i, j, k, l) = (t_kd(i, l) * t_F(k, j)) + (t_kd(j, l) * t_F(k, i));
596
597 auto TL = EigenMatrix::getDiffDiffMat(t_eig_val, t_eig_vec, f, d_f, dd_f,
598 t_T, nb_uniq);
599 TL(i, j, k, l) *= 4;
600 FTensor::Ddg<double, DIM, DIM> P_D_P_plus_TL;
601 P_D_P_plus_TL(i, j, k, l) =
602 TL(i, j, k, l) +
603 (t_logC_dC(i, j, o, p) * t_D(o, p, m, n)) * t_logC_dC(m, n, k, l);
604 P_D_P_plus_TL(i, j, k, l) *= 0.5;
605 dP_dF(i, j, m, n) = t_kd(i, m) * (t_kd(k, n) * t_S(k, j));
606 dP_dF(i, j, m, n) +=
607 t_F(i, k) * (P_D_P_plus_TL(k, j, o, p) * dC_dF(o, p, m, n));
608
609#endif
610
611 ++dP_dF;
612
613 ++t_grad;
614 ++t_eig_val;
615 ++t_eig_vec;
616 ++t_logC_dC;
617 ++t_S;
618 ++t_T;
619 ++t_D;
620 }
621
623 }
Kronecker Delta class.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
constexpr auto t_kd
FTensor::Index< 'i', SPACE_DIM > i
const double n
refractive index of diffusive medium
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
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.
auto get_uniq_nb(double *ptr)
Definition HenckyOps.hpp:32
FTensor::Index< 'm', 3 > m

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


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