v0.15.5
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
EshelbianPlasticity::OpCohesive_dJ_dkappa Struct Reference
Inheritance diagram for EshelbianPlasticity::OpCohesive_dJ_dkappa:
[legend]
Collaboration diagram for EshelbianPlasticity::OpCohesive_dJ_dkappa:
[legend]

Public Types

using OP = OpCohesiveRhs
 
- Public Types inherited from EshelbianPlasticity::OpCohesiveRhs
using OP = OpBrokenBaseCohesive
 
- Public Types inherited from EshelbianPlasticity::OpBrokenBaseCohesive
using OP = FormsIntegrators< FaceElementForcesAndSourcesCore::UserDataOperator >::Assembly< A >::OpBrokenBase
 

Public Member Functions

MoFEMErrorCode iNtegrate (EntData &data)
 
MoFEMErrorCode aSsemble (EntData &data)
 
 OpCohesiveRhs (boost::shared_ptr< std::vector< BrokenBaseSideData > > broken_base_side_data, boost::shared_ptr< double > gc_ptr, boost::shared_ptr< VectorDouble > kappa_ptr, boost::shared_ptr< VectorDouble > kappa_delta_ptr, boost::shared_ptr< std::array< MatrixDouble, 2 > > lambda_ptr=nullptr, Tag dissipation_tags=Tag(), Tag grad_dissipation_tags=Tag(), SmartPetscObj< Vec > vec_dJ_dx=SmartPetscObj< Vec >(), boost::shared_ptr< Range > ents_ptr=nullptr)
 
- Public Member Functions inherited from EshelbianPlasticity::OpCohesiveRhs
 OpCohesiveRhs (boost::shared_ptr< std::vector< BrokenBaseSideData > > broken_base_side_data, boost::shared_ptr< double > gc_ptr, boost::shared_ptr< VectorDouble > kappa_ptr, boost::shared_ptr< VectorDouble > kappa_delta_ptr, boost::shared_ptr< std::array< MatrixDouble, 2 > > lambda_ptr=nullptr, Tag dissipation_tags=Tag(), Tag grad_dissipation_tags=Tag(), SmartPetscObj< Vec > vec_dJ_dx=SmartPetscObj< Vec >(), boost::shared_ptr< Range > ents_ptr=nullptr)
 
MoFEMErrorCode iNtegrate (EntData &data)
 
- Public Member Functions inherited from EshelbianPlasticity::OpBrokenBaseCohesive
 OpBrokenBaseCohesive (boost::shared_ptr< std::vector< BrokenBaseSideData > > broken_flux_data_ptr, boost::shared_ptr< Range > ents_ptr=nullptr)
 
MoFEMErrorCode doWork (int row_side, EntityType row_type, EntitiesFieldData::EntData &row_data)
 

Additional Inherited Members

- Protected Attributes inherited from EshelbianPlasticity::OpCohesiveRhs
boost::shared_ptr< MatrixDouble > uGammaPtr
 
boost::shared_ptr< doublegcPtr
 
boost::shared_ptr< VectorDouble > kappaPtr
 
boost::shared_ptr< VectorDouble > kappaDeltaPtr
 
boost::shared_ptr< std::array< MatrixDouble, 2 > > lambdaPtr
 
boost::shared_ptr< doubletotalDissipation
 
boost::shared_ptr< doubletatalDissipationGrad
 
SmartPetscObj< Vec > vec_dJdu
 
Tag dissipationTag
 
Tag gradDissipationTag
 
- Protected Attributes inherited from EshelbianPlasticity::OpBrokenBaseCohesive
boost::shared_ptr< MatrixDouble > fluxMatPtr
 
int faceSense = 0
 

Detailed Description

Definition at line 590 of file EshelbianCohesive.cpp.

Member Typedef Documentation

◆ OP

Definition at line 592 of file EshelbianCohesive.cpp.

Member Function Documentation

◆ aSsemble()

MoFEMErrorCode EshelbianPlasticity::OpCohesive_dJ_dkappa::aSsemble ( EntData data)
inline

Definition at line 691 of file EshelbianCohesive.cpp.

691 {
694 }
#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()

◆ iNtegrate()

MoFEMErrorCode EshelbianPlasticity::OpCohesive_dJ_dkappa::iNtegrate ( EntData data)
inline

Definition at line 595 of file EshelbianCohesive.cpp.

