95 {
97
98 auto fe_ptr = getNumeredEntFiniteElementPtr();
99 auto fe_bit = fe_ptr->getBitRefLevel();
101 const int nb_integration_pts = getGaussPts().size2();
102
103 auto t_val = getFTensor1FromMat<1>(*(
dataPtr));
104 auto t_coords = getFTensor1CoordsAtGaussPts();
105
106 for (int gg = 0; gg != nb_integration_pts; ++gg) {
107
108 double projected_value = t_val(0);
109 double analytical_value =
fun(t_coords(0), t_coords(1), t_coords(2));
110 double error = projected_value - analytical_value;
111
112 constexpr double eps = 1e-8;
113 if (std::abs(error) >
eps) {
115 << "Projection error too large: " << error << " at point ("
116 << t_coords(0) << ", " << t_coords(1) << ")"
117 << " projected=" << projected_value
118 << " analytical=" << analytical_value;
120 "DG projection failed accuracy test");
121 }
122
123 ++t_val;
124 ++t_coords;
125 }
126
128 << "DG projection accuracy validation passed";
129 }
130
132 }
#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 MOFEM_LOG(channel, severity)
Log.