v0.15.4
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
EshelbianPlasticity::OpCohesive_dJ_dP Struct Reference
Inheritance diagram for EshelbianPlasticity::OpCohesive_dJ_dP:
[legend]
Collaboration diagram for EshelbianPlasticity::OpCohesive_dJ_dP:
[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 Types inherited from MoFEM::OpBrokenBaseImpl< OpBase >
using OP = OpBase
 
- Public Types inherited from MoFEM::OpBaseImpl< A, EleOp >
using OpType = typename EleOp::OpType
 
using EntData = EntitiesFieldData::EntData
 
using MatSetValuesHook = boost::function< MoFEMErrorCode(ForcesAndSourcesCore::UserDataOperator *op_ptr, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, MatrixDouble &m)>
 

Public Member Functions

MoFEMErrorCode iNtegrate (EntData &data)
 Class dedicated to integrate operator.
 
MoFEMErrorCode aSsemble (EntData &data)
 Assemble local vector into global vector.
 
 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)
 Class dedicated to integrate operator.
 
- 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)
 
- Public Member Functions inherited from MoFEM::OpBrokenBaseImpl< OpBase >
 OpBrokenBaseImpl (boost::shared_ptr< std::vector< BrokenBaseSideData > > broken_base_side_data, boost::shared_ptr< Range > ents_ptr=nullptr)
 
 OpBrokenBaseImpl (const std::string row_field, boost::shared_ptr< std::vector< BrokenBaseSideData > > broken_base_side_data, const bool assmb_transpose, const bool only_transpose, boost::shared_ptr< Range > ents_ptr=nullptr)
 
MoFEMErrorCode doWork (int row_side, EntityType row_type, EntitiesFieldData::EntData &row_data)
 
- Public Member Functions inherited from MoFEM::OpBaseImpl< A, EleOp >
 OpBaseImpl (const std::string row_field_name, const std::string col_field_name, const OpType type, boost::shared_ptr< Range > ents_ptr=nullptr)
 Constructor for base operator implementation.
 
