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

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

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

Public Member Functions

 OpGetCrackFrontDataGradientAtGaussPts (const std::string field_name, boost::shared_ptr< MatrixDouble > data_at_pts, bool &singular_element, MatrixDouble &inv_s_jac)
 
MoFEMErrorCode doWork (int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
 

Public Attributes

boolsingularElement
 
MatrixDouble & invSJac
 

Detailed Description

Definition at line 478 of file CrackFrontElement.hpp.

Constructor & Destructor Documentation

◆ OpGetCrackFrontDataGradientAtGaussPts()

FractureMechanics::OpGetCrackFrontDataGradientAtGaussPts::OpGetCrackFrontDataGradientAtGaussPts ( const std::string  field_name,
boost::shared_ptr< MatrixDouble >  data_at_pts,
bool singular_element,
MatrixDouble &  inv_s_jac 
)
inline

Definition at line 484 of file CrackFrontElement.hpp.

488  singularElement(singular_element), invSJac(inv_s_jac) {}

Member Function Documentation

◆ doWork()

MoFEMErrorCode FractureMechanics::OpGetCrackFrontDataGradientAtGaussPts::doWork ( int  side,
EntityType  type,
DataForcesAndSourcesCore::EntData data 
)

Definition at line 263 of file CrackFrontElement.cpp.

264  {
266 
267  if (!singularElement) {
269  }
270 
271  const int nb_dofs = data.getFieldData().size();
272  if (!nb_dofs && type == this->zeroType) {
273  this->dataPtr->resize(9, 0, false);
275  }
276  if (!nb_dofs) {
278  }
279  const int nb_gauss_pts = data.getN().size1();
280  const int nb_base_functions = data.getN().size2();
281  ublas::matrix<double, ublas::row_major, DoubleAllocator> &mat =
282  *this->dataPtr;
283  if (type == this->zeroType) {
284  mat.resize(9, nb_gauss_pts, false);
285  mat.clear();
286  }
287  auto diff_base_function = data.getFTensor1DiffN<3>();
288  auto gradients_at_gauss_pts = getFTensor2FromMat<3, 3>(mat);
292  int size = nb_dofs / 3;
293  if (nb_dofs % 3) {
294  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "Data inconsistency");
295  }
296  double *inv_jac_ptr = &*invSJac.data().begin();
297  FTensor::Tensor2<double *, 3, 3> t_inv_singular_jacobian(
298  inv_jac_ptr, &inv_jac_ptr[1], &inv_jac_ptr[2], &inv_jac_ptr[3],
299  &inv_jac_ptr[4], &inv_jac_ptr[5], &inv_jac_ptr[6], &inv_jac_ptr[7],
300  &inv_jac_ptr[8], 9);
301 
302  for (int gg = 0; gg < nb_gauss_pts; ++gg) {
303  auto field_data = data.getFTensor1FieldData<3>();
304  int bb = 0;
305  for (; bb < size; ++bb) {
306  gradients_at_gauss_pts(I, J) +=
307  field_data(I) *
308  (t_inv_singular_jacobian(K, J) * diff_base_function(K));
309  ++field_data;
310  ++diff_base_function;
311  }
312  // Number of dofs can be smaller than number of Tensor_Dim0 x base functions
313  for (; bb != nb_base_functions; ++bb)
314  ++diff_base_function;
315  ++gradients_at_gauss_pts;
316  ++t_inv_singular_jacobian;
317  }
318 
320 }

Member Data Documentation

◆ invSJac

MatrixDouble& FractureMechanics::OpGetCrackFrontDataGradientAtGaussPts::invSJac

Definition at line 482 of file CrackFrontElement.hpp.

◆ singularElement

bool& FractureMechanics::OpGetCrackFrontDataGradientAtGaussPts::singularElement

Definition at line 481 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
MoFEM::K
VectorDouble K
Definition: Projection10NodeCoordsOnField.cpp:125
FractureMechanics::OpGetCrackFrontDataGradientAtGaussPts::invSJac
MatrixDouble & invSJac
Definition: CrackFrontElement.hpp:482
J
FTensor::Index< 'J', DIM1 > J
Definition: level_set.cpp:30
FTensor::Tensor2< double *, 3, 3 >
I
constexpr IntegrationType I
Definition: operators_tests.cpp:31
convert.type
type
Definition: convert.py:64
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
FTensor::Index
Definition: Index.hpp:23
MoFEM::OpCalculateVectorFieldGradient
Get field gradients at integration pts for scalar filed rank 0, i.e. vector field.
Definition: UserDataOperators.hpp:1535
MOFEM_DATA_INCONSISTENCY
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
FractureMechanics::OpGetCrackFrontDataGradientAtGaussPts::singularElement
bool & singularElement
Definition: CrackFrontElement.hpp:481
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
OpCalculateVectorFieldGradient