Testing integration on skeleton for 3DChecking continuity of hdiv and hcurl spaces on faces, and testing methods for integration on the skeleton.
static char help[] =
"...\n\n";
int main(
int argc,
char *argv[]) {
auto core_log = logging::core::get();
core_log->add_sink(
try {
int rank;
MPI_Comm_rank(PETSC_COMM_WORLD, &rank);
PetscBool flg = PETSC_TRUE;
#if PETSC_VERSION_GE(3, 6, 4)
255, &flg);
#else
#endif
if (flg != PETSC_TRUE) {
SETERRQ(PETSC_COMM_SELF, 1, "*** ERROR -my_file (MESH FILE NEEDED)");
}
const char *option;
option = "";
0, 3, bit_level0);
enum bases { AINSWORTH, DEMKOWICZ, LASTBASEOP };
const char *list_bases[] = {"ainsworth", "demkowicz"};
PetscBool flg;
PetscInt choice_base_value = AINSWORTH;
LASTBASEOP, &choice_base_value, &flg);
if (flg == PETSC_TRUE) {
if (choice_base_value == AINSWORTH)
else if (choice_base_value == DEMKOWICZ)
return base;
}
};
const char *list_spaces[] = {"hdiv", "hcurl"};
PetscBool flg;
PetscInt choice_space_value =
HDIV;
LASTSPACEOP, &choice_space_value, &flg);
if (flg == PETSC_TRUE) {
if (choice_space_value ==
HDIV)
else if (choice_space_value ==
HCURL)
return space;
}
};
};
struct OpVolSide
elemData(elem_data) {}
if (CN::Dimension(
type) == 3) {
getCoordsAtGaussPts() - getFaceCoordsAtGaussPts();
<< "getCoordsAtGaussPts() " << getCoordsAtGaussPts();
<< "getFaceCoordsAtGaussPts() " << getFaceCoordsAtGaussPts();
constexpr
double eps = 1e-12;
if (norm_inf(diff) >
eps) {
MOFEM_LOG(
"ATOM_TEST", Sev::error) <<
"diff " << diff;
"Coordinates at integration pts are different");
}
}
if (nb_dofs) {
const size_t nb_integration_pts = getGaussPts().size2();
auto t_to_do_dot = getFTensor1Normal();
auto s1 = getFTensor1Tangent1();
auto s2 = getFTensor1Tangent2();
t_to_do_dot(
i) = s1(
i) + s2(
i);
}
if (getFEMethod()->nInTheLoop == 0)
ptr_dot_elem_data = &elemData.dotNormalEleLeft;
else
ptr_dot_elem_data = &elemData.dotNormalEleRight;
auto &dot_elem_data = *ptr_dot_elem_data;
if (dot_elem_data.size() == 0) {
dot_elem_data.resize(nb_integration_pts, false);
dot_elem_data.clear();
}
for (size_t gg = 0; gg != nb_integration_pts; ++gg) {
for (size_t bb = 0; bb != nb_dofs; ++bb) {
dot_elem_data(gg) += (t_to_do_dot(
i) * t_hdiv_base(
i)) * t_data;
++t_hdiv_base;
++t_data;
}
}
}
}
};
volSideFe(m_field), elemData(elem_data) {
auto jac_ptr = boost::make_shared<MatrixDouble>();
auto inv_jac_ptr = boost::make_shared<MatrixDouble>();
auto det_ptr = boost::make_shared<VectorDouble>();
new SkeletonFE::OpVolSide(elemData));
}
const size_t nb_integration_pts = getGaussPts().size2();
if (side == 0 &&
type == MBEDGE) {
elemData.dotNormalFace.resize(nb_integration_pts, false);
elemData.dotNormalFace.clear();
}
if (nb_dofs) {
auto t_to_do_dot = getFTensor1Normal();
auto s1 = getFTensor1Tangent1();
auto s2 = getFTensor1Tangent2();
t_to_do_dot(
i) = s1(
i) + s2(
i);
}
for (size_t gg = 0; gg != nb_integration_pts; ++gg) {
for (size_t bb = 0; bb != nb_dofs; ++bb) {
elemData.dotNormalFace(gg) +=
(t_to_do_dot(
i) * t_hdiv_base(
i)) * t_data;
++t_hdiv_base;
++t_data;
}
}
}
if (CN::Dimension(
type) == 2) {
elemData.dotNormalEleLeft.resize(0, false);
elemData.dotNormalEleRight.resize(0, false);
CHKERR loopSideVolumes(
"V1", volSideFe);
auto check_continuity_of_base = [&](auto &vol_dot_data) {
if (vol_dot_data.size() != elemData.dotNormalFace.size())
"Inconsistent number of integration points");
const double eps = 1e-12;
for (size_t gg = 0; gg != nb_integration_pts; ++gg) {
const double error =
std::abs(vol_dot_data(gg) - elemData.dotNormalFace(gg));
MOFEM_LOG(
"ATOM_TEST", Sev::noisy) <<
"Error: " << error;
"Inconsistency %3.4e != %3.4e", vol_dot_data(gg),
elemData.dotNormalFace(gg));
}
};
if (elemData.dotNormalEleLeft.size() != 0)
CHKERR check_continuity_of_base(elemData.dotNormalEleLeft);
else if (elemData.dotNormalEleRight.size() != 0)
CHKERR check_continuity_of_base(elemData.dotNormalEleRight);
}
}
};
auto cache_ptr = boost::make_shared<CacheTuple>();
for (auto &ent_ptr : (*field_ents_ptr)) {
MOFEM_LOG(
"ATOM_TEST", Sev::verbose) << *ent_ptr;
for(
auto &
v : ent_ptr->getEntFieldData())
for (
auto &
v : ent_ptr->getEntFieldData())
}
}
return 0;
}