v0.14.0
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.

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) {}

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  std::fill(commonData.diffRho.data().begin(),
480  commonData.diffRho.data().end(), 0);
481 
482  auto t_coords = get_ftensor_from_vec(row_data.getFieldData());
483 
484  commonData.densityRho.resize(nb_dofs / 3, false);
485  std::fill(commonData.densityRho.begin(), commonData.densityRho.end(), 0);
487  VectorDouble gc_coeff(nb_dofs, false);
488  auto t_coeff = get_ftensor_from_vec(gc_coeff);
489  auto t_approx_base_point =
490  getFTensor1FromMat<3>(mwlsApprox->approxBasePoint);
491  const int nb_gauss_pts = row_data.getN().size1();
492 
493  for (int gg = 0; gg != nb_gauss_pts; ++gg) {
494  for (int dd = 0; dd != nb_dofs / 3; ++dd) {
495 
496  // go only through nodes at the crack front
497  if (rowIndices[dd * 3] != -1) {
499  t_pos(i) = t_coords(i);
500 
501  for (int dd : {0, 1, 2})
502  mwlsApprox->approxPointCoords[dd] = t_approx_base_point(dd);
503 
504  mwlsApprox->getInfluenceNodes() = influence_nodes_map[gg];
505  mwlsApprox->getInvAB() = inv_AB_map[gg];
506  mwlsApprox->getShortenDm() = dm_nodes_map[gg];
507 
508  // approximate at MESH_NODE_POSITIONS
509  CHKERR mwlsApprox->evaluateApproxFun(&t_pos(0));
510  CHKERR mwlsApprox->evaluateFirstDiffApproxFun(&t_pos(0), false);
511  CHKERR mwlsApprox->getTagData(th);
512  rho = mwlsApprox->getDataApprox()[0];
513  const auto &diff_vals = mwlsApprox->getDiffDataApprox();
514  for (int ii = 0; ii != 3; ++ii) {
515  commonData.diffRho(ii, dd) = diff_vals(ii, 0);
516  }
517  t_coeff(i) = pow(rho, betaGC);
518  }
519 
520  ++rho;
521  ++t_coords;
522  ++t_coeff;
523  }
524  }
525  // multiply griffith force with coefficients
527  element_prod(commonData.griffithForce, gc_coeff);
529  }

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:
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
FractureMechanics::GriffithForceElement::OpCalculateRhoAtCrackFrontUsingPrecalulatedCoeffs::mwlsApprox
boost::shared_ptr< MWLSApprox > mwlsApprox
Definition: GriffithForceElement.hpp:437
FractureMechanics::GriffithForceElement::AuxOp::AuxOp
AuxOp(int tag, BlockData &block_data, CommonData &common_data)
Definition: GriffithForceElement.hpp:221
FTensor::Tensor1
Definition: Tensor1_value.hpp:8
rho
double rho
Definition: plastic.cpp:191
FractureMechanics::GriffithForceElement::AuxOp::setIndices
MoFEMErrorCode setIndices(DataForcesAndSourcesCore::EntData &data)
Definition: GriffithForceElement.hpp:232
MoFEM::th
Tag th
Definition: Projection10NodeCoordsOnField.cpp:122
FractureMechanics::GriffithForceElement::AuxOp::setVariables
MoFEMErrorCode setVariables(FaceElementForcesAndSourcesCore::UserDataOperator *fe_ptr, DataForcesAndSourcesCore::EntData &data)
Definition: GriffithForceElement.hpp:261
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:535
convert.type
type
Definition: convert.py:64
MoFEM::getFTensor0FromVec
static auto getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
Definition: Templates.hpp:135
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
FractureMechanics::GriffithForceElement::OpCalculateRhoAtCrackFrontUsingPrecalulatedCoeffs::betaGC
const double betaGC
Definition: GriffithForceElement.hpp:435
FTensor::Index< 'i', 3 >
FractureMechanics::GriffithForceElement::CommonData::diffRho
MatrixDouble diffRho
for lhs with heterogeneous gc
Definition: GriffithForceElement.hpp:70
v
const double v
phase velocity of light in medium (cm/ns)
Definition: initial_diffusion.cpp:40
FTensor::dd
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
FractureMechanics::GriffithForceElement::CommonData::densityRho
VectorDouble densityRho
gc * rho^beta
Definition: GriffithForceElement.hpp:69
UserDataOperator
ForcesAndSourcesCore::UserDataOperator UserDataOperator
Definition: HookeElement.hpp:75
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
FractureMechanics::GriffithForceElement::AuxOp::rowIndices
ublas::vector< int > rowIndices
Definition: GriffithForceElement.hpp:222
MoFEM::Types::VectorDouble
UBlasVector< double > VectorDouble
Definition: Types.hpp:68
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
FractureMechanics::GriffithForceElement::CommonData::griffithForce
VectorDouble griffithForce
Griffith force at nodes.
Definition: GriffithForceElement.hpp:65
FractureMechanics::GriffithForceElement::AuxOp::commonData
CommonData & commonData
Definition: GriffithForceElement.hpp:219
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
FractureMechanics::GriffithForceElement::OpCalculateRhoAtCrackFrontUsingPrecalulatedCoeffs::mField
MoFEM::Interface & mField
Definition: GriffithForceElement.hpp:438
MoFEM::ForcesAndSourcesCore::UserDataOperator::OPROW
@ OPROW
operator doWork function is executed on FE rows
Definition: ForcesAndSourcesCore.hpp:567
FractureMechanics::GriffithForceElement::OpCalculateRhoAtCrackFrontUsingPrecalulatedCoeffs::rhoTagName
std::string rhoTagName
Definition: GriffithForceElement.hpp:436