17 "Unexpected spatial projection lifetime");
24 "Spatial projection must be a nonempty square problem");
25 for (
const auto &dof : *problem->getNumeredRowDofsPtr())
26 if (dof->getName() !=
ep.spatialH1Disp)
28 "Spatial projection contains a non-H1-displacement field");
35 CHKERR checkProjection(ep,
false);
38 CHKERR checkProjection(ep,
true);
41 CHKERR checkProjection(ep,
false);
47 CHKERR checkProjection(ep,
true);
48 return PETSC_ERR_USER;
50 if (failed_solve() != PETSC_ERR_USER)
52 "Expected simulated solver failure");
53 CHKERR checkProjection(ep,
false);
59 CHKERR checkProjection(ep,
false);
62 char previous_type[256] =
"";
65 previous_type,
sizeof(previous_type), &found);
66 CHKERR PetscOptionsSetValue(
nullptr,
"-prjspatial_ksp_type",
67 "invalid_projection_ksp");
68 CHKERR PetscPushErrorHandler(PetscReturnErrorHandler,
nullptr);
69 bool failed_initialisation =
false;
73 failed_initialisation =
true;
75 CHKERR PetscPopErrorHandler();
77 CHKERR PetscOptionsSetValue(
nullptr,
"-prjspatial_ksp_type", previous_type);
79 CHKERR PetscOptionsClearValue(
nullptr,
"-prjspatial_ksp_type");
80 if (!failed_initialisation)
82 "Invalid projection KSP type must fail initialisation");
83 CHKERR checkProjection(ep,
false);
86 CHKERR checkProjection(ep,
true);
88 CHKERR checkProjection(ep,
false);
90 "Elastic spatial projection lifecycle atom passed\n");
96static char help[] =
"Verify elastic projection resource ownership.\n";
98int main(
int argc,
char *argv[]) {
100 auto core_log = logging::core::get();
Shared mesh and problem setup for auxiliary formulation atoms.
Elastic TS pre/post-step registration and H1 transfer lifecycle.
boost::shared_ptr< ConstrainMatrixCtx > projection
#define CATCH_ERRORS
Catch errors.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_ATOM_TEST_INVALID
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define THROW_MESSAGE(msg)
Throw MoFEM exception.
virtual const Problem * get_problem(const std::string problem_name) const =0
Get the problem object.
static LoggerType & setLog(const std::string channel)
Set ans resset chanel logger.
virtual bool check_problem(const std::string name)=0
check if problem exist
MoFEMErrorCode runAuxiliaryLogarithmicStressTest(const std::function< MoFEMErrorCode(EshelbianCore &)> &test)
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
implementation of Data Operators for Forces and Sources
PetscErrorCode PetscOptionsGetString(PetscOptions *, const char pre[], const char name[], char str[], size_t size, PetscBool *set)
MoFEM::Interface & mField
virtual MPI_Comm & get_comm() const =0
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.
static boost::shared_ptr< SinkType > createSink(boost::shared_ptr< std::ostream > stream_ptr, std::string comm_filter)
Create a sink object.
static boost::shared_ptr< std::ostream > getStrmWorld()
Get the strm world object.
static boost::shared_ptr< std::ostream > getStrmSync()
Get the strm sync object.
static boost::shared_ptr< std::ostream > getStrmSelf()
Get the strm self object.
keeps basic data about problem
DofIdx getNbDofsRow() const
DofIdx getNbDofsCol() const