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