v0.14.0
Classes | Typedefs | Enumerations | Functions | Variables
FractureMechanics Namespace Reference

Classes

struct  AnalyticalDisp
 
struct  AnalyticalForces
 
struct  AnalyticalOptions
 
struct  ConstantArea
 Constant area constrains. More...
 
struct  CPMeshCut
 
struct  CPSolvers
 
struct  CrackFrontSingularBase
 
struct  CrackPropagation
 
struct  FirendVolumeOnSide
 
struct  GetSmoothingElementsSkin
 
struct  GriffithForceElement
 Implementation of Griffith element. More...
 
struct  MWLSApprox
 
struct  OpAleLhsWithDensitySingularElement_dX_dX
 
struct  OpAleLhsWithDensitySingularElement_dx_dX
 
struct  OpAnalyticalMaterialTraction
 
struct  OpAnalyticalSpatialTraction
 
struct  OpGetCrackFrontCommonDataAtGaussPts
 
struct  OpGetCrackFrontDataAtGaussPts
 
struct  OpGetCrackFrontDataGradientAtGaussPts
 
struct  OpGetDensityFieldForTesting
 Op to generate artificial density field. More...
 
struct  OpLhsBoneExplicitDerivariveWithHooke_dX
 Calculate explicit derivative of energy. More...
 
struct  OpLhsBoneExplicitDerivariveWithHooke_dx
 
struct  OpPostProcDisplacements
 
struct  OpPrint
 
struct  OpRhsBoneExplicitDerivariveWithHooke
 Calculate explicit derivative of energy. More...
 
struct  OpSetTagRangeOnSkin
 Mark crack surfaces on skin. More...
 
struct  OpTransfromSingularBaseFunctions
 
class  TwoType
 

Typedefs

typedef CrackFrontSingularBase< NonlinearElasticElement::MyVolumeFE, VolumeElementForcesAndSourcesCore > CrackFrontElement
 

Enumerations

enum  Materials {
  HOOKE, KIRCHHOFF, NEOHOOKEAN, BONEHOOKE,
  LASTOP
}
 
enum  AdolcTags {
  ELASTIC_TAG = 1, MATERIAL_TAG, GRIFFITH_FORCE_TAG, GRIFFITH_CONSTRAINS_TAG,
  CONSTANT_AREA_TAG, ARC_LENGTH_TAG, FRONT_TANGENT, EXTERIOR_DERIVATIVE_TAG,
  SMOOTHING_TAG, SURFACE_SLIDING_TAG, EDGE_SLIDING_TAG
}
 Tapes numbers used by ADOL-C. More...
 
enum  tangent_tests { MWLS_STRESS_TAN, MWLS_DENSITY_TAN, MWLS_GRIFFITH_TAN, LASTTAN }
 Names of tangent matrices tests. More...
 

Functions

MoFEMErrorCode clean_pcomms (moab::Interface &moab, boost::shared_ptr< WrapMPIComm > moab_comm_wrap)
 
MoFEMErrorCode broadcast_entities (moab::Interface &moab, moab::Interface &moab_tmp, const int from_proc, Range &entities, const bool adjacencies, const bool tags)
 
static double calMax (double a, double b, double r)
 
static double diffCalMax_a (double a, double b, double r)
 
MoFEMErrorCode clean_pcomms (moab::Interface &moab, boost::shared_ptr< WrapMPIComm > moab_comm_wrap)
 
static MoFEMErrorCode elastic_snes_rhs (SNES snes, Vec x, Vec f, void *ctx)
 
static MoFEMErrorCode elastic_snes_mat (SNES snes, Vec x, Mat A, Mat B, void *ctx)
 
static MoFEMErrorCode propagation_snes_rhs (SNES snes, Vec x, Vec f, void *ctx)
 
static MoFEMErrorCode propagation_snes_mat (SNES snes, Vec x, Mat A, Mat B, void *ctx)
 

Variables

static std::map< long int, MatrixDouble > mapRefCoords
 
const char * materials_list []
 

Typedef Documentation

◆ CrackFrontElement

Definition at line 402 of file CrackFrontElement.hpp.

Enumeration Type Documentation

◆ AdolcTags

Tapes numbers used by ADOL-C.

Enumerator
ELASTIC_TAG 
MATERIAL_TAG 
GRIFFITH_FORCE_TAG 
GRIFFITH_CONSTRAINS_TAG 
CONSTANT_AREA_TAG 
ARC_LENGTH_TAG 
FRONT_TANGENT 
EXTERIOR_DERIVATIVE_TAG 
SMOOTHING_TAG 
SURFACE_SLIDING_TAG 
EDGE_SLIDING_TAG 

Definition at line 36 of file CrackPropagation.hpp.

◆ Materials

Enumerator
HOOKE 
KIRCHHOFF 
NEOHOOKEAN 
BONEHOOKE 
LASTOP 

