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

Verify the five-coordinate Neo-Hookean material map. More...

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

Go to the source code of this file.

Typedefs

using Material = EshelbianPlasticity::NeoHookeanLogarithmicMaterial
 

Functions

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

Variables

static char help []
 

Detailed Description

Verify the five-coordinate Neo-Hookean material map.

Definition in file neohookean_auxiliary_log_stress_atom.cpp.

Typedef Documentation

◆ Material

Definition at line 9 of file neohookean_auxiliary_log_stress_atom.cpp.

Function Documentation

◆ main()

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

Definition at line 499 of file neohookean_auxiliary_log_stress_atom.cpp.

499 {
500 MoFEM::Core::Initialize(&argc, &argv, nullptr, help);
501 try {
502 moab::Core moab;
503 MoFEM::Core core(moab);
504 MoFEM::Interface &m_field = core;
505 auto *json_config = m_field.getInterface<JsonConfigManager>();
506 auto *meshsets_manager = m_field.getInterface<MeshsetsManager>();
507 // Only material parameters are needed; this atom has no element geometry.
508 CHKERR meshsets_manager->addMeshset(BLOCKSET, 1001, "MAT_NEOHOOKEAN");
509 CHKERR meshsets_manager->setMeshsetFromFile();
510 const auto block =
511 json_config->getParamsFromBlockset("MAT_NEOHOOKEAN", 1001);
512 if (block.size() != 2 || !block.count("c10") || !block.count("k"))
513 SETERRQ(PETSC_COMM_SELF, MOFEM_ATOM_TEST_INVALID,
514 "Atom requires MAT_NEOHOOKEAN JSON block 1001 with c10,k");
515 const Material::Parameters parameters{block.at("c10"), block.at("k")};
517 CHKERR checkNear(parameters.c10, 1.7, 1.e-14, "reference C10");
518 CHKERR checkNear(parameters.bulkModulus, 8.5, 1.e-14, "reference K");
519 PetscReal fd_step = 0., tolerance = 0.;
520 CHKERR PetscOptionsGetReal(nullptr, nullptr, "-auxiliary_atom_fd_step",
521 &fd_step, nullptr);
522 CHKERR PetscOptionsGetReal(nullptr, nullptr, "-auxiliary_atom_tolerance",
523 &tolerance, nullptr);
524 if (!std::isfinite(fd_step) || fd_step <= 0. || !std::isfinite(tolerance) ||
525 tolerance <= 0.)
526 SETERRQ(PETSC_COMM_SELF, MOFEM_ATOM_TEST_INVALID,
527 "Atom requires positive finite JSON finite-difference settings");
528 CHKERR checkReference(parameters, tolerance);
529 CHKERR checkReference({parameters.c10, 0.1}, tolerance);
530 CHKERR checkSpectralStates(parameters, fd_step, tolerance);
531 CHKERR checkForwardReferences(parameters, fd_step, tolerance);
532 CHKERR checkLargeStress(parameters, tolerance);
533 CHKERR checkSmallDeviator(parameters, tolerance);
534 CHKERR checkEnergyScaling(tolerance);
535 CHKERR checkConditioning(parameters, tolerance);
536 CHKERR checkInvalidInputs(parameters);
537 CHKERR PetscPrintf(
538 PETSC_COMM_WORLD,
539 "Neo-Hookean auxiliary logarithmic stress atom passed\n");
540 }
543 return 0;
544}
#define CATCH_ERRORS
Catch errors.
@ BLOCKSET
@ MOFEM_ATOM_TEST_INVALID
Definition definitions.h:40
#define CHKERR
Inline error check.
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:
=
"Neo-Hookean auxiliary logarithmic stress material atom.\n"
"Use -json_config neohookean_auxiliary_log_stress_atom.json.\n"

Definition at line 495 of file neohookean_auxiliary_log_stress_atom.cpp.