301 }
catch (
const out_of_range &e) {
304 "Generation of reference elements for type <%s> is not implemented",
305 moab::CN::EntityTypeName(
type));
308 auto set_gauss_pts = [&](
auto &level_gauss_pts_on_ref_mesh,
auto &level_ref,
309 auto &level_shape_functions,
311 auto start_vert_handle,
auto start_ele_handle,
312 auto &verts_array,
auto &conn,
auto &ver_count,
319 level = std::min(level, level_gauss_pts_on_ref_mesh.size() - 1);
321 auto &level_ref_gauss_pts = level_gauss_pts_on_ref_mesh[level];
322 auto &level_ref_ele = level_ref[level];
323 auto &shape_functions = level_shape_functions[level];
324 E::gaussPts.resize(level_ref_gauss_pts.size1(), level_ref_gauss_pts.size2(),
326 noalias(E::gaussPts) = level_ref_gauss_pts;
328 const auto fe_ent = E::numeredEntFiniteElementPtr->getEnt();
329 auto get_fe_coords = [&]() {
333 E::mField.get_moab().get_connectivity(fe_ent, conn, num_nodes,
true),
334 "error get connectivity");
337 E::mField.get_moab().get_coords(conn, num_nodes, &*coords.begin()),
338 "error get coordinates");
342 auto coords = get_fe_coords();
344 const int num_nodes = level_ref_gauss_pts.size2();
349 &*shape_functions.data().begin());
351 &verts_array[0][ver_count], &verts_array[1][ver_count],
352 &verts_array[2][ver_count]);
353 for (
int gg = 0; gg != num_nodes; ++gg, ++ver_count) {
357 auto set_float_precision = [](
const double x) {
358 if (std::abs(x) < std::numeric_limits<float>::epsilon())
365 auto t_ele_coords = getFTensor1FromArray<3, 3>(coords);
366 for (
int nn = 0; nn != CN::VerticesPerEntity(
type); ++nn) {
367 t_coords(
i) += t_n * t_ele_coords(
i);
372 for (
auto ii : {0, 1, 2})
373 t_coords(ii) = set_float_precision(t_coords(ii));
379 int def_in_the_loop = -1;
381 "NB_IN_THE_LOOP", 1, MB_TYPE_INTEGER,
th, MB_TAG_CREAT | MB_TAG_SPARSE,
385 const int num_el = level_ref_ele.size1();
386 const int num_nodes_on_ele = level_ref_ele.size2();
387 auto start_e = start_ele_handle + ele_count;
389 for (
auto tt = 0; tt != level_ref_ele.size1(); ++tt, ++ele_count) {
390 for (
int nn = 0; nn != num_nodes_on_ele; ++nn) {
391 conn[num_nodes_on_ele * ele_count + nn] =
396 const int n_in_the_loop = E::nInTheLoop;
406 ref_ele->levelGaussPtsOnRefMesh, ref_ele->levelRef,
407 ref_ele->levelShapeFunctions,
409 ref_ele->startingVertEleHandle, ref_ele->startingEleHandle,
410 ref_ele->verticesOnEleArrays, ref_ele->eleConn, ref_ele->countVertEle,