v0.14.0
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
FractureMechanics::MWLSApprox::OpMWLSBase< T > Struct Template Referenceabstract

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

Inheritance diagram for FractureMechanics::MWLSApprox::OpMWLSBase< T >:
[legend]
Collaboration diagram for FractureMechanics::MWLSApprox::OpMWLSBase< T >:
[legend]

Public Member Functions

 OpMWLSBase (boost::shared_ptr< MatrixDouble > mat_pos_at_pts_ptr, boost::shared_ptr< MatrixDouble > mat_grad_pos_at_pts_ptr, boost::shared_ptr< CrackFrontElement > fe_singular_ptr, boost::shared_ptr< MWLSApprox > mwls_approx, bool testing=false)
 
virtual ~OpMWLSBase ()=default
 
MoFEMErrorCode doWork (int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
 

Public Attributes

boost::shared_ptr< MatrixDouble > matPosAtPtsPtr
 
boost::shared_ptr< MatrixDouble > matGradPosAtPtsPtr
 
boost::weak_ptr< CrackFrontElementfeSingularPtr
 
boost::shared_ptr< MWLSApproxmwlsApprox
 

Protected Member Functions

virtual MoFEMErrorCode doMWLSWork (int side, EntityType type, DataForcesAndSourcesCore::EntData &data)=0
 Do specific work in operator. More...
 

Detailed Description

template<class T>
struct FractureMechanics::MWLSApprox::OpMWLSBase< T >

Definition at line 238 of file MWLS.hpp.

Constructor & Destructor Documentation

◆ OpMWLSBase()

template<class T >
FractureMechanics::MWLSApprox::OpMWLSBase< T >::OpMWLSBase ( boost::shared_ptr< MatrixDouble >  mat_pos_at_pts_ptr,
boost::shared_ptr< MatrixDouble >  mat_grad_pos_at_pts_ptr,
boost::shared_ptr< CrackFrontElement fe_singular_ptr,
boost::shared_ptr< MWLSApprox mwls_approx,
bool  testing = false 
)
inline

Definition at line 244 of file MWLS.hpp.

248  : T::UserDataOperator("MESH_NODE_POSITIONS",
249  T::UserDataOperator::OPROW),
250  matPosAtPtsPtr(mat_pos_at_pts_ptr),
251  matGradPosAtPtsPtr(mat_grad_pos_at_pts_ptr),
252  feSingularPtr(fe_singular_ptr), mwlsApprox(mwls_approx) {}

◆ ~OpMWLSBase()

template<class T >
virtual FractureMechanics::MWLSApprox::OpMWLSBase< T >::~OpMWLSBase ( )
virtualdefault

Member Function Documentation

◆ doMWLSWork()

template<class T >
virtual MoFEMErrorCode FractureMechanics::MWLSApprox::OpMWLSBase< T >::doMWLSWork ( int  side,
EntityType  type,
DataForcesAndSourcesCore::EntData data 
)
protectedpure virtual

◆ doWork()

template<class T >
MoFEMErrorCode FractureMechanics::MWLSApprox::OpMWLSBase< T >::doWork ( int  side,
EntityType  type,
DataForcesAndSourcesCore::EntData data 
)

Definition at line 1111 of file MWLS.cpp.

1112  {
1114  if (type != MBVERTEX) {
1116  }
1117 
1118  if (std::is_same<T, VolumeElementForcesAndSourcesCore>::value)
1119  if (mwlsApprox->tetsInBlock.find(this->getFEEntityHandle()) ==
1120  mwlsApprox->tetsInBlock.end()) {
1122  }
1123 
1124  if (std::is_same<T, FaceElementForcesAndSourcesCore>::value)
1125  if (mwlsApprox->trisInBlock.find(this->getFEEntityHandle()) ==
1126  mwlsApprox->trisInBlock.end()) {
1128  }
1129 
1130  const int nb_gauss_pts = data.getN().size1();
1131 
1134 
1135  mwlsApprox->approxBasePoint.resize(3, nb_gauss_pts, false);
1136  mwlsApprox->approxBasePoint.clear();
1137  mwlsApprox->singularInitialDisplacement.resize(3, nb_gauss_pts, false);
1138  mwlsApprox->singularInitialDisplacement.clear();
1139  mwlsApprox->singularCurrentDisplacement.resize(3, nb_gauss_pts, false);
1140  mwlsApprox->singularCurrentDisplacement.clear();
1141 
1142  if (auto fe_ptr = feSingularPtr.lock()) {
1143 
1144  if (fe_ptr && fe_ptr->singularElement) {
1145 
1146  if (!matPosAtPtsPtr)
1147  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1148  "Matrix for material positions not acclocated");
1149 
1150  auto t_material_positions = getFTensor1FromMat<3>(*matPosAtPtsPtr);
1151  mwlsApprox->mwlsMaterialPositions.resize(matPosAtPtsPtr->size1(),
1152  matPosAtPtsPtr->size2(), false);
1153  auto t_mwls_material_positions =
1154  getFTensor1FromMat<3>(mwlsApprox->mwlsMaterialPositions);
1155 
1157  t_singular_displacement(&fe_ptr->singularDisp(0, 0),
1158  &fe_ptr->singularDisp(0, 1),
1159  &fe_ptr->singularDisp(0, 2));
1160 
1161  auto t_inital_singular_displacement =
1162  getFTensor1FromMat<3>(mwlsApprox->singularInitialDisplacement);
1163  auto t_current_singular_displacement =
1164  getFTensor1FromMat<3>(mwlsApprox->singularCurrentDisplacement);
1165  if (!matGradPosAtPtsPtr)
1166  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1167  "Matrix for gradient of positions not allocated");
1168  auto t_H = getFTensor2FromMat<3, 3>(*matGradPosAtPtsPtr);
1169  for (int gg = 0; gg != nb_gauss_pts; gg++) {
1170 
1171  t_inital_singular_displacement(i) = t_singular_displacement(i);
1172  t_current_singular_displacement(i) =
1173  t_H(i, j) * t_singular_displacement(j);
1174  t_mwls_material_positions(i) =
1175  t_material_positions(i) + t_current_singular_displacement(i);
1176 
1177  ++t_mwls_material_positions;
1178  ++t_material_positions;
1179  ++t_H;
1180  ++t_singular_displacement;
1181  ++t_inital_singular_displacement;
1182  ++t_current_singular_displacement;
1183  }
1184  } else {
1185  mwlsApprox->mwlsMaterialPositions = *matPosAtPtsPtr;
1186  }
1187  }
1188 
1189  const bool use_global_base =
1190  mwlsApprox->getUseGlobalBaseAtMaterialReferenceConfiguration();
1191 
1192  if (use_global_base) {
1193  auto t_mwls_material_positions =
1194  getFTensor1FromMat<3>(mwlsApprox->mwlsMaterialPositions);
1195  auto t_approx_base_point =
1196  getFTensor1FromMat<3>(mwlsApprox->approxBasePoint);
1197  for (int gg = 0; gg != nb_gauss_pts; gg++) {
1198  t_approx_base_point(i) = t_mwls_material_positions(i);
1199  ++t_approx_base_point;
1200  ++t_mwls_material_positions;
1201  }
1202  } else {
1203 
1204  auto fe_ptr = feSingularPtr.lock();
1205  if (fe_ptr && fe_ptr->singularElement) {
1206  auto t_inital_singular_displacement =
1207  getFTensor1FromMat<3>(mwlsApprox->singularInitialDisplacement);
1208  auto t_approx_base_point =
1209  getFTensor1FromMat<3>(mwlsApprox->approxBasePoint);
1210  auto t_coords_of_gauss_point = this->getFTensor1CoordsAtGaussPts();
1211  for (int gg = 0; gg != nb_gauss_pts; gg++) {
1212  t_approx_base_point(i) =
1213  t_coords_of_gauss_point(i) + t_inital_singular_displacement(i);
1214  ++t_approx_base_point;
1215  ++t_coords_of_gauss_point;
1216  ++t_inital_singular_displacement;
1217  }
1218  } else {
1219  auto t_approx_base_point =
1220  getFTensor1FromMat<3>(mwlsApprox->approxBasePoint);
1221  auto t_coords_of_gauss_point = this->getFTensor1CoordsAtGaussPts();
1222  for (int gg = 0; gg != nb_gauss_pts; gg++) {
1223  t_approx_base_point(i) = t_coords_of_gauss_point(i);
1224  ++t_approx_base_point;
1225  ++t_coords_of_gauss_point;
1226  }
1227  }
1228  }
1229 
1230  CHKERR doMWLSWork(side, type, data);
1231 
1233 }

