12static char help[] =
"...\n\n";
14int main(
int argc,
char *argv[]) {
18 moab::Core mb_instance;
19 moab::Interface &moab = mb_instance;
22 auto test_quad = [&]() {
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);
36 if (fabs(20.0 - sum_coords) >
eps) {
38 "wrong result %3.4e", sum_coords);
40 if (fabs(1.0 - sum_gauss_pts) >
eps) {
42 "wrong result %3.4e", sum_gauss_pts);
47 auto test_hex = [&]() {
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);
62 if (fabs(54.0 - sum_coords) >
eps) {
64 "wrong result %3.4e", sum_coords);
66 if (fabs(1.0 - sum_gauss_pts) >
eps) {
68 "wrong result %3.4e", sum_gauss_pts);
#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
implementation of Data Operators for Forces and Sources
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.