125 const int nb_integration_pts = getGaussPts().size2();
126 auto t_w = getFTensor0IntegrationWeight();
129 auto t_grad_val = getFTensor1FromMat<SPACE_DIM>(
132 auto t_hessian_val = getFTensor2FromMat<SPACE_DIM, SPACE_DIM>(
136 auto t_inv_jac = getFTensor2FromMat<SPACE_DIM, SPACE_DIM>(
138 auto t_coords = getFTensor1CoordsAtGaussPts();
147 const double volume = getMeasure();
150 std::array<double, 3> error = {0, 0,
153 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
155 const double alpha = t_w * volume;
159 double diff = t_val -
fun(t_coords(0), t_coords(1), t_coords(2));
160 error[0] += alpha * pow(diff, 2);
161 auto t_diff_grad =
diff_fun(t_coords(0), t_coords(1), t_coords(2));
162 t_diff_grad(
i) -= t_grad_val(
i);
164 error[1] += alpha * t_diff_grad(
i) *
168 MOFEM_LOG(
"SELF", Sev::noisy) <<
"t_hessian_val " << t_hessian_push;
171 if (std::abs(t_hessian_val(0, 1) - t_hessian_val(1, 0)) >
172 std::numeric_limits<float>::epsilon()) {
173 MOFEM_LOG(
"SELF", Sev::error) <<
"t_hessian_val " << t_hessian_val;
175 "Hessian should be symmetric");
178 auto t_diff_hessian =
diff2_fun(t_coords(0), t_coords(1), t_coords(2));
179 t_diff_hessian(
i,
j) -= t_hessian_val(
i,
j);
180 error[2] = t_diff_hessian(
i,
j) * t_diff_hessian(
i,
j);
192 std::array<int, 3> index = {0, 1, 2};