Member Data Documentation

◆ feSingularPtr

template<class T >
boost::weak_ptr<CrackFrontElement> FractureMechanics::MWLSApprox::OpMWLSBase< T >::feSingularPtr

Definition at line 241 of file MWLS.hpp.

◆ matGradPosAtPtsPtr

template<class T >
boost::shared_ptr<MatrixDouble> FractureMechanics::MWLSApprox::OpMWLSBase< T >::matGradPosAtPtsPtr

Definition at line 240 of file MWLS.hpp.

◆ matPosAtPtsPtr

template<class T >
boost::shared_ptr<MatrixDouble> FractureMechanics::MWLSApprox::OpMWLSBase< T >::matPosAtPtsPtr

Definition at line 239 of file MWLS.hpp.

◆ mwlsApprox

template<class T >
boost::shared_ptr<MWLSApprox> FractureMechanics::MWLSApprox::OpMWLSBase< T >::mwlsApprox

Definition at line 242 of file MWLS.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::MWLSApprox::OpMWLSBase::mwlsApprox
boost::shared_ptr< MWLSApprox > mwlsApprox
Definition: MWLS.hpp:242
FTensor::Tensor1
Definition: Tensor1_value.hpp:8
FractureMechanics::MWLSApprox::OpMWLSBase::matGradPosAtPtsPtr
boost::shared_ptr< MatrixDouble > matGradPosAtPtsPtr
Definition: MWLS.hpp:240
FractureMechanics::MWLSApprox::OpMWLSBase::feSingularPtr
boost::weak_ptr< CrackFrontElement > feSingularPtr
Definition: MWLS.hpp:241
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
convert.type
type
Definition: convert.py:64
FractureMechanics::MWLSApprox::OpMWLSBase::doMWLSWork
virtual MoFEMErrorCode doMWLSWork(int side, EntityType type, DataForcesAndSourcesCore::EntData &data)=0
Do specific work in operator.
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
FTensor::Index< 'i', 3 >
FractureMechanics::MWLSApprox::OpMWLSBase::matPosAtPtsPtr
boost::shared_ptr< MatrixDouble > matPosAtPtsPtr
Definition: MWLS.hpp:239
UserDataOperator
ForcesAndSourcesCore::UserDataOperator UserDataOperator
Definition: HookeElement.hpp:75
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
MOFEM_DATA_INCONSISTENCY
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
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