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;
48 &test_cook_flg, PETSC_NULLPTR),
49 "get post proc points");
76 "Atom test 15 failed: reaction moment does not match expected "
77 "value. Got [%3.6e], expected [0.25].",
90 "Atom test 16 failed: reaction force does not match expected "
91 "value. Got [%3.6e, %3.6e, %3.6e], expected [-25.4149, 0.0, "
101 if (std::abs(*
gEnergy - 1.27096) > 1e-5) {
104 "Atom test 17 failed: strain energy does not match expected "
105 "value. Got %3.6e, expected 1.27096.",
115 "Atom test 18 failed: load factor does not match expected "
116 "value. Got %3.6e, expected 12.5325.",
141 std::array<double, 3> point, std::string str, PetscInt
atom_test) {
144 dataFieldEval->setEvalPoints(point.data(), point.size() / 3);
146 auto w_l2_at_pts =
eP.
dataAtPts->getSmallWL2AtPts();
147 w_l2_at_pts->resize(0, 0,
false);
151 ->evalFEAtThePoint<SPACE_DIM>(
152 point.data(), 1e-12, problemPtr->getName(),
"EP",
dataFieldEval,
156 if (w_l2_at_pts->size1() == 0 || w_l2_at_pts->size2() == 0) {
157 CHKERR VecSetValue(vec, 0, 0.0, ADD_VALUES);
158 }
else if (w_l2_at_pts->size1() == 1 || w_l2_at_pts->size2() == 1) {
160 std::ostringstream s;
161 s << str <<
" elem " << getFEEntityHandle() <<
" ";
167 << add() <<
"point " << getVectorAdaptor(point.data(), 3);
169 << add() <<
"w " << *w_l2_at_pts;
170 double disp_at_point = (*w_l2_at_pts)(0, 0);
171 CHKERR VecSetValue(vec, 0, disp_at_point, ADD_VALUES);
174 "Unexpected displacement data shape (%ld, %ld).",
175 static_cast<long>(w_l2_at_pts->size1()),
176 static_cast<long>(w_l2_at_pts->size2()));
181 CHKERR VecAssemblyBegin(vec);
182 CHKERR VecAssemblyEnd(vec);
186 CHKERR VecGetValues(vec, 1, &idx, &error);
188 MPI_Bcast(&error, 1, MPI_DOUBLE, 0, PETSC_COMM_WORLD);
192 if (std::abs(error - 0.25) > 1e-5) {
194 "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.