v0.14.0
Public Member Functions | Public Attributes | List of all members
FractureMechanics::OpGetDensityFieldForTesting Struct Reference

Op to generate artificial density field. More...

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

Inheritance diagram for FractureMechanics::OpGetDensityFieldForTesting:
[legend]
Collaboration diagram for FractureMechanics::OpGetDensityFieldForTesting:
[legend]

Public Member Functions

 OpGetDensityFieldForTesting (const std::string row_field, boost::shared_ptr< MatrixDouble > mat_coords_ptr, boost::shared_ptr< VectorDouble > density_at_pts, boost::shared_ptr< MatrixDouble > rho_grad_at_gauss_pts_ptr, boost::shared_ptr< MatrixDouble > rho_grad_grad_at_gauss_pts_ptr, boost::shared_ptr< CrackFrontElement > fe_singular_ptr, MatrixDouble &singular_disp, boost::shared_ptr< MatrixDouble > mat_grad_pos_at_pts_ptr)
 
MoFEMErrorCode doWork (int row_side, EntityType row_type, HookeElement::EntData &row_data)
 

Public Attributes

boost::shared_ptr< MatrixDouble > matCoordsPtr
 
boost::shared_ptr< VectorDouble > rhoAtGaussPtsPtr
 
boost::shared_ptr< MatrixDouble > rhoGradAtGaussPtsPtr
 
boost::shared_ptr< MatrixDouble > rhoGradGradAtGaussPtsPtr
 
boost::shared_ptr< CrackFrontElementfeSingularPtr
 
MatrixDouble & singularDisp
 
boost::shared_ptr< MatrixDouble > matGradPosAtPtsPtr
 

Detailed Description

Op to generate artificial density field.

Definition at line 760 of file CrackFrontElement.hpp.

Constructor & Destructor Documentation

◆ OpGetDensityFieldForTesting()

FractureMechanics::OpGetDensityFieldForTesting::OpGetDensityFieldForTesting ( const std::string  row_field,
boost::shared_ptr< MatrixDouble >  mat_coords_ptr,
boost::shared_ptr< VectorDouble >  density_at_pts,
boost::shared_ptr< MatrixDouble >  rho_grad_at_gauss_pts_ptr,
boost::shared_ptr< MatrixDouble >  rho_grad_grad_at_gauss_pts_ptr,
boost::shared_ptr< CrackFrontElement fe_singular_ptr,
MatrixDouble &  singular_disp,
boost::shared_ptr< MatrixDouble >  mat_grad_pos_at_pts_ptr 
)
inline

Definition at line 769 of file CrackFrontElement.hpp.

778  : HookeElement::VolUserDataOperator(row_field, OPROW),
779  matCoordsPtr(mat_coords_ptr), rhoAtGaussPtsPtr(density_at_pts),
780  rhoGradAtGaussPtsPtr(rho_grad_at_gauss_pts_ptr),
781  rhoGradGradAtGaussPtsPtr(rho_grad_grad_at_gauss_pts_ptr),
782  feSingularPtr(fe_singular_ptr), singularDisp(singular_disp),
783  matGradPosAtPtsPtr(mat_grad_pos_at_pts_ptr) {}

Member Function Documentation

◆ doWork()

MoFEMErrorCode FractureMechanics::OpGetDensityFieldForTesting::doWork ( int  row_side,
EntityType  row_type,
HookeElement::EntData row_data 
)

Definition at line 1485 of file CrackFrontElement.cpp.

1486  {
1488  if (row_type != MBVERTEX)
1490  // get number of integration points
1491  const int nb_integration_pts = getGaussPts().size2();
1492  rhoAtGaussPtsPtr->resize(nb_integration_pts, false);
1493  rhoAtGaussPtsPtr->clear();
1494  rhoGradAtGaussPtsPtr->resize(3, nb_integration_pts, false);
1495  rhoGradAtGaussPtsPtr->clear();
1496  rhoGradGradAtGaussPtsPtr->resize(9, nb_integration_pts, false);
1497  rhoGradGradAtGaussPtsPtr->clear();
1498 
1499  auto t_rho = getFTensor0FromVec(*rhoAtGaussPtsPtr);
1500  auto t_grad_rho = getFTensor1FromMat<3>(*rhoGradAtGaussPtsPtr);
1501  auto t_grad_grad_rho = getFTensor2FromMat<3, 3>(*rhoGradGradAtGaussPtsPtr);
1502 
1503  MatrixDouble &coords = *matCoordsPtr;
1504 
1507 
1508  singularDisp.resize(3, nb_integration_pts, false);
1509  singularDisp.clear();
1510 
1511  auto t_material_positions = getFTensor1FromMat<3>(coords);
1512  auto t_mwls_material_positions = getFTensor1FromMat<3>(coords);
1513  if (feSingularPtr->singularElement) {
1514  MatrixDouble singular_current_displacement;
1515 
1516  singular_current_displacement.resize(3, nb_integration_pts, false);
1517  singular_current_displacement.clear();
1518 
1519  FTensor::Tensor1<FTensor::PackPtr<double *, 3>, 3> t_singular_displacement(
1520  &feSingularPtr->singularDisp(0, 0), &feSingularPtr->singularDisp(0, 1),
1521  &feSingularPtr->singularDisp(0, 2));
1522  auto t_inital_singular_displacement = getFTensor1FromMat<3>(singularDisp);
1523  auto t_current_singular_displacement =
1524  getFTensor1FromMat<3>(singular_current_displacement);
1525  if (!matGradPosAtPtsPtr)
1526  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1527  "Matrix for gradient of positions not allocated");
1528  auto t_H = getFTensor2FromMat<3, 3>(*matGradPosAtPtsPtr);
1529  for (int gg = 0; gg != nb_integration_pts; gg++) {
1530 
1531  t_inital_singular_displacement(i) = t_singular_displacement(i);
1532  t_current_singular_displacement(i) =
1533  t_H(i, j) * t_singular_displacement(j);
1534 
1535  t_material_positions(i) += t_current_singular_displacement(i);
1536 
1537  ++t_material_positions;
1538  ++t_H;
1539  ++t_singular_displacement;
1540  ++t_inital_singular_displacement;
1541  ++t_current_singular_displacement;
1542  }
1543  }
1544  for (int gg = 0; gg != nb_integration_pts; ++gg) {
1545  t_rho =
1546  1 + t_mwls_material_positions(i) *
1547  t_mwls_material_positions(i); // density is equal to
1548  // 1+x^2+y^2+z^2 (x,y,z coordines)
1549  t_grad_rho(i) = 2 * t_mwls_material_positions(i);
1550  t_grad_grad_rho(0, 0) = 2.;
1551  t_grad_grad_rho(1, 1) = 2.;
1552  t_grad_grad_rho(2, 2) = 2.;
1553 
1554  ++t_rho;
1555  ++t_mwls_material_positions;
1556  ++t_grad_rho;
1557  ++t_grad_grad_rho;
1558  }
1559 
1561 }

