v0.13.1
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 
)

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}
static Index< 'J', 3 > J
static Index< 'K', 3 > K
#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
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
constexpr IntegrationType I
Definition: elastic.cpp:31
Get field gradients at integration pts for scalar filed rank 0, i.e. vector field.

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: