35#include <VolumeLengthQuality.hpp>
41static char help[] =
"Calculate crack release energy and crack propagation"
54int main(
int argc,
char *argv[]) {
56 const char param_file[] =
"param_file.petsc";
61 PetscBool flg = PETSC_FALSE;
63 if (flg == PETSC_TRUE)
69 moab::Core mb_instance;
70 moab::Interface &moab = mb_instance;
83 auto add_last_twenty = [&]() {
89 ->addToDatabaseBitRefLevelByType(MBTET, mask,
BitRefLevel().set());
93 auto add_first_four = [&]() {
96 for (
int ll = 0; ll != 5; ++ll)
99 ->addToDatabaseBitRefLevelByType(MBTET, mask,
BitRefLevel().set());
108 ->writeEntitiesAllBitLevelsByType(
BitRefLevel().set(), MBTET,
109 "all_start.vtk",
"VTK",
"");
121 CHKERR moab.create_meshset(MESHSET_SET, meshset);
122 CHKERR moab.add_entities(meshset, ents);
123 CHKERR moab.write_file(
"ents_not_in_database_to_delete.vtk",
"VTK",
"",
125 CHKERR moab.delete_entities(&meshset, 1);
128 CHKERR moab.get_entities_by_type(0, MBENTITYSET, meshsets,
false);
129 for (
auto m : meshsets)
130 CHKERR moab.remove_entities(
m, ents);
131 CHKERR moab.delete_entities(ents);
145 CHKERR moab.get_entities_by_type(0, MBTET, vol,
false);
153 CHKERR moab.write_mesh(
"cut_mesh_out.h5m");
157 "out_level0.vtk",
"VTK",
"");
160 "out_level1_tets.vtk",
"VTK",
"");
163 "out_level1_prisms.vtk",
"VTK",
"");
Solvers for crack propagation.
Main class for crack propagation.
Implementation of linear elastic material.
Implementation of Neo-Hookean elastic material.
#define CATCH_ERRORS
Catch errors.
#define BITREFLEVEL_SIZE
max number of refinements
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
implementation of Data Operators for Forces and Sources
PetscErrorCode PetscOptionsGetBool(PetscOptions *, const char pre[], const char name[], PetscBool *bval, PetscBool *set)
PetscErrorCode PetscOptionsGetString(PetscOptions *, const char pre[], const char name[], char str[], size_t size, PetscBool *set)
FTensor::Index< 'm', 3 > m
const std::string & getCutSurfMeshName() const
std::map< std::string, BitRefLevel > mapBitLevel
static bool parallelReadAndBroadcast
MoFEMErrorCode getOptions()
Get options form command line.
double crackAccelerationFactor
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Deprecated interface functions.
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.