v0.14.0
Loading...
Searching...
No Matches
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

namespace  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}
static Index< 'p', 3 > p
#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.
static LoggerType & setLog(const std::string channel)
Set ans resset chanel logger.
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
float d
Definition sdf_hertz.py:5
int r
Definition sdf.py:8
constexpr auto field_name