7 using SetPtsData = FieldEvaluatorInterface::SetPtsData;
10 boost::shared_ptr<EshelbianMonitor> base_monitor_ptr)
17 PetscBool test_cook_flg = PETSC_FALSE;
20 &test_cook_flg, PETSC_NULLPTR),
21 "get post proc points");
27 ptsHashMap[
"Point B"] = {48. / 2., 44. + (60. - 44.) / 2., 0.};
28 ptsHashMap[
"Point C"] = {48. / 2., (44. - 0.) / 2., 0.};
32 ptsHashMap[
"Point (2.5, 0., 0.)"] = {2.5, 0, 0.};
43 MOFEM_LOG(
"EP", Sev::inform) <<
"Testing Monitor postProcess";
45 PetscBool test_cook_flg = PETSC_FALSE;
47 char reaction_block_name[255] =
"FIX_ALL";
49 &test_cook_flg, PETSC_NULLPTR),
50 "get post proc points");
53 CHKERR PetscOptionsGetString(PETSC_NULLPTR,
"",
"-atom_test_reaction_block",
54 reaction_block_name, 255, PETSC_NULLPTR);
79 "Atom test 15 failed: reaction moment does not match expected "
80 "value. Got [%3.6e], expected [0.25].",
94 "Atom test 16 failed: reaction force does not match expected "
95 "value. Got [%3.6e, %3.6e, %3.6e], expected [-25.4149, 0.0, "
105 if (std::abs(*
gEnergy - 1.27096) > 1e-5) {
108 "Atom test 17 failed: strain energy does not match expected "
109 "value. Got %3.6e, expected 1.27096.",
119 "Atom test 18 failed: load factor does not match expected "
120 "value. Got %3.6e, expected 12.5325.",
131 "Atom test 19 failed: reaction force does not match expected "
132 "value. Got [%3.6e], expected [2.016e1].",
157 std::array<double, 3> point, std::string str, PetscInt
atom_test) {
160 dataFieldEval->setEvalPoints(point.data(), point.size() / 3);
162 auto w_l2_at_pts =
eP.
dataAtPts->getSmallWL2AtPts();
163 w_l2_at_pts->resize(0, 0,
false);
167 ->evalFEAtThePoint<SPACE_DIM>(
168 point.data(), 1e-12, problemPtr->getName(),
"EP",
dataFieldEval,
172 if (w_l2_at_pts->size1() == 0 || w_l2_at_pts->size2() == 0) {
173 CHKERR VecSetValue(vec, 0, 0.0, ADD_VALUES);
174 }
else if (w_l2_at_pts->size1() == 1 || w_l2_at_pts->size2() == 1) {
176 std::ostringstream s;
177 s << str <<
" elem " << getFEEntityHandle() <<
" ";
183 << add() <<
"point " << getVectorAdaptor(point.data(), 3);
185 << add() <<
"w " << *w_l2_at_pts;
186 double disp_at_point = (*w_l2_at_pts)(0, 0);
187 CHKERR VecSetValue(vec, 0, disp_at_point, ADD_VALUES);
190 "Unexpected displacement data shape (%ld, %ld).",
191 static_cast<long>(w_l2_at_pts->size1()),
192 static_cast<long>(w_l2_at_pts->size2()));
197 CHKERR VecAssemblyBegin(vec);
198 CHKERR VecAssemblyEnd(vec);
202 CHKERR VecGetValues(vec, 1, &idx, &error);
204 MPI_Bcast(&error, 1, MPI_DOUBLE, 0, PETSC_COMM_WORLD);
208 if (std::abs(error - 0.25) > 1e-5) {
210 "Atom test %d failed: wrong displacement %.12g.",
atom_test,
#define MOFEM_LOG_SEVERITY_SYNC(comm, severity)
Synchronise "SYNC" on curtain severity level.
#define MOFEM_LOG_SYNCHRONISE(comm)
Synchronise "SYNC" channel.
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_ATOM_TEST_INVALID
@ MOFEM_DATA_INCONSISTENCY
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define MOFEM_LOG(channel, severity)
Log.
MoFEM::Interface & mField
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
std::map< std::string, std::array< double, 3 > > & ptsHashMap
MoFEMErrorCode preProcess()
boost::shared_ptr< double > gEnergy
boost::shared_ptr< EshelbianMonitor > baseMonitorPtr
std::map< std::string, std::array< double, 6 > > & reactionForcesMap
EshelbianTestingMonitor(EshelbianCore &ep, boost::shared_ptr< EshelbianMonitor > base_monitor_ptr)
MoFEMErrorCode postProcess()
boost::shared_ptr< SetPtsData > dataFieldEval
MoFEMErrorCode checkExternalStrain(std::array< double, 3 > point, std::string str, PetscInt atom_test)
FieldEvaluatorInterface::SetPtsData SetPtsData
MoFEMErrorCode operator()()
virtual MPI_Comm & get_comm() const =0
virtual int get_comm_rank() const =0
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.