v0.14.0
Classes | Namespaces | Macros | Functions | Variables
CrackPropagation.cpp File Reference
#include <tetgen.h>
#include <moab/SpatialLocator.hpp>
#include <moab/ElemEvaluator.hpp>
#include <MoFEM.hpp>
#include <cholesky.hpp>
#include <BasicFiniteElements.hpp>
#include <Mortar.hpp>
#include <Hooke.hpp>
#include <AnalyticalFun.hpp>
#include <ComplexConstArea.hpp>
#include <ConstantArea.hpp>
#include <phg-quadrule/quad.h>
#include <NeoHookean.hpp>
#include <Smoother.hpp>
#include <VolumeLengthQuality.hpp>
#include <SurfaceSlidingConstrains.hpp>
#include <CrackFrontElement.hpp>
#include <MWLS.hpp>
#include <GriffithForceElement.hpp>
#include <CrackPropagation.hpp>
#include <petsc/private/pcimpl.h>
#include <CPSolvers.hpp>
#include <CPMeshCut.hpp>
#include <thread>

Go to the source code of this file.

Classes

struct  FractureMechanics::GetSmoothingElementsSkin
 
struct  FractureMechanics::OpPrint
 

Namespaces

 FractureMechanics
 

Macros

#define SINGULARITY
 

Functions

static MoFEMErrorCode snes_monitor_fields (SNES snes, PetscInt its, PetscReal fgnorm, PetscViewerAndFormat *vf)
 
MoFEMErrorCode FractureMechanics::clean_pcomms (moab::Interface &moab, boost::shared_ptr< WrapMPIComm > moab_comm_wrap)
 
MoFEMErrorCode FractureMechanics::broadcast_entities (moab::Interface &moab, moab::Interface &moab_tmp, const int from_proc, Range &entities, const bool adjacencies, const bool tags)
 
static MoFEMErrorCode FractureMechanics::elastic_snes_rhs (SNES snes, Vec x, Vec f, void *ctx)
 
static MoFEMErrorCode FractureMechanics::elastic_snes_mat (SNES snes, Vec x, Mat A, Mat B, void *ctx)
 
static MoFEMErrorCode FractureMechanics::propagation_snes_rhs (SNES snes, Vec x, Vec f, void *ctx)
 
static MoFEMErrorCode FractureMechanics::propagation_snes_mat (SNES snes, Vec x, Mat A, Mat B, void *ctx)
 

Variables

const char * FractureMechanics::materials_list []
 

Macro Definition Documentation

◆ SINGULARITY

#define SINGULARITY

Definition at line 19 of file CrackPropagation.cpp.

Function Documentation

◆ snes_monitor_fields()

static MoFEMErrorCode snes_monitor_fields ( SNES  snes,
PetscInt  its,
PetscReal  fgnorm,
PetscViewerAndFormat *  vf 
)
static

Definition at line 70 of file CrackPropagation.cpp.

72  {
73  PetscViewer viewer = vf->viewer;
74  Vec res;
75  DM dm;
76  PetscSection s;
77  const PetscScalar *r;
78  PetscReal *lnorms, *norms;
79  PetscInt numFields, f, pStart, pEnd, p;
80 
82  LogManager::setLog("PETSC");
83  MOFEM_LOG_TAG("PETSC", "SnesProp");
84 
85  PetscValidHeaderSpecific(viewer, PETSC_VIEWER_CLASSID, 4);
86  CHKERR SNESGetFunction(snes, &res, 0, 0);
87  CHKERR SNESGetDM(snes, &dm);
88  CHKERR DMGetDefaultSection(dm, &s);
89  CHKERR PetscSectionGetNumFields(s, &numFields);
90  CHKERR PetscSectionGetChart(s, &pStart, &pEnd);
91  CHKERR PetscCalloc2(numFields, &lnorms, numFields, &norms);
92  CHKERR VecGetArrayRead(res, &r);
93  for (p = pStart; p < pEnd; ++p) {
94  for (f = 0; f < numFields; ++f) {
95  PetscInt fdof, foff, d;
96 
97  CHKERR PetscSectionGetFieldDof(s, p, f, &fdof);
98  CHKERR PetscSectionGetFieldOffset(s, p, f, &foff);
99  for (d = 0; d < fdof; ++d)
100  lnorms[f] += PetscRealPart(PetscSqr(r[foff + d]));
101  }
102  }
103  CHKERR VecRestoreArrayRead(res, &r);
104  CHKERR MPIU_Allreduce(lnorms, norms, numFields, MPIU_REAL, MPIU_SUM,
105  PetscObjectComm((PetscObject)dm));
106  CHKERR PetscViewerPushFormat(viewer, vf->format);
107  CHKERR PetscViewerASCIIAddTab(viewer, ((PetscObject)snes)->tablevel);
108  CHKERR PetscViewerASCIIPrintf(viewer, "%3D SNES Function norm %14.12e\n", its,
109  (double)fgnorm);
110  for (f = 0; f < numFields; ++f) {
111  const char *field_name;
112  CHKERR PetscSectionGetFieldName(s, f, &field_name);
113  CHKERR PetscViewerASCIIPrintf(viewer, "\t%30.30s\t%14.12e\n", field_name,
114  (double)PetscSqrtReal(norms[f]));
115  }
116  CHKERR PetscViewerASCIISubtractTab(viewer, ((PetscObject)snes)->tablevel);
117  CHKERR PetscViewerPopFormat(viewer);
118  CHKERR PetscFree2(lnorms, norms);
119 
120  LogManager::setLog("PETSC");
122 }
sdf.r
int r
Definition: sdf.py:8
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:535
MOFEM_LOG_TAG
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
Definition: LogManager.hpp:339
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
HenckyOps::f
auto f
Definition: HenckyOps.hpp:15
EigenMatrix::Vec
const FTensor::Tensor2< T, Dim, Dim > Vec
Definition: MatrixFunction.hpp:66
sdf_hertz_2d_axisymm_plane.d
float d
Definition: sdf_hertz_2d_axisymm_plane.py:4
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346