MoFEMErrorCode doWork (int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
 Do calculations for the left hand side.
 
MoFEMErrorCode doWork (int row_side, EntityType row_type, EntData &row_data)
 Do calculations for the right hand side.
 

Additional Inherited Members

- Public Attributes inherited from MoFEM::OpBaseImpl< A, EleOp >
TimeFun timeScalingFun
 assumes that time variable is set
 
FEFun feScalingFun
 set by fe entity handle
 
boost::shared_ptr< RangeentsPtr
 Entities on which element is run.
 
- Static Public Attributes inherited from MoFEM::OpBaseImpl< A, EleOp >
static MatSetValuesHook matSetValuesHook
 
- Protected Member Functions inherited from MoFEM::OpBaseImpl< A, EleOp >
template<int DIM>
FTensor::Tensor1< FTensor::PackPtr< double *, DIM >, DIM > getNf ()
 Get local vector tensor for assembly.
 
template<int DIM>
FTensor::Tensor2< FTensor::PackPtr< double *, DIM >, DIM, DIM > getLocMat (const int rr)
 Get local matrix tensor for assembly.
 
virtual MoFEMErrorCode iNtegrate (EntData &row_data, EntData &col_data)
 Integrate grad-grad operator.
 
virtual MoFEMErrorCode aSsemble (EntData &row_data, EntData &col_data, const bool trans)
 Assemble local matrix into global matrix.
 
virtual size_t getNbOfBaseFunctions (EntitiesFieldData::EntData &data)
 Get number of base functions.
 
- 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
 
- Protected Attributes inherited from MoFEM::OpBrokenBaseImpl< OpBase >
boost::shared_ptr< std::vector< BrokenBaseSideData > > brokenBaseSideData
 
- Protected Attributes inherited from MoFEM::OpBaseImpl< A, EleOp >
int nbRows
 number of dofs on rows
 
int nbCols
 number if dof on column
 
int nbIntegrationPts
 number of integration points
 
int nbRowBaseFunctions
 number or row base functions
 
int rowSide
 row side number
 
int colSide
 column side number
 
EntityType rowType
 row type
 
EntityType colType
 column type
 
bool assembleTranspose
 
bool onlyTranspose
 
MatrixDouble locMat
 local entity block matrix
 
MatrixDouble locMatTranspose
 local entity block matrix
 
VectorDouble locF
 local entity vector
 

Detailed Description

Definition at line 674 of file EshelbianCohesive.cpp.

Member Typedef Documentation

◆ OP

Definition at line 676 of file EshelbianCohesive.cpp.

Member Function Documentation

◆ aSsemble()

MoFEMErrorCode EshelbianPlasticity::OpCohesive_dJ_dP::aSsemble ( EntData data)
inlinevirtual

Assemble local vector into global vector.

Parameters
dataEntity data
Returns
Error code

Reimplemented from MoFEM::OpBaseImpl< A, EleOp >.

Definition at line 755 of file EshelbianCohesive.cpp.

755 {
757 return VecSetValues<AssemblyTypeSelector<A>>(vec_dJdu, data, OP::locF,
758 ADD_VALUES);
760 }
#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()
VectorDouble locF
local entity vector

◆ iNtegrate()

MoFEMErrorCode EshelbianPlasticity::OpCohesive_dJ_dP::iNtegrate ( EntData data)
inlinevirtual

Class dedicated to integrate operator.

Parameters
dataentity data on element row
Returns
error code

Reimplemented from MoFEM::OpBaseImpl< A, EleOp >.

Definition at line 679 of file EshelbianCohesive.cpp.

679 {
681
682 auto get_sense_index = [this]() { return (faceSense == 1) ? 0 : 1; };
683
684 FTENSOR_INDEX(3, i);
685 FTENSOR_INDEX(3, J);
686
687 int nb_integration_pts = OP::getGaussPts().size2();
688 auto nb_dofs = data.getIndices().size();
689
690 int nb_base_functions = data.getN().size2() / 3;
691 auto t_row_base_fun = data.getFTensor1N<3>();
692 auto t_w = OP::getFTensor0IntegrationWeight();
693
694 auto t_P = getFTensor2FromMat<3, 3>(*(OP::fluxMatPtr));
695 auto t_kappa = getFTensor0FromVec<0>(*kappaPtr);
696 auto t_delta_kappa = getFTensor0FromVec<0>(*kappaDeltaPtr);
697 auto t_face_normal = getFTensor1NormalsAtGaussPts();
698
699 auto next = [&]() {
700 ++t_P;
701 ++t_face_normal;
702 ++t_kappa;
703 ++t_delta_kappa;
704 ++t_w;
705 };
706
707 for (auto gg = 0; gg != nb_integration_pts; ++gg) {
709 t_normal(J) = t_face_normal(J) * (faceSense / 2.);
710 FTensor::Tensor1<double, 3> t_normalized_normal;
711 t_normalized_normal(J) = t_normal(J);
712 t_normalized_normal.normalize();
714 t_traction(i) = t_P(i, J) * t_normalized_normal(J);
715
716 auto dJ_dtraction = [](auto &t_traction, auto &t_normalized_normal,
717 auto &t_delta_kappa, auto &t_kappa, auto gc) {
718 double kappa = static_cast<double>(t_kappa);
719 double delta_kappa = static_cast<double>(t_delta_kappa);
720 FTENSOR_INDEX(3, i);
721 FTensor::Tensor1<double, 3> t_traction_double;
722 t_traction_double(i) = t_traction(i);
723 auto t_dM =
725 t_traction_double, delta_kappa, kappa, t_normalized_normal, gc,
727 FTensor::Tensor1<double, 3> t_dJ_double;
728 t_dJ_double(i) = t_dM(i);
729 return t_dJ_double;
730 };
731
732 auto assemble = [&](const FTensor::Tensor1<double, 3> &&t_dJ) {
733
734 auto t_nf = getFTensor1FromPtr<3>(&*OP::locF.begin());
735 int bb = 0;
736 for (; bb != nb_dofs / SPACE_DIM; ++bb) {
737 double row_base = t_w * (t_row_base_fun(J) * t_normal(J));
738 t_nf(i) += row_base * t_dJ(i);
739 ++t_nf;
740 ++t_row_base_fun;
741 }
742 for (; bb != nb_base_functions; ++bb)
743 ++t_row_base_fun;
744 };
745
746 assemble(dJ_dtraction(t_traction, t_normalized_normal, t_delta_kappa,
747 t_kappa, *gcPtr));
748
749 next();
750 }
751
753 };
#define FTENSOR_INDEX(DIM, I)
constexpr int SPACE_DIM
Tensor1< T, Tensor_Dim > normalize()
double kappa
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'J', DIM1 > J
Definition level_set.cpp:30
static auto calculateDissipationSurplusDiffTraction(const FTensor::Tensor1< T, 3 > &t_traction, const T &delta_kappa, const T &kappa, FTensor::Tensor1< double, 3 > &t_n_normalize, double gc, double beta)
boost::shared_ptr< MatrixDouble > fluxMatPtr
boost::shared_ptr< double > gcPtr
boost::shared_ptr< VectorDouble > kappaDeltaPtr
boost::shared_ptr< VectorDouble > kappaPtr
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > getFTensor1N(FieldApproximationBase base)
Get base functions for Hdiv/Hcurl spaces.
const VectorInt & getIndices() const
Get global indices of degrees of freedom on entity.

◆ 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 366 of file EshelbianCohesive.cpp.

375 : OpBrokenBaseCohesive(broken_base_side_data, ents_ptr), gcPtr(gc_ptr),
376 kappaPtr(kappa_ptr), kappaDeltaPtr(kappa_delta_ptr),
377 lambdaPtr(lambda_ptr), dissipationTag(dissipation_tags),
378 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)
boost::shared_ptr< std::array< MatrixDouble, 2 > > lambdaPtr

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