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

[Op Hencky Tangent impl] More...

#include "tutorials/vec-2_nonlinear_elasticity/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< CommonData > commonDataPtr
 
boost::shared_ptr< MatrixDouble > matDPtr
 

Detailed Description

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

[Op Hencky Tangent impl]

Definition at line 503 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 504 of file HenckyOps.hpp.

507 : DomainEleOp(field_name, DomainEleOp::OPROW),
508 commonDataPtr(common_data) {
509 std::fill(&DomainEleOp::doEntities[MBEDGE],
510 &DomainEleOp::doEntities[MBMAXTYPE], false);
511 if (mat_D_ptr)
512 matDPtr = mat_D_ptr;
513 else
514 matDPtr = commonDataPtr->matDPtr;
515 }
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 517 of file HenckyOps.hpp.

517 {
519
520 FTensor::Index<'i', DIM> i;
521 FTensor::Index<'j', DIM> j;
522 FTensor::Index<'k', DIM> k;
523 FTensor::Index<'l', DIM> l;
524 FTensor::Index<'m', DIM> m;
525 FTensor::Index<'n', DIM> n;
526 FTensor::Index<'o', DIM> o;
527 FTensor::Index<'p', DIM> p;
528
529 [[maybe_unused]] constexpr auto t_kd = FTensor::Kronecker_Delta<int>();
530 // const size_t nb_gauss_pts = matGradPtr->size2();
531 const size_t nb_gauss_pts = DomainEleOp::getGaussPts().size2();
532 commonDataPtr->matTangent.resize(nb_gauss_pts, DIM * DIM * DIM * DIM);
533 auto dP_dF =
534 getFTensor4FromMat<DIM, DIM, DIM, DIM>(commonDataPtr->matTangent);
535
536 auto t_D = getFTensor4DdgFromMat<DIM, DIM, S>(*matDPtr);
537 auto t_eig_val = getFTensor1FromMat<DIM>(commonDataPtr->matEigVal);
538 auto t_eig_vec = getFTensor2FromMat<DIM, DIM>(commonDataPtr->matEigVec);
539 auto t_T = getFTensor2SymmetricFromMat<DIM>(commonDataPtr->matHenckyStress);
540 auto t_S =
541 getFTensor2SymmetricFromMat<DIM>(commonDataPtr->matSecondPiolaStress);
542 auto t_grad = getFTensor2FromMat<DIM, DIM>(*(commonDataPtr->matGradPtr));
543 auto t_logC_dC = getFTensor4DdgFromMat<DIM, DIM>(commonDataPtr->matLogCdC);
544
545 for (size_t gg = 0; gg != nb_gauss_pts; ++gg) {
546
547#ifdef HENCKY_SMALL_STRAIN
548 dP_dF(i, j, k, l) = t_D(i, j, k, l);
549#else
550
552 t_F(i, j) = t_grad(i, j) + t_kd(i, j);
553
554 // rare case when two eigen values are equal
555 auto nb_uniq = getUniqNb<DIM>(getVectorAdaptor(&t_eig_val(0), DIM),
558 dC_dF(i, j, k, l) = (t_kd(i, l) * t_F(k, j)) + (t_kd(j, l) * t_F(k, i));
559
560 auto TL = EigenMatrix::getDiffDiffMat(t_eig_val, t_eig_vec, f, d_f, dd_f,
561 t_T, nb_uniq);
562 TL(i, j, k, l) *= 4;
563 FTensor::Ddg<double, DIM, DIM> P_D_P_plus_TL;
564 P_D_P_plus_TL(i, j, k, l) =
565 TL(i, j, k, l) +
566 (t_logC_dC(i, j, o, p) * t_D(o, p, m, n)) * t_logC_dC(m, n, k, l);
567 P_D_P_plus_TL(i, j, k, l) *= 0.5;
568 dP_dF(i, j, m, n) = t_kd(i, m) * (t_kd(k, n) * t_S(k, j));
569 dP_dF(i, j, m, n) +=
570 t_F(i, k) * (P_D_P_plus_TL(k, j, o, p) * dC_dF(o, p, m, n));
571
572#endif
573
574 ++dP_dF;
575
576 ++t_grad;
577 ++t_eig_val;
578 ++t_eig_vec;
579 ++t_logC_dC;
580 ++t_S;
581 ++t_T;
582 ++t_D;
583 }
584
586 }
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 getVectorAdaptor(T1 ptr, const size_t n)
Get Vector adaptor.
Definition Templates.hpp:49
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 589 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 590 of file HenckyOps.hpp.


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