v0.15.4
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
EshelbianPlasticity::OpCohesiveLhs_dPdP Struct Reference
Inheritance diagram for EshelbianPlasticity::OpCohesiveLhs_dPdP:
[legend]
Collaboration diagram for EshelbianPlasticity::OpCohesiveLhs_dPdP:
[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 465 of file EshelbianCohesive.cpp.

Member Typedef Documentation

◆ OP

Definition at line 467 of file EshelbianCohesive.cpp.

Member Function Documentation

◆ aSsemble()

MoFEMErrorCode EshelbianPlasticity::OpCohesiveLhs_dPdP::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 549 of file EshelbianCohesive.cpp.

549 {
551
552 if (!this->timeScalingFun.empty())
553 this->locMat *= this->timeScalingFun(this->getFEMethod()->ts_t);
554 if (!this->feScalingFun.empty())
555 this->locMat *= this->feScalingFun(this->getFEMethod());
556 // assemble local matrix
557 CHKERR this->matSetValuesHook(this, data, data, this->locMat);
558
560 }
#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()
#define CHKERR
Inline error check.
TimeFun timeScalingFun
assumes that time variable is set
static MatSetValuesHook matSetValuesHook
MatrixDouble locMat
local entity block matrix
FEFun feScalingFun
set by fe entity handle

◆ iNtegrate()

MoFEMErrorCode EshelbianPlasticity::OpCohesiveLhs_dPdP::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 470 of file EshelbianCohesive.cpp.

470 {
472
473 auto get_sense_index = [this]() { return (faceSense == 1) ? 0 : 1; };
474
475 auto nb_dofs = data.getIndices().size();
476 FTENSOR_INDEX(3, i);
477 FTENSOR_INDEX(3, j);
478 FTENSOR_INDEX(3, J);
479
480 int nb_integration_pts = OP::getGaussPts().size2();
481
482 auto t_P = getFTensor2FromMat<3, 3>(*(OP::fluxMatPtr));
483 auto t_kappa = getFTensor0FromVec<0>(*kappaPtr);
484 auto t_delta_kappa = getFTensor0FromVec<0>(*kappaDeltaPtr);
485 auto t_face_normal = getFTensor1NormalsAtGaussPts();
486
487 int nb_base_functions = data.getN().size2() / 3;
488 auto t_row_base_fun = data.getFTensor1N<3>();
489 auto t_w = OP::getFTensor0IntegrationWeight();
490
491 auto next = [&]() {
492 ++t_P;
493 ++t_kappa;
494 ++t_delta_kappa;
495 ++t_face_normal;
496 ++t_w;
497 };
498
499 for (auto gg = 0; gg != nb_integration_pts; ++gg) {
501 t_normal(J) = t_face_normal(J) * (faceSense / 2.);
502 FTensor::Tensor1<double, 3> t_normalized_normal;
503 t_normalized_normal(J) = t_normal(J);
504 t_normalized_normal.normalize();
506 t_traction(i) = t_P(i, J) * t_normalized_normal(J);
507
508 auto fracture = [this](auto &t_traction, auto &t_normalized_normal,
509 auto &t_kappa, auto &t_delta_kappa, auto gc) {
510 double kappa = static_cast<double>(t_kappa + t_delta_kappa);
514 t_traction, t_normalized_normal, alpha, OpGetParameters::beta);
515 FTENSOR_INDEX(3, i);
516 FTENSOR_INDEX(3, j);
517 FTensor::Tensor2<double, 3, 3> t_dgap_double;
518 t_dgap_double(i, j) = -t_dgap(i, j);
519 return t_dgap_double;
520 };
521
522 auto assemble = [&](const FTensor::Tensor2<double, 3, 3> &&t_dgap) {
523 int rr = 0;
524 for (; rr != nb_dofs / SPACE_DIM; ++rr) {
525 auto t_mat = getFTensor2FromArray<3, 3, 3>(OP::locMat, 3 * rr);
526 double row_base = t_w * (t_row_base_fun(J) * t_normal(J));
527 auto t_col_base_fun = data.getFTensor1N<3>(gg, 0);
528 for (int cc = 0; cc != nb_dofs / SPACE_DIM; ++cc) {
529 double col_base = t_col_base_fun(J) * t_normalized_normal(J);
530 t_mat(i, j) += (row_base * col_base) * t_dgap(i, j);
531 ++t_mat;
532 ++t_col_base_fun;
533 }
534 ++t_row_base_fun;
535 }
536 for (; rr != nb_base_functions; ++rr)
537 ++t_row_base_fun;
538 };
539
540 assemble(fracture(t_traction, t_normalized_normal, t_kappa, t_delta_kappa,
541 *gcPtr));
542
543 next();
544 }
545
547 };
#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
FTensor::Index< 'j', 3 > j
static T getAlpha(const T &kappa, double gc, double min_stiffness)
static auto calculateDiffGapDTraction(const FTensor::Tensor1< T, 3 > &t_traction, FTensor::Tensor1< double, 3 > &t_n_normalize, double alpha, 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: