v0.13.1
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
FractureMechanics::GriffithForceElement::OpCalculateRhoAtCrackFrontUsingPrecalulatedCoeffs Struct Reference

Calculate density at the crack fron nodes and multiplity gc. More...

#include <users_modules/fracture_mechanics/src/GriffithForceElement.hpp>

Inheritance diagram for FractureMechanics::GriffithForceElement::OpCalculateRhoAtCrackFrontUsingPrecalulatedCoeffs:
[legend]
Collaboration diagram for FractureMechanics::GriffithForceElement::OpCalculateRhoAtCrackFrontUsingPrecalulatedCoeffs:
[legend]

Public Member Functions

 OpCalculateRhoAtCrackFrontUsingPrecalulatedCoeffs (string rho_tag_name, const double beta_gc, boost::shared_ptr< MWLSApprox > mwls_approx, MoFEM::Interface &m_field, int tag, BlockData &block_data, CommonData &common_data)
 
MoFEMErrorCode doWork (int side, EntityType type, DataForcesAndSourcesCore::EntData &row_data)
 
- Public Member Functions inherited from FractureMechanics::GriffithForceElement::AuxOp
 AuxOp (int tag, BlockData &block_data, CommonData &common_data)
 
MoFEMErrorCode setIndices (DataForcesAndSourcesCore::EntData &data)
 
MoFEMErrorCode setVariables (FaceElementForcesAndSourcesCore::UserDataOperator *fe_ptr, DataForcesAndSourcesCore::EntData &data)
 
MoFEMErrorCode setLambdaNodes (FaceElementForcesAndSourcesCore::UserDataOperator *fe_ptr, const std::string &lambda_field_name)
 
MoFEMErrorCode setLambdaIndices (FaceElementForcesAndSourcesCore::UserDataOperator *fe_ptr, const std::string &lambda_field_name)
 

Public Attributes

const double betaGC
 
std::string rhoTagName
 
boost::shared_ptr< MWLSApproxmwlsApprox
 
MoFEM::InterfacemField
 
- Public Attributes inherited from FractureMechanics::GriffithForceElement::AuxOp
int tAg
 
BlockDatablockData
 
CommonDatacommonData
 
ublas::vector< int > rowIndices
 
ublas::vector< int > rowIndicesLocal
 
VectorInt3 rowLambdaIndices
 
VectorInt3 rowLambdaIndicesLocal
 
VectorDouble3 lambdaAtNodes
 
VectorDouble activeVariables
 

Detailed Description

Calculate density at the crack fron nodes and multiplity gc.

For heterogeneous case, gc is multiplied by a coefficient depending on spatial distribution of density as follows:

\[ g_c(\mathbf X) = g_c \cdot \rho(\mathbf X)^{\beta^{gc}} \]

Definition at line 432 of file GriffithForceElement.hpp.

Constructor & Destructor Documentation

◆ OpCalculateRhoAtCrackFrontUsingPrecalulatedCoeffs()

FractureMechanics::GriffithForceElement::OpCalculateRhoAtCrackFrontUsingPrecalulatedCoeffs::OpCalculateRhoAtCrackFrontUsingPrecalulatedCoeffs ( string  rho_tag_name,
const double  beta_gc,
boost::shared_ptr< MWLSApprox mwls_approx,
MoFEM::Interface m_field,
int  tag,
BlockData block_data,
CommonData common_data 
)
inline

Definition at line 440 of file GriffithForceElement.hpp.

444 : FaceElementForcesAndSourcesCore::UserDataOperator(
445 "MESH_NODE_POSITIONS", UserDataOperator::OPROW),
446 rhoTagName(rho_tag_name), betaGC(beta_gc), mwlsApprox(mwls_approx),
447 mField(m_field), AuxOp(tag, block_data, common_data) {}
AuxOp(int tag, BlockData &block_data, CommonData &common_data)

Member Function Documentation

◆ doWork()

MoFEMErrorCode FractureMechanics::GriffithForceElement::OpCalculateRhoAtCrackFrontUsingPrecalulatedCoeffs::doWork ( int  side,
EntityType  type,
DataForcesAndSourcesCore::EntData &  row_data 
)
inline

Definition at line 449 of file GriffithForceElement.hpp.

450 {
454
455 if (type != MBVERTEX)
457 const int row_nb_dofs = row_data.getIndices().size();
458 if (!row_nb_dofs)
460
461 CHKERR setIndices(row_data);
462 CHKERR setVariables(this, row_data);
463
464 auto &inv_AB_map = mwlsApprox->invABMap.at(getFEEntityHandle());
465 auto &influence_nodes_map =
466 mwlsApprox->influenceNodesMap.at(getFEEntityHandle());
467 auto &dm_nodes_map = mwlsApprox->dmNodesMap[this->getFEEntityHandle()];
468
469 auto get_ftensor_from_vec = [](auto &v) {
470 return FTensor::Tensor1<double *, 3>(&v(0), &v(1), &v(2), 3);
471 };
472
473 Tag th;
474 CHKERR mwlsApprox->mwlsMoab.tag_get_handle(rhoTagName.c_str(), th);
475
476 int nb_dofs = row_data.getFieldData().size();
477
478 commonData.diffRho.resize(3, nb_dofs / 3, false);
479 commonData.diffRho.clear();
480 auto t_coords = get_ftensor_from_vec(row_data.getFieldData());
481
482 commonData.densityRho.resize(nb_dofs / 3, false);
483 commonData.densityRho.clear();
484 auto rho = getFTensor0FromVec(commonData.densityRho);
485 VectorDouble gc_coeff(nb_dofs, false);
486 auto t_coeff = get_ftensor_from_vec(gc_coeff);
487 auto t_approx_base_point =
488 getFTensor1FromMat<3>(mwlsApprox->approxBasePoint);
489 const int nb_gauss_pts = row_data.getN().size1();
490
491 for (int gg = 0; gg != nb_gauss_pts; ++gg) {
492 for (int dd = 0; dd != nb_dofs / 3; ++dd) {
493
494 // go only through nodes at the crack front
495 if (rowIndices[dd * 3] != -1) {
497 t_pos(i) = t_coords(i);
498
499 for (int dd : {0, 1, 2})
500 mwlsApprox->approxPointCoords[dd] = t_approx_base_point(dd);
501
502 mwlsApprox->getInfluenceNodes() = influence_nodes_map[gg];
503 mwlsApprox->getInvAB() = inv_AB_map[gg];
504 mwlsApprox->getShortenDm() = dm_nodes_map[gg];
505
506 // approximate at MESH_NODE_POSITIONS
507 CHKERR mwlsApprox->evaluateApproxFun(&t_pos(0));
508 CHKERR mwlsApprox->evaluateFirstDiffApproxFun(&t_pos(0), false);
509 CHKERR mwlsApprox->getTagData(th);
510 rho = mwlsApprox->getDataApprox()[0];
511 const auto &diff_vals = mwlsApprox->getDiffDataApprox();
512 for (int ii = 0; ii != 3; ++ii) {
513 commonData.diffRho(ii, dd) = diff_vals(ii, 0);
514 }
515 t_coeff(i) = pow(rho, betaGC);
516 }
517
518 ++rho;
519 ++t_coords;
520 ++t_coeff;
521 }
522 }
523 // multiply griffith force with coefficients
525 element_prod(commonData.griffithForce, gc_coeff);
527 }
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
#define CHKERR
Inline error check.
Definition: definitions.h:535
FTensor::Index< 'i', SPACE_DIM > i
const double v
phase velocity of light in medium (cm/ns)
FTensor::Index< 'j', 3 > j
const Tensor2_symmetric_Expr< const ddTensor0< T, Dim, i, j >, typename promote< T, double >::V, Dim, i, j > dd(const Tensor0< T * > &a, const Index< i, Dim > index1, const Index< j, Dim > index2, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
Definition: ddTensor0.hpp:33
UBlasVector< double > VectorDouble
Definition: Types.hpp:68
double rho
Definition: plastic.cpp:98
MoFEMErrorCode setVariables(FaceElementForcesAndSourcesCore::UserDataOperator *fe_ptr, DataForcesAndSourcesCore::EntData &data)
MoFEMErrorCode setIndices(DataForcesAndSourcesCore::EntData &data)
MatrixDouble diffRho
for lhs with heterogeneous gc
VectorDouble griffithForce
Griffith force at nodes.

Member Data Documentation

◆ betaGC

const double FractureMechanics::GriffithForceElement::OpCalculateRhoAtCrackFrontUsingPrecalulatedCoeffs::betaGC

Definition at line 435 of file GriffithForceElement.hpp.

◆ mField

MoFEM::Interface& FractureMechanics::GriffithForceElement::OpCalculateRhoAtCrackFrontUsingPrecalulatedCoeffs::mField

Definition at line 438 of file GriffithForceElement.hpp.

◆ mwlsApprox

boost::shared_ptr<MWLSApprox> FractureMechanics::GriffithForceElement::OpCalculateRhoAtCrackFrontUsingPrecalulatedCoeffs::mwlsApprox

Definition at line 437 of file GriffithForceElement.hpp.

◆ rhoTagName

std::string FractureMechanics::GriffithForceElement::OpCalculateRhoAtCrackFrontUsingPrecalulatedCoeffs::rhoTagName

Definition at line 436 of file GriffithForceElement.hpp.


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