14 {
15
17 try {
18 moab::Core mb_instance;
19 moab::Interface &moab = mb_instance;
21
22 auto test_quad = [&]() {
25 int rule_ksi = 6;
26 int rule_eta = 8;
28 rule_eta);
29 int nb_gauss_pts = pts_quad.size2();
30 double sum_coords = 0, sum_gauss_pts = 0;
31 for (
int i = 0;
i < nb_gauss_pts; ++
i) {
32 sum_coords += pts_quad(0,
i) + pts_quad(1,
i);
33 sum_gauss_pts += pts_quad(2,
i);
34 }
36 if (fabs(20.0 - sum_coords) >
eps) {
38 "wrong result %3.4e", sum_coords);
39 }
40 if (fabs(1.0 - sum_gauss_pts) >
eps) {
42 "wrong result %3.4e", sum_gauss_pts);
43 }
45 };
46
47 auto test_hex = [&]() {
50 int rule_ksi = 4;
51 int rule_eta = 5;
52 int rule_zet = 6;
54 rule_eta, rule_zet);
55 int nb_gauss_pts = pts_quad.size2();
56 double sum_coords = 0, sum_gauss_pts = 0;
57 for (
int i = 0;
i < nb_gauss_pts; ++
i) {
58 sum_coords += pts_quad(0,
i) + pts_quad(1,
i) + pts_quad(2,
i);
59 sum_gauss_pts += pts_quad(3,
i);
60 }
62 if (fabs(54.0 - sum_coords) >
eps) {
64 "wrong result %3.4e", sum_coords);
65 }
66 if (fabs(1.0 - sum_gauss_pts) >
eps) {
68 "wrong result %3.4e", sum_gauss_pts);
69 }
71 };
72
75 }
77
79}
#define CATCH_ERRORS
Catch errors.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_DATA_INCONSISTENCY
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
FTensor::Index< 'i', SPACE_DIM > i
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.