595 {
597
598 auto get_sense_index = [this]() { return (faceSense == 1) ? 0 : 1; };
599
600 FTENSOR_INDEX(3, i);
601 FTENSOR_INDEX(3, J);
602 FTENSOR_INDEX(3, K);
603
604 int nb_integration_pts = OP::getGaussPts().size2();
605
606 auto t_P = getFTensor2FromMat<3, 3>(*(OP::fluxMatPtr));
607 auto t_lambda = getFTensor2FromMat<3, 3>(lambdaPtr->at(get_sense_index()));
608 auto t_kappa = getFTensor0FromVec<0>(*kappaPtr);
609 auto t_delta_kappa = getFTensor0FromVec<0>(*kappaDeltaPtr);
610 auto t_face_normal = getFTensor1NormalsAtGaussPts();
611 auto t_w = OP::getFTensor0IntegrationWeight();
612
613 auto next = [&]() {
614 ++t_P;
615 ++t_face_normal;
616 ++t_kappa;
617 ++t_delta_kappa;
618 ++t_lambda;
619 ++t_w;
620 };
621
622 double face_dissipation = 0.0;
623 double face_grad_dissipation = 0.0;
624 auto face_handle = OP::getFEEntityHandle();
625 CHKERR getMoab().tag_get_data(dissipationTag, &face_handle, 1,
626 &face_dissipation);
627 CHKERR getMoab().tag_get_data(gradDissipationTag, &face_handle, 1,
628 &face_grad_dissipation);
629
630 for (auto gg = 0; gg != nb_integration_pts; ++gg) {
632 t_normal(J) = t_face_normal(J) * (faceSense / 2.);
633 FTensor::Tensor1<double, 3> t_normalized_normal;
634 t_normalized_normal(J) = t_normal(J);
635 t_normalized_normal.normalize();
637 t_traction(i) = t_P(i, J) * t_normalized_normal(J);
638
639 auto dJ_dkappa = [](auto &t_delta_kappa, auto &t_traction,
640 auto &t_normalized_normal, auto &t_kappa, auto gc) {
641 double kappa = static_cast<double>(t_kappa);
642 double delta_kappa = static_cast<double>(t_delta_kappa);
644 t_traction, t_normalized_normal, OpGetParameters::beta);
646 delta_kappa, teff, kappa, gc, OpGetParameters::min_stiffness);
647 double m_grad =
649 delta_kappa, teff, kappa, gc, OpGetParameters::min_stiffness);
650 return boost::make_tuple(m, m_grad);
651 };
652
653 auto dr_kappa = [](auto &t_delta_kappa, auto &t_traction,
654 auto &t_normalized_normal, auto &t_kappa, auto gc) {
655 double kappa = static_cast<double>(t_kappa);
656 double delta_kappa = static_cast<double>(t_delta_kappa);
657 double kappa_plus_delta = kappa + delta_kappa;
658 double diff_alpha = GriffithCohesiveLaw::getDiffAlpha(
659 kappa_plus_delta, gc, OpGetParameters::min_stiffness);
660 auto [teff, t_gap] = GriffithCohesiveLaw::calculateGap(
661 t_traction, t_normalized_normal, diff_alpha, OpGetParameters::beta);
662 FTENSOR_INDEX(3, i);
663 FTensor::Tensor1<double, 3> t_gap_double;
664 t_gap_double(i) = -t_gap(i);
665 return t_gap_double;
666 };
667
668 auto [J, dJ] = dJ_dkappa(t_delta_kappa, t_traction, t_normalized_normal,
669 t_kappa, *gcPtr);
670 face_dissipation += t_w * J * t_normal.l2();
671 face_grad_dissipation += t_w * dJ * t_normal.l2();
672
673 auto t_dr = dr_kappa(t_delta_kappa, t_traction, t_normalized_normal,
674 t_kappa, *gcPtr);
676 t_l(i) = t_lambda(i, K) * t_normal(K);
677 face_grad_dissipation -= t_w * t_l(i) * t_dr(i);
678
679 next();
680 }
681
682 CHKERR getMoab().tag_set_data(dissipationTag, &face_handle, 1,
683 &face_dissipation);
684 CHKERR getMoab().tag_set_data(gradDissipationTag, &face_handle, 1,
685 &face_grad_dissipation);
686
687
689 };
#define FTENSOR_INDEX(DIM, I)
Tensor1< T, Tensor_Dim > normalize()
#define CHKERR
Inline error check.
double kappa
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'J', DIM1 > J
Definition level_set.cpp:30
FTensor::Index< 'm', 3 > m
static auto calculateDissipationSurplus(const T &delta_kappa, const T t_eff, const T &kappa, double gc, double min_stiffness)
static auto calculateGap(const FTensor::Tensor1< T, 3 > &t_traction, FTensor::Tensor1< double, 3 > &t_n_normalize, double alpha, double beta, bool sign_sensitive=true)
static auto calculateEffectiveTraction(const FTensor::Tensor1< T, 3 > &t_traction, FTensor::Tensor1< double, 3 > &t_n_normalize, double beta)
static T getDiffAlpha(const T &kappa, double gc, double min_stiffness)
static auto calculateDissipationSurplusDiffKappa(const T &delta_kappa, const T &t_eff, const T &kappa, double gc, double min_stiffness)
boost::shared_ptr< MatrixDouble > fluxMatPtr
boost::shared_ptr< double > gcPtr
boost::shared_ptr< VectorDouble > kappaDeltaPtr
boost::shared_ptr< VectorDouble > kappaPtr
boost::shared_ptr< std::array< MatrixDouble, 2 > > lambdaPtr

◆ OpCohesiveRhs()

EshelbianPlasticity::OpCohesiveRhs::OpCohesiveRhs ( boost::shared_ptr< std::vector< BrokenBaseSideData > >  broken_base_side_data,
boost::shared_ptr< double gc_ptr,
boost::shared_ptr< VectorDouble >  kappa_ptr,
boost::shared_ptr< VectorDouble >  kappa_delta_ptr,
boost::shared_ptr< std::array< MatrixDouble, 2 > >  lambda_ptr = nullptr,
Tag  dissipation_tags = Tag(),
Tag  grad_dissipation_tags = Tag(),
SmartPetscObj< Vec >  vec_dJ_dx = SmartPetscObj<Vec>(),
boost::shared_ptr< Range ents_ptr = nullptr 
)
inline

Definition at line 389 of file EshelbianCohesive.cpp.

398 : OpBrokenBaseCohesive(broken_base_side_data, ents_ptr), gcPtr(gc_ptr),
399 kappaPtr(kappa_ptr), kappaDeltaPtr(kappa_delta_ptr),
400 lambdaPtr(lambda_ptr), dissipationTag(dissipation_tags),
401 gradDissipationTag(grad_dissipation_tags), vec_dJdu(vec_dJ_dx) {}
OpBrokenBaseCohesive(boost::shared_ptr< std::vector< BrokenBaseSideData > > broken_flux_data_ptr, boost::shared_ptr< Range > ents_ptr=nullptr)

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