Definition at line 23 of file CrackFrontElement.hpp.

◆ tangent_tests

Names of tangent matrices tests.

Enumerator
MWLS_STRESS_TAN 
MWLS_DENSITY_TAN 
MWLS_GRIFFITH_TAN 
LASTTAN 

Definition at line 54 of file CrackPropagation.hpp.

54  {
58  LASTTAN
59 };

Function Documentation

◆ broadcast_entities()

MoFEMErrorCode FractureMechanics::broadcast_entities ( moab::Interface &  moab,
moab::Interface &  moab_tmp,
const int  from_proc,
Range entities,
const bool  adjacencies,
const bool  tags 
)

Definition at line 149 of file CrackPropagation.cpp.

152  {
153  ErrorCode result = MB_SUCCESS;
154  int success;
155  int buff_size;
156 
157  auto add_verts = [&](Range &sent_ents) {
158  // Get the verts adj to these entities, since we'll have to send those
159  // too
160 
161  // First check sets
162  std::pair<Range::const_iterator, Range::const_iterator> set_range =
163  sent_ents.equal_range(MBENTITYSET);
164  ErrorCode result = MB_SUCCESS, tmp_result;
165  for (Range::const_iterator rit = set_range.first; rit != set_range.second;
166  ++rit) {
167  tmp_result = moab_tmp.get_entities_by_type(*rit, MBVERTEX, sent_ents);
168  CHK_MOAB_THROW(tmp_result, "Failed to get contained verts");
169  }
170 
171  // Now non-sets
172  Range tmp_ents;
173  std::copy(sent_ents.begin(), set_range.first, range_inserter(tmp_ents));
174  result = moab_tmp.get_adjacencies(tmp_ents, 0, false, sent_ents,
175  moab::Interface::UNION);
176  CHK_MOAB_THROW(result, "Failed to get vertices adj to ghosted ents");
177 
178  return result;
179  };
180 
181  ParallelComm *pcomm = ParallelComm::get_pcomm(&moab_tmp, MYPCOMM_INDEX);
182  auto &procConfig = pcomm->proc_config();
183  const int MAX_BCAST_SIZE = (1 << 28);
184 
185  ParallelComm::Buffer buff(ParallelComm::INITIAL_BUFF_SIZE);
186  buff.reset_ptr(sizeof(int));
187  if ((int)procConfig.proc_rank() == from_proc) {
188 
189  result = add_verts(entities);
190  CHK_MOAB_THROW(result, "Failed to add adj vertices");
191 
192  buff.reset_ptr(sizeof(int));
193  result = pcomm->pack_buffer(entities, adjacencies, tags, false, -1, &buff);
194  CHK_MOAB_THROW(result,
195  "Failed to compute buffer size in broadcast_entities");
196  buff.set_stored_size();
197  buff_size = buff.buff_ptr - buff.mem_ptr;
198  }
199 
200  success =
201  MPI_Bcast(&buff_size, 1, MPI_INT, from_proc, procConfig.proc_comm());
202  if (MPI_SUCCESS != success) {
203  THROW_MESSAGE("MPI_Bcast of buffer size failed");
204  }
205 
206  if (!buff_size) // No data
207  return MB_SUCCESS;
208 
209  if ((int)procConfig.proc_rank() != from_proc)
210  buff.reserve(buff_size);
211 
212  size_t offset = 0;
213  while (buff_size) {
214  int sz = std::min(buff_size, MAX_BCAST_SIZE);
215  success = MPI_Bcast(buff.mem_ptr + offset, sz, MPI_UNSIGNED_CHAR, from_proc,
216  procConfig.proc_comm());
217  if (MPI_SUCCESS != success) {
218  THROW_MESSAGE("MPI_Bcast of buffer failed");
219  }
220 
221  offset += sz;
222  buff_size -= sz;
223  }
224 
225  std::vector<std::vector<EntityHandle>> dum1a, dum1b;
226  std::vector<std::vector<int>> dum1p;
227  std::vector<EntityHandle> dum2, dum4;
228  std::vector<unsigned int> dum3;
229  buff.reset_ptr(sizeof(int));
230  if ((int)procConfig.proc_rank() == from_proc) {
231  ParallelComm *pcomm = ParallelComm::get_pcomm(&moab, MYPCOMM_INDEX);
232  result = pcomm->unpack_buffer(buff.buff_ptr, false, from_proc, -1, dum1a,
233  dum1b, dum1p, dum2, dum2, dum3, dum4);
234  } else {
235  result = pcomm->unpack_buffer(buff.buff_ptr, false, from_proc, -1, dum1a,
236  dum1b, dum1p, dum2, dum2, dum3, dum4);
237  }
238  CHK_MOAB_THROW(result, "Failed to unpack buffer in broadcast_entities");
239  std::copy(dum4.begin(), dum4.end(), range_inserter(entities));
240 
241  return MB_SUCCESS;
242 };

◆ calMax()

static double FractureMechanics::calMax ( double  a,
double  b,
double  r 
)
static

Definition at line 24 of file GriffithForceElement.hpp.

24  {
25  return (a + b + (1 / r) * pow(fabs(a - b), r)) / 2;
26 }

◆ clean_pcomms() [1/2]

MoFEMErrorCode FractureMechanics::clean_pcomms ( moab::Interface &  moab,
boost::shared_ptr< WrapMPIComm >  moab_comm_wrap 
)

◆ clean_pcomms() [2/2]

MoFEMErrorCode FractureMechanics::clean_pcomms ( moab::Interface &  moab,
boost::shared_ptr< WrapMPIComm moab_comm_wrap 
)

Definition at line 128 of file CrackPropagation.cpp.

129  {
131  std::vector<ParallelComm *> list_pcomms;
132  ParallelComm::get_all_pcomm(&moab, list_pcomms);
133  if (list_pcomms[MYPCOMM_INDEX]) {
134  CHKERR moab.tag_delete(list_pcomms[MYPCOMM_INDEX]->pstatus_tag());
135  CHKERR moab.tag_delete(list_pcomms[MYPCOMM_INDEX]->sharedps_tag());
136  CHKERR moab.tag_delete(list_pcomms[MYPCOMM_INDEX]->sharedhs_tag());
137  CHKERR moab.tag_delete(list_pcomms[MYPCOMM_INDEX]->sharedp_tag());
138  CHKERR moab.tag_delete(list_pcomms[MYPCOMM_INDEX]->sharedh_tag());
139  }
140  for (auto p : list_pcomms) {
141  delete p;
142  }
143  int pcomm_id = MYPCOMM_INDEX;
144  list_pcomms[MYPCOMM_INDEX] =
145  new ParallelComm(&moab, moab_comm_wrap->get_comm(), &pcomm_id);
147 }

◆ diffCalMax_a()

static double FractureMechanics::diffCalMax_a ( double  a,
double  b,
double  r 
)
static

Definition at line 28 of file GriffithForceElement.hpp.

28  {
29  double sgn = ((a - b) == 0) ? 0 : (((a - b) < 0) ? -1 : 1);
30  return (1 + pow(fabs(a - b), r - 1) * sgn * (+1)) / 2;
31 }

◆ elastic_snes_mat()

static MoFEMErrorCode FractureMechanics::elastic_snes_mat ( SNES  snes,
Vec  x,
Mat  A,
Mat  B,
void *  ctx 
)
static

Definition at line 8214 of file CrackPropagation.cpp.

8215  {
8216  auto arc_snes_ctx =
8217  reinterpret_cast<CrackPropagation::ArcLengthSnesCtx *>(ctx);
8219  CHKERR SnesMat(snes, x, A, B, ctx);
8220  CHKERR MatDiagonalScale(B, arc_snes_ctx->getVecDiagM(), PETSC_NULL);
8222 };

◆ elastic_snes_rhs()

static MoFEMErrorCode FractureMechanics::elastic_snes_rhs ( SNES  snes,
Vec  x,
Vec  f,
void *  ctx 
)
static

Definition at line 8205 of file CrackPropagation.cpp.

8205  {
8206  auto arc_snes_ctx =
8207  reinterpret_cast<CrackPropagation::ArcLengthSnesCtx *>(ctx);
8209  CHKERR SnesRhs(snes, x, f, ctx);
8210  CHKERR VecPointwiseMult(f, f, arc_snes_ctx->getVecDiagM());
8212 }

◆ propagation_snes_mat()

static MoFEMErrorCode FractureMechanics::propagation_snes_mat ( SNES  snes,
Vec  x,
Mat  A,
Mat  B,
void *  ctx 
)
static

Definition at line 8478 of file CrackPropagation.cpp.

8479  {
8480  auto arc_snes_ctx =
8481  reinterpret_cast<CrackPropagation::ArcLengthSnesCtx *>(ctx);
8483 
8484  CHKERR SnesMat(snes, x, A, B, ctx);
8485 
8486  CHKERR MatDiagonalScale(B, arc_snes_ctx->getVecDiagM(), PETSC_NULL);
8487  CHKERR VecPointwiseMult(arc_snes_ctx->getArcPtr()->F_lambda,
8488  arc_snes_ctx->getArcPtr()->F_lambda,
8489  arc_snes_ctx->getVecDiagM());
8490 
8492 };

◆ propagation_snes_rhs()

static MoFEMErrorCode FractureMechanics::propagation_snes_rhs ( SNES  snes,
Vec  x,
Vec  f,
void *  ctx 
)
static

Definition at line 8469 of file CrackPropagation.cpp.

8469  {
8470  auto arc_snes_ctx =
8471  reinterpret_cast<CrackPropagation::ArcLengthSnesCtx *>(ctx);
8473  CHKERR SnesRhs(snes, x, f, ctx);
8474  CHKERR VecPointwiseMult(f, f, arc_snes_ctx->getVecDiagM());
8476 };

Variable Documentation

◆ mapRefCoords

std::map<long int, MatrixDouble> FractureMechanics::mapRefCoords
static
Examples
EshelbianPlasticity.cpp.

Definition at line 53 of file CrackFrontElement.cpp.

◆ materials_list

const char* FractureMechanics::materials_list[]
Initial value:
= {"HOOKE", "KIRCHHOFF", "NEOHOOKEAN",
"BONEHOOKE"}

Definition at line 494 of file CrackPropagation.cpp.

CHK_MOAB_THROW
#define CHK_MOAB_THROW(err, msg)
Check error code of MoAB function and throw MoFEM exception.
Definition: definitions.h:589
MYPCOMM_INDEX
#define MYPCOMM_INDEX
default communicator number PCOMM
Definition: definitions.h:228
FractureMechanics::CONSTANT_AREA_TAG
@ CONSTANT_AREA_TAG
Definition: CrackPropagation.hpp:41
FractureMechanics::BONEHOOKE
@ BONEHOOKE
Definition: CrackFrontElement.hpp:23
FractureMechanics::SMOOTHING_TAG
@ SMOOTHING_TAG
Definition: CrackPropagation.hpp:45
FractureMechanics::SURFACE_SLIDING_TAG
@ SURFACE_SLIDING_TAG
Definition: CrackPropagation.hpp:46
A
constexpr AssemblyType A
Definition: operators_tests.cpp:30
FractureMechanics::MWLS_DENSITY_TAN
@ MWLS_DENSITY_TAN
Definition: CrackPropagation.hpp:56
THROW_MESSAGE
#define THROW_MESSAGE(msg)
Throw MoFEM exception.
Definition: definitions.h:574
sdf.r
int r
Definition: sdf.py:8
FractureMechanics::KIRCHHOFF
@ KIRCHHOFF
Definition: CrackFrontElement.hpp:23
FractureMechanics::MATERIAL_TAG
@ MATERIAL_TAG
Definition: CrackPropagation.hpp:38
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
FractureMechanics::ELASTIC_TAG
@ ELASTIC_TAG
Definition: CrackPropagation.hpp:37
a
constexpr double a
Definition: approx_sphere.cpp:30
FractureMechanics::ARC_LENGTH_TAG
@ ARC_LENGTH_TAG
Definition: CrackPropagation.hpp:42
FractureMechanics::MWLS_GRIFFITH_TAN
@ MWLS_GRIFFITH_TAN
Definition: CrackPropagation.hpp:57
FractureMechanics::LASTTAN
@ LASTTAN
Definition: CrackPropagation.hpp:58
FractureMechanics::EDGE_SLIDING_TAG
@ EDGE_SLIDING_TAG
Definition: CrackPropagation.hpp:47
FractureMechanics::FRONT_TANGENT
@ FRONT_TANGENT
Definition: CrackPropagation.hpp:43
FractureMechanics::MWLS_STRESS_TAN
@ MWLS_STRESS_TAN
Definition: CrackPropagation.hpp:55
FractureMechanics::NEOHOOKEAN
@ NEOHOOKEAN
Definition: CrackFrontElement.hpp:23
FractureMechanics::GRIFFITH_FORCE_TAG
@ GRIFFITH_FORCE_TAG
Definition: CrackPropagation.hpp:39
FractureMechanics::HOOKE
@ HOOKE
Definition: CrackFrontElement.hpp:23
MoFEM::SnesRhs
PetscErrorCode SnesRhs(SNES snes, Vec x, Vec f, void *ctx)
This is MoFEM implementation for the right hand side (residual vector) evaluation in SNES solver.
Definition: SnesCtx.cpp:27
Range
HenckyOps::f
auto f
Definition: HenckyOps.hpp:15
FractureMechanics::GRIFFITH_CONSTRAINS_TAG
@ GRIFFITH_CONSTRAINS_TAG
Definition: CrackPropagation.hpp:40
FractureMechanics::EXTERIOR_DERIVATIVE_TAG
@ EXTERIOR_DERIVATIVE_TAG
Definition: CrackPropagation.hpp:44
MoFEM::SnesMat
PetscErrorCode SnesMat(SNES snes, Vec x, Mat A, Mat B, void *ctx)
This is MoFEM implementation for the left hand side (tangent matrix) evaluation in SNES solver.
Definition: SnesCtx.cpp:139
FractureMechanics::LASTOP
@ LASTOP
Definition: CrackFrontElement.hpp:23
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