10 static char help[] =
"...\n\n";
14 for (
unsigned int ii = 0; ii <
m.size1(); ii++) {
15 for (
unsigned int jj = 0; jj <
m.size2(); jj++) {
16 s += std::abs(
m(ii, jj));
22 int main(
int argc,
char *argv[]) {
31 PetscBool flg = PETSC_TRUE;
33 #if PETSC_VERSION_GE(3, 6, 4)
40 if (flg != PETSC_TRUE) {
41 SETERRQ(PETSC_COMM_SELF, 1,
"Error -my_file (mesh file needed)");
48 CHKERR moab.get_entities_by_type(0, MBVERTEX, verts,
true);
53 CHKERR moab.get_coords(verts, &coords(0, 0));
54 for (
int i = 0;
i < verts.size(); ++
i) {
72 std::array<int, 4> faces_nodes = {0, 1, 2, 3};
77 constexpr
double eps = 1e-4;
78 double quad_bubbles_sum = 3.275491e+01;
79 double quad_diff_bubbles_sum = 5.838131e+02;
82 faces_nodes.data(), p, &*
N.data().begin(), &*diffN.data().begin(),
83 &*quad_bubbles.data().begin(), &*quad_diff_bubbles.data().begin(),
86 if (std::abs(quad_bubbles_sum -
sum_matrix(quad_bubbles)) >
eps) {
88 "wrong result = %8.6e",
sum_matrix(quad_bubbles));
90 if (std::abs(quad_diff_bubbles_sum -
sum_matrix(quad_diff_bubbles)) >
93 "wrong result = %8.6e",
sum_matrix(quad_diff_bubbles));
99 int sense[] = {1, -1, 1, -1};
100 int p[] = {3, 4, 5, 6};
103 for (; ee < 4; ee++) {
107 double *quad_edges_ptr[4];
108 std::array<MatrixDouble, 4> quad_edges;
109 for (
auto ee : {0, 1, 2, 3}) {
111 quad_edges_ptr[ee] = &quad_edges[ee](0, 0);
114 double *quad_diff_edges_ptr[4];
115 std::array<MatrixDouble, 4> quad_diff_edges;
116 for (
auto ee : {0, 1, 2, 3}) {
118 quad_diff_edges_ptr[ee] = &quad_diff_edges[ee](0, 0);
122 double quad_edges_sum[] = {1.237500e+01, 1.535050e+01, 1.781890e+01,
124 double quad_diff_edges_sum[] = {8.470000e+01, 1.192510e+02, 1.580128e+02,
128 sense, p, &*
N.data().begin(), &*diffN.data().begin(), quad_edges_ptr,
131 for (
int ee = 0; ee < 4; ++ee) {
132 if (std::abs(quad_edges_sum[ee] -
sum_matrix(quad_edges[ee])) >
eps)
134 "edge %d wrong result = %8.6e", ee,
137 if (std::abs(quad_diff_edges_sum[ee] -
140 "edge %d wrong result = %8.6e", ee,