269 auto create_reference_element = [&moab_ref]() {
271 constexpr
double base_coords[] = {
284 for (
int nn = 0; nn != 3; ++nn)
285 CHKERR moab_ref.create_vertex(&base_coords[3 * nn], nodes[nn]);
287 CHKERR moab_ref.create_element(MBTRI, nodes, 3, tri);
290 CHKERR moab_ref.get_adjacencies(&tri, 1, 1,
true, edges,
291 moab::Interface::UNION);
296 CHKERR create_reference_element();
301 auto refine_ref_triangles = [
this, &m_field_ref, max_level]() {
306 m_field_ref.
getInterface<BitRefManager>()->setBitRefLevelByDim(
309 for (
int ll = 0; ll != max_level; ++ll) {
314 ->getEntitiesByTypeAndRefLevel(
BitRefLevel().set(ll),
318 ->getEntitiesByTypeAndRefLevel(
BitRefLevel().set(ll),
321 auto m_ref = m_field_ref.
getInterface<MeshRefinement>();
322 CHKERR m_ref->addVerticesInTheMiddleOfEdges(edges,
347 auto get_ref_gauss_pts_and_shape_functions = [
this, max_level, &moab_ref,
350 for (
int ll = 0; ll != max_level + 1; ++ll) {
354 m_field_ref.
getInterface<BitRefManager>()->getEntitiesByTypeAndRefLevel(
359 CHKERR moab_ref.create_meshset(MESHSET_SET, meshset);
360 CHKERR moab_ref.add_entities(meshset, tris);
361 CHKERR moab_ref.convert_entities(meshset,
true,
false,
false);
362 CHKERR moab_ref.delete_entities(&meshset, 1);
366 CHKERR moab_ref.get_connectivity(tris, elem_nodes,
false);
369 gauss_pts.resize(elem_nodes.size(), 3,
false);
370 std::map<EntityHandle, int> little_map;
371 Range::iterator nit = elem_nodes.begin();
372 for (
int gg = 0; nit != elem_nodes.end(); nit++, gg++) {
373 CHKERR moab_ref.get_coords(&*nit, 1, &gauss_pts(gg, 0));
374 little_map[*nit] = gg;
376 gauss_pts = trans(gauss_pts);
379 Range::iterator tit = tris.begin();
380 for (
int tt = 0; tit != tris.end(); ++tit, ++tt) {
383 CHKERR moab_ref.get_connectivity(*tit, conn, num_nodes,
false);
385 ref_tris.resize(tris.size(), num_nodes);
387 for (
int nn = 0; nn != num_nodes; ++nn) {
388 ref_tris(tt, nn) = little_map[conn[nn]];
393 shape_functions.resize(elem_nodes.size(), 3);
395 &gauss_pts(1, 0), elem_nodes.size());
404 CHKERR refine_ref_triangles();
405 CHKERR get_ref_gauss_pts_and_shape_functions();