Member Data Documentation

◆ feSingularPtr

boost::shared_ptr<CrackFrontElement> FractureMechanics::OpGetDensityFieldForTesting::feSingularPtr

Definition at line 766 of file CrackFrontElement.hpp.

◆ matCoordsPtr

boost::shared_ptr<MatrixDouble> FractureMechanics::OpGetDensityFieldForTesting::matCoordsPtr

Definition at line 762 of file CrackFrontElement.hpp.

◆ matGradPosAtPtsPtr

boost::shared_ptr<MatrixDouble> FractureMechanics::OpGetDensityFieldForTesting::matGradPosAtPtsPtr

Definition at line 768 of file CrackFrontElement.hpp.

◆ rhoAtGaussPtsPtr

boost::shared_ptr<VectorDouble> FractureMechanics::OpGetDensityFieldForTesting::rhoAtGaussPtsPtr

Definition at line 763 of file CrackFrontElement.hpp.

◆ rhoGradAtGaussPtsPtr

boost::shared_ptr<MatrixDouble> FractureMechanics::OpGetDensityFieldForTesting::rhoGradAtGaussPtsPtr

Definition at line 764 of file CrackFrontElement.hpp.

◆ rhoGradGradAtGaussPtsPtr

boost::shared_ptr<MatrixDouble> FractureMechanics::OpGetDensityFieldForTesting::rhoGradGradAtGaussPtsPtr

Definition at line 765 of file CrackFrontElement.hpp.

◆ singularDisp

MatrixDouble& FractureMechanics::OpGetDensityFieldForTesting::singularDisp

Definition at line 767 of file CrackFrontElement.hpp.


The documentation for this struct was generated from the following files:
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
FractureMechanics::OpGetDensityFieldForTesting::rhoAtGaussPtsPtr
boost::shared_ptr< VectorDouble > rhoAtGaussPtsPtr
Definition: CrackFrontElement.hpp:763
FTensor::Tensor1
Definition: Tensor1_value.hpp:8
MoFEM::Types::MatrixDouble
UBlasMatrix< double > MatrixDouble
Definition: Types.hpp:77
MoFEM::getFTensor0FromVec
static auto getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
Definition: Templates.hpp:135
VolUserDataOperator
VolumeElementForcesAndSourcesCore::UserDataOperator VolUserDataOperator
Definition: elasticity.cpp:76
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
FTensor::Index< 'i', 3 >
FractureMechanics::OpGetDensityFieldForTesting::rhoGradGradAtGaussPtsPtr
boost::shared_ptr< MatrixDouble > rhoGradGradAtGaussPtsPtr
Definition: CrackFrontElement.hpp:765
FractureMechanics::OpGetDensityFieldForTesting::rhoGradAtGaussPtsPtr
boost::shared_ptr< MatrixDouble > rhoGradAtGaussPtsPtr
Definition: CrackFrontElement.hpp:764
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
FractureMechanics::OpGetDensityFieldForTesting::matCoordsPtr
boost::shared_ptr< MatrixDouble > matCoordsPtr
Definition: CrackFrontElement.hpp:762
MOFEM_DATA_INCONSISTENCY
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
FractureMechanics::OpGetDensityFieldForTesting::singularDisp
MatrixDouble & singularDisp
Definition: CrackFrontElement.hpp:767
FractureMechanics::OpGetDensityFieldForTesting::matGradPosAtPtsPtr
boost::shared_ptr< MatrixDouble > matGradPosAtPtsPtr
Definition: CrackFrontElement.hpp:768
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
FractureMechanics::OpGetDensityFieldForTesting::feSingularPtr
boost::shared_ptr< CrackFrontElement > feSingularPtr
Definition: CrackFrontElement.hpp:766
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359