416 <<
"Refinement for quad is not implemented";
422 auto create_reference_element = [&moab_ref]() {
424 constexpr
double base_coords[] = {
440 for (
int nn = 0; nn < 4; nn++)
441 CHKERR moab_ref.create_vertex(&base_coords[3 * nn], nodes[nn]);
443 CHKERR moab_ref.create_element(MBQUAD, nodes, 4, quad);
447 auto add_ho_nodes = [&]() {
450 CHKERR moab_ref.get_entities_by_type(0, MBQUAD, quads,
true);
452 CHKERR moab_ref.create_meshset(MESHSET_SET, meshset);
453 CHKERR moab_ref.add_entities(meshset, quads);
454 CHKERR moab_ref.convert_entities(meshset,
true,
true,
true);
455 CHKERR moab_ref.delete_entities(&meshset, 1);
459 auto set_gauss_pts = [&](std::map<EntityHandle, int> &little_map) {
462 CHKERR moab_ref.get_entities_by_type(0, MBQUAD, quads,
true);
464 CHKERR moab_ref.get_connectivity(quads, quads_nodes,
false);
466 gauss_pts.resize(quads_nodes.size(), 4,
false);
468 for (
auto node : quads_nodes) {
469 CHKERR moab_ref.get_coords(&node, 1, &gauss_pts(gg, 0));
470 little_map[node] = gg;
473 gauss_pts = trans(gauss_pts);
477 auto set_ref_quads = [&](std::map<EntityHandle, int> &little_map) {
480 CHKERR moab_ref.get_entities_by_type(0, MBQUAD, quads,
true);
483 for (
auto quad : quads) {
486 CHKERR moab_ref.get_connectivity(quad, conn, num_nodes,
false);
487 if (ref_quads.size2() != num_nodes) {
488 ref_quads.resize(quads.size(), num_nodes);
490 for (
int nn = 0; nn != num_nodes; ++nn) {
491 ref_quads(hh, nn) = little_map[conn[nn]];
498 auto set_shape_functions = [&]() {
502 const auto nb_gauss_pts = gauss_pts.size2();
503 shape_functions.resize(nb_gauss_pts, 4);
504 for (
int gg = 0; gg != nb_gauss_pts; ++gg) {
505 const double ksi = gauss_pts(0, gg);
506 const double zeta = gauss_pts(1, gg);
519 CHKERR create_reference_element();
522 std::map<EntityHandle, int> little_map;
523 CHKERR set_gauss_pts(little_map);
524 CHKERR set_ref_quads(little_map);
525 CHKERR set_shape_functions();