v0.16.3
Loading...
Searching...
No Matches
Functions | Variables
auxiliary_logarithmic_stress_space_atom.cpp File Reference

Weak mesh-stress closure, observability and coefficient elimination. More...

#include <MoFEM.hpp>
#include <EshelbianPlasticity.hpp>
#include <NeoHookeanLogarithmicMaterial.hpp>
#include <IntegrationRules.hpp>

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Variables

static char help []
 

Detailed Description

Weak mesh-stress closure, observability and coefficient elimination.

Definition in file auxiliary_logarithmic_stress_space_atom.cpp.

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 480 of file auxiliary_logarithmic_stress_space_atom.cpp.

480 {
481 MoFEM::Core::Initialize(&argc, &argv, nullptr, help);
482 try {
483 moab::Core moab;
484 MoFEM::Core core(moab);
485 MoFEM::Interface &m_field = core;
486 auto *json = m_field.getInterface<JsonConfigManager>();
487 auto *meshsets = m_field.getInterface<MeshsetsManager>();
488 CHKERR meshsets->addMeshset(BLOCKSET, 1001, "MAT_NEOHOOKEAN");
489 CHKERR meshsets->setMeshsetFromFile();
490 const auto block = json->getParamsFromBlockset("MAT_NEOHOOKEAN", 1001);
491 if (block.size() != 2 || !block.count("c10") || !block.count("k"))
492 SETERRQ(PETSC_COMM_SELF, MOFEM_ATOM_TEST_INVALID,
493 "Space atom requires MAT_NEOHOOKEAN JSON block 1001 with c10,k");
494 const Material::Parameters parameters{block.at("c10"), block.at("k")};
496 PetscInt quadrature_order = 0;
497 PetscReal tolerance = 0., newton_tolerance = 0.;
498 CHKERR PetscOptionsGetInt(nullptr, nullptr, "-auxiliary_space_quadrature_order",
499 &quadrature_order, nullptr);
500 CHKERR PetscOptionsGetReal(nullptr, nullptr, "-auxiliary_space_tolerance",
501 &tolerance, nullptr);
502 CHKERR PetscOptionsGetReal(nullptr, nullptr,
503 "-auxiliary_space_newton_tolerance",
504 &newton_tolerance, nullptr);
505 if (quadrature_order < 4 || !std::isfinite(tolerance) || tolerance <= 0. ||
506 !std::isfinite(newton_tolerance) || newton_tolerance <= 0. ||
507 newton_tolerance >= tolerance)
508 SETERRQ(PETSC_COMM_SELF, MOFEM_ATOM_TEST_INVALID,
509 "Space atom requires positive finite JSON tolerances and "
510 "quadrature order at least four");
511 CHKERR runSpaceAtom(parameters, quadrature_order, tolerance, newton_tolerance);
512 }
515 return 0;
516}
#define CATCH_ERRORS
Catch errors.
@ BLOCKSET
@ MOFEM_ATOM_TEST_INVALID
Definition definitions.h:40
#define CHKERR
Inline error check.
PetscErrorCode PetscOptionsGetInt(PetscOptions *, const char pre[], const char name[], PetscInt *ivalue, PetscBool *set)
PetscErrorCode PetscOptionsGetReal(PetscOptions *, const char pre[], const char name[], PetscReal *dval, PetscBool *set)
static MoFEMErrorCode validateParameters(const Parameters &parameters)
Check finite, strictly positive C10, K and representable mu = 2*C10.
Core (interface) class.
Definition Core.hpp:83
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
Definition Core.cpp:68
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Definition Core.cpp:123
Deprecated interface functions.
std::map< std::string, double > getParamsFromBlockset(const std::string &type_name, int meshset_id) const
Interface for managing meshsets containing materials and boundary conditions.
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.

Variable Documentation

◆ help

char help[]
static
Initial value:
=
"Check weak auxiliary stress spaces and coefficient Schur elimination.\n"

Definition at line 477 of file auxiliary_logarithmic_stress_space_atom.cpp.