20 #include "libmesh/elem.h" 22 #include "libmesh/boundary_info.h" 23 #include "libmesh/fe_type.h" 24 #include "libmesh/fe_interface.h" 25 #include "libmesh/node_elem.h" 26 #include "libmesh/edge_edge2.h" 27 #include "libmesh/edge_edge3.h" 28 #include "libmesh/edge_edge4.h" 29 #include "libmesh/edge_inf_edge2.h" 30 #include "libmesh/face_c0polygon.h" 31 #include "libmesh/face_tri3.h" 32 #include "libmesh/face_tri3_subdivision.h" 33 #include "libmesh/face_tri3_shell.h" 34 #include "libmesh/face_tri6.h" 35 #include "libmesh/face_tri7.h" 36 #include "libmesh/face_quad4.h" 37 #include "libmesh/face_quad4_shell.h" 38 #include "libmesh/face_quad8.h" 39 #include "libmesh/face_quad8_shell.h" 40 #include "libmesh/face_quad9.h" 41 #include "libmesh/face_quad9_shell.h" 42 #include "libmesh/face_inf_quad4.h" 43 #include "libmesh/face_inf_quad6.h" 44 #include "libmesh/cell_tet4.h" 45 #include "libmesh/cell_tet10.h" 46 #include "libmesh/cell_tet14.h" 47 #include "libmesh/cell_hex8.h" 48 #include "libmesh/cell_hex20.h" 49 #include "libmesh/cell_hex27.h" 50 #include "libmesh/cell_inf_hex8.h" 51 #include "libmesh/cell_inf_hex16.h" 52 #include "libmesh/cell_inf_hex18.h" 53 #include "libmesh/cell_prism6.h" 54 #include "libmesh/cell_prism15.h" 55 #include "libmesh/cell_prism18.h" 56 #include "libmesh/cell_prism20.h" 57 #include "libmesh/cell_prism21.h" 58 #include "libmesh/cell_inf_prism6.h" 59 #include "libmesh/cell_inf_prism12.h" 60 #include "libmesh/cell_pyramid5.h" 61 #include "libmesh/cell_pyramid13.h" 62 #include "libmesh/cell_pyramid14.h" 63 #include "libmesh/cell_pyramid18.h" 64 #include "libmesh/fe_base.h" 65 #include "libmesh/mesh_base.h" 66 #include "libmesh/quadrature_nodal.h" 67 #include "libmesh/quadrature_gauss.h" 68 #include "libmesh/remote_elem.h" 69 #include "libmesh/reference_elem.h" 70 #include "libmesh/enum_to_string.h" 71 #include "libmesh/threads.h" 72 #include "libmesh/enum_elem_quality.h" 73 #include "libmesh/enum_io_package.h" 74 #include "libmesh/enum_order.h" 75 #include "libmesh/elem_internal.h" 77 #ifdef LIBMESH_ENABLE_PERIODIC 78 #include "libmesh/mesh.h" 79 #include "libmesh/periodic_boundaries.h" 412 std::unique_ptr<Elem> returnval;
414 switch (this->
type())
417 returnval = std::make_unique<C0Polygon>(this->
n_sides());
424 returnval->set_id() = this->
id();
425 #ifdef LIBMESH_ENABLE_UNIQUE_ID 427 returnval->set_unique_id(this->
unique_id());
431 returnval->add_extra_integers(n_elem_ints);
432 for (
unsigned int i = 0; i != n_elem_ints; ++i)
433 returnval->set_extra_integer(i, this->get_extra_integer(i));
435 returnval->inherit_data_from(*
this);
449 return std::make_unique<NodeElem>(p);
453 return std::make_unique<Edge2>(p);
455 return std::make_unique<Edge3>(p);
457 return std::make_unique<Edge4>(p);
461 return std::make_unique<Tri3>(p);
463 return std::make_unique<TriShell3>(p);
465 return std::make_unique<Tri3Subdivision>(p);
467 return std::make_unique<Tri6>(p);
469 return std::make_unique<Tri7>(p);
471 return std::make_unique<Quad4>(p);
473 return std::make_unique<QuadShell4>(p);
475 return std::make_unique<Quad8>(p);
477 return std::make_unique<QuadShell8>(p);
479 return std::make_unique<Quad9>(p);
481 return std::make_unique<QuadShell9>(p);
485 return std::make_unique<C0Polygon>(6, p);
490 libmesh_not_implemented_msg
491 (
"Polyhedra cannot be built via Elem::build()");
495 return std::make_unique<Tet4>(p);
497 return std::make_unique<Tet10>(p);
499 return std::make_unique<Tet14>(p);
501 return std::make_unique<Hex8>(p);
503 return std::make_unique<Hex20>(p);
505 return std::make_unique<Hex27>(p);
507 return std::make_unique<Prism6>(p);
509 return std::make_unique<Prism15>(p);
511 return std::make_unique<Prism18>(p);
513 return std::make_unique<Prism20>(p);
515 return std::make_unique<Prism21>(p);
517 return std::make_unique<Pyramid5>(p);
519 return std::make_unique<Pyramid13>(p);
521 return std::make_unique<Pyramid14>(p);
523 return std::make_unique<Pyramid18>(p);
525 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 528 return std::make_unique<InfEdge2>(p);
532 return std::make_unique<InfQuad4>(p);
534 return std::make_unique<InfQuad6>(p);
538 return std::make_unique<InfHex8>(p);
540 return std::make_unique<InfHex16>(p);
542 return std::make_unique<InfHex18>(p);
544 return std::make_unique<InfPrism6>(p);
546 return std::make_unique<InfPrism12>(p);
575 #ifdef LIBMESH_ENABLE_DEPRECATED 579 <<
"Elem::centroid() has been deprecated. Replace with either " 580 <<
"Elem::vertex_average() to maintain existing behavior, or " 581 <<
"the more expensive Elem::true_centroid() " 582 <<
"in cases where the true 'geometric' centroid is required." 584 libmesh_deprecated();
588 #endif // LIBMESH_ENABLE_DEPRECATED 635 #ifdef LIBMESH_ENABLE_AMR 636 elem_copy->set_p_level(0);
641 elem_copy->set_node(n,
_nodes[n]);
643 return elem_copy->true_centroid();
654 fe->attach_quadrature_rule(&qrule);
657 const auto & JxW = fe->get_JxW();
658 const auto & phi = fe->get_phi();
665 libmesh_assert_equal_to(N, this->
n_nodes());
668 std::vector<Real> V(N);
671 V[i] += JxW[qp] * phi[i][qp];
679 cp += this->
point(i) * V[i];
693 cp.
add (this->point(n));
702 Real h_min=std::numeric_limits<Real>::max();
707 for (
unsigned int n_outer=0; n_outer<
n_vertices; n_outer++)
708 for (
unsigned int n_inner=n_outer+1; n_inner<
n_vertices; n_inner++)
710 const auto diff = (this->
point(n_outer) - this->
point(n_inner));
712 h_min = std::min(h_min, diff.norm_sq());
715 return std::sqrt(h_min);
727 for (
unsigned int n_outer=0; n_outer<
n_vertices; n_outer++)
728 for (
unsigned int n_inner=n_outer+1; n_inner<
n_vertices; n_inner++)
730 const auto diff = (this->
point(n_outer) - this->
point(n_inner));
732 h_max = std::max(h_max, diff.norm_sq());
735 return std::sqrt(h_max);
741 const unsigned int n2)
const 743 libmesh_assert_less ( n1, this->
n_vertices() );
744 libmesh_assert_less ( n2, this->
n_vertices() );
746 return (this->
point(n1) - this->
point(n2)).norm();
753 const unsigned short n_n = this->
n_nodes();
755 std::array<dof_id_type, Elem::max_n_nodes> node_ids;
757 for (
unsigned short n=0; n != n_n; ++n)
758 node_ids[n] = this->
node_id(n);
762 std::sort (node_ids.begin(), node_ids.begin()+n_n);
775 const unsigned short n_n = this->
n_nodes();
776 libmesh_assert_equal_to(n_n, rhs.
n_nodes());
780 std::array<dof_id_type, Elem::max_n_nodes> this_ids, rhs_ids;
782 for (
unsigned short n = 0; n != n_n; n++)
784 this_ids[n] = this->
node_id(n);
789 std::sort(this_ids.begin(), this_ids.begin()+n_n);
790 std::sort(rhs_ids.begin(), rhs_ids.begin()+n_n);
793 for (
unsigned short n = 0; n != n_n; ++n)
794 if (this_ids[n] != rhs_ids[n])
855 std::set<const Elem *> point_neighbors;
859 for (
const auto & elem : point_neighbors)
860 if (elem->processor_id() == my_pid)
872 const unsigned int ns = this->
n_sides();
873 const unsigned int nn = this->
n_nodes();
875 const unsigned int en = e->
n_nodes();
878 std::vector<bool> might_be_side(ns,
true);
880 for (
unsigned int i=0; i != en; ++i)
889 for (
unsigned int j=0; j != nn; ++j)
890 if (this->
point(j) == side_point)
900 for (
unsigned int s=0; s != ns; ++s)
902 might_be_side[s] =
false;
905 for (
unsigned int s=0; s != ns; ++s)
906 if (might_be_side[s])
909 for (
unsigned int s2=s+1; s2 < ns; ++s2)
921 #ifdef LIBMESH_ENABLE_DEPRECATED 923 unsigned int side_node)
const 925 libmesh_deprecated();
928 #endif // LIBMESH_ENABLE_DEPRECATED 936 const unsigned int my_nv = this->
n_vertices();
944 if (&this->
node_ref(my_n) == vertex)
951 const unsigned int l = this->
level();
952 const unsigned int el = e->
level();
972 unsigned int num_contained_edges = 0;
979 num_contained_edges++;
980 if (num_contained_edges>=2)
992 std::set<const Elem *> & neighbor_set)
const 997 neighbor_set.clear();
998 neighbor_set.insert(
this);
1000 std::set<const Elem *> untested_set, next_untested_set;
1001 untested_set.insert(
this);
1003 #ifdef LIBMESH_ENABLE_AMR 1004 std::vector<const Elem *> active_neighbor_children;
1005 #endif // #ifdef LIBMESH_ENABLE_AMR 1007 while (!untested_set.empty())
1011 for (
const auto & elem : untested_set)
1012 for (
auto current_neighbor : elem->neighbor_ptr_range())
1014 if (current_neighbor &&
1017 if (current_neighbor->active())
1019 auto it = neighbor_set.lower_bound(current_neighbor);
1020 if ((it == neighbor_set.end() || *it != current_neighbor) &&
1021 current_neighbor->contains_point(p))
1024 next_untested_set.insert(current_neighbor);
1025 neighbor_set.emplace_hint(it, current_neighbor);
1028 #ifdef LIBMESH_ENABLE_AMR 1032 active_neighbor_children.clear();
1033 current_neighbor->active_family_tree_by_neighbor
1034 (active_neighbor_children, elem);
1036 for (
const auto & current_child : active_neighbor_children)
1038 auto it = neighbor_set.lower_bound(current_child);
1039 if ((it == neighbor_set.end() || *it != current_child) &&
1040 current_child->contains_point(p))
1043 next_untested_set.insert(current_child);
1044 neighbor_set.emplace_hint(it, current_child);
1048 #endif // #ifdef LIBMESH_ENABLE_AMR 1051 untested_set.swap(next_untested_set);
1052 next_untested_set.clear();
1066 const Elem * start_elem)
const 1083 std::set<const Elem *> & neighbor_set)
const 1092 std::set<const Elem *>::iterator it = neighbor_set.begin();
1093 const std::set<const Elem *>::iterator end = neighbor_set.end();
1099 if (!(*it)->contains_point(p2))
1100 it = neighbor_set.erase(it);
1110 neighbor_set.clear();
1111 neighbor_set.insert(
this);
1113 std::set<const Elem *> untested_set, next_untested_set;
1114 untested_set.insert(
this);
1116 while (!untested_set.empty())
1120 for (
const auto & elem : untested_set)
1122 for (
auto current_neighbor : elem->neighbor_ptr_range())
1124 if (current_neighbor &&
1127 if (current_neighbor->active())
1130 || current_neighbor->contains_edge_of(
this))
1133 if (!neighbor_set.count(current_neighbor))
1134 next_untested_set.insert (current_neighbor);
1137 neighbor_set.insert (current_neighbor);
1140 #ifdef LIBMESH_ENABLE_AMR 1144 std::vector<const Elem *> active_neighbor_children;
1146 current_neighbor->active_family_tree_by_neighbor
1147 (active_neighbor_children, elem);
1149 for (
const auto & current_child : active_neighbor_children)
1150 if (this->
contains_edge_of(current_child) || current_child->contains_edge_of(
this))
1153 if (!neighbor_set.count(current_child))
1154 next_untested_set.insert (current_child);
1156 neighbor_set.insert (current_child);
1159 #endif // #ifdef LIBMESH_ENABLE_AMR 1163 untested_set.swap(next_untested_set);
1164 next_untested_set.clear();
1187 if (this->
dim() >= LIBMESH_DIM)
1208 (interior_p->
dim() > this->
dim()));
1221 (this->
level() == 0 &&
1232 if (this->
dim() >= LIBMESH_DIM)
1239 (interior_p->
dim() > this->
dim()));
1250 this->
dim() < LIBMESH_DIM);
1260 (p->
dim() > this->
dim()));
1267 #ifdef LIBMESH_ENABLE_PERIODIC 1277 if (neighbor_i !=
nullptr)
1285 std::vector<boundary_id_type> bc_ids;
1286 mesh.get_boundary_info().boundary_ids(
this, cast_int<unsigned short>(i), bc_ids);
1287 for (
const auto &
id : bc_ids)
1293 const Elem *
const cn = pb->
neighbor(
id, point_locator,
this, i);
1294 neighbor_i =
const_cast<Elem *
>(cn);
1301 neighbor_i = neighbor_i->
parent();
1319 if (neighbor_i !=
nullptr)
1327 std::vector<boundary_id_type> bc_ids;
1328 mesh.get_boundary_info().boundary_ids(
this, cast_int<unsigned short>(i), bc_ids);
1329 for (
const auto &
id : bc_ids)
1332 neighbor_i = pb->
neighbor(
id, point_locator,
this, i);
1339 neighbor_i = neighbor_i->
parent();
1397 const Elem * elem =
this;
1405 for (elem =
this; !elem->active();
1406 elem = elem->parent())
1419 elem = elem->parent();
1427 for (; elem != nn; elem = elem->
parent())
1443 (my_parent->
dim() == this->
dim()))
1462 libmesh_assert_less_equal (neigh->
level(), this->
level());
1491 std::vector<Elem *> neigh_family;
1492 #ifdef LIBMESH_ENABLE_AMR 1497 neigh_family.push_back(neigh);
1500 for (
auto & neigh_family_member : neigh_family)
1503 if (this->
subactive() && !neigh_family_member->subactive())
1513 #ifdef LIBMESH_ENABLE_AMR 1515 (neigh_family_member->neighbor_ptr(nn)->active() ||
1516 neigh_family_member->neighbor_ptr(nn)->is_ancestor_of(
this))) ||
1517 (neigh_family_member->neighbor_ptr(nn) ==
remote_elem) ||
1519 (this->
parent() !=
nullptr) &&
1520 (neigh_family_member->neighbor_ptr(nn) == this->
parent())));
1522 libmesh_assert((neigh_family_member->neighbor_ptr(nn) ==
this) ||
1523 (neigh_family_member->neighbor_ptr(nn) ==
remote_elem));
1526 neigh_family_member->set_neighbor(nn,
this);
1536 #if defined(LIBMESH_ENABLE_AMR) && defined(DEBUG) 1549 libmesh_assert_greater_equal (this->
level(), neigh->level());
1551 if (this->
level() == neigh->level() &&
1552 neigh->has_neighbor(
this))
1554 #ifdef LIBMESH_ENABLE_AMR 1557 std::vector<Elem *> family;
1558 neigh->total_family_tree_by_neighbor (family,
this);
1562 for (
auto & n : family)
1567 unsigned int my_s = n->which_neighbor_am_i(
this);
1568 libmesh_assert_less (my_s, n->n_neighbors());
1569 libmesh_assert_equal_to (n->neighbor_ptr(my_s),
this);
1570 n->set_neighbor(my_s, const_cast<RemoteElem *>(
remote_elem));
1573 unsigned int my_s = neigh->which_neighbor_am_i(
this);
1574 libmesh_assert_less (my_s, neigh->n_neighbors());
1575 libmesh_assert_equal_to (neigh->neighbor_ptr(my_s),
this);
1576 neigh->set_neighbor(my_s, const_cast<RemoteElem *>(
remote_elem));
1579 #ifdef LIBMESH_ENABLE_AMR 1582 else if (neigh->has_children())
1593 while (!neigh->has_neighbor(my_ancestor))
1595 my_ancestor = my_ancestor->parent();
1601 std::vector<Elem *> family;
1602 neigh->total_family_tree_by_subneighbor (family, my_ancestor,
this);
1604 for (
auto & n : family)
1609 unsigned int my_s = n->which_neighbor_am_i(
this);
1610 libmesh_assert_less (my_s, n->n_neighbors());
1611 libmesh_assert_equal_to (n->neighbor_ptr(my_s),
this);
1613 n->set_neighbor(my_s, const_cast<RemoteElem *>(
remote_elem));
1620 #ifdef LIBMESH_ENABLE_AMR 1627 this->
dim() == my_parent->
dim())
1630 libmesh_assert_equal_to (my_parent->
child_ptr(me),
this);
1642 #ifdef LIBMESH_ENABLE_AMR 1653 libmesh_assert_greater_equal (this->
level(), neigh->level());
1655 if (this->
level() == neigh->level() &&
1656 neigh->has_neighbor(
this))
1658 #ifdef LIBMESH_ENABLE_AMR 1661 std::vector<Elem *> family;
1662 neigh->total_family_tree_by_neighbor (family,
this);
1664 for (
auto & n : family)
1669 unsigned int my_s = n->which_neighbor_am_i(
this);
1670 libmesh_assert_less (my_s, n->n_neighbors());
1671 libmesh_assert_equal_to (n->neighbor_ptr(my_s),
this);
1672 n->set_neighbor(my_s,
nullptr);
1675 unsigned int my_s = neigh->which_neighbor_am_i(
this);
1676 libmesh_assert_less (my_s, neigh->n_neighbors());
1677 libmesh_assert_equal_to (neigh->neighbor_ptr(my_s),
this);
1678 neigh->set_neighbor(my_s,
nullptr);
1681 #ifdef LIBMESH_ENABLE_AMR 1684 else if (neigh->has_children())
1695 while (!neigh->has_neighbor(my_ancestor))
1697 my_ancestor = my_ancestor->parent();
1703 std::vector<Elem *> family;
1704 neigh->total_family_tree_by_subneighbor (family, my_ancestor,
this);
1706 for (
auto & n : family)
1711 unsigned int my_s = n->which_neighbor_am_i(
this);
1712 libmesh_assert_less (my_s, n->n_neighbors());
1713 libmesh_assert_equal_to (n->neighbor_ptr(my_s),
this);
1714 n->set_neighbor(my_s,
nullptr);
1721 #ifdef LIBMESH_ENABLE_AMR 1742 std::vector<dof_id_type> conn;
1747 std::copy(conn.begin(),
1749 std::ostream_iterator<dof_id_type>(out_stream,
" "));
1759 out_stream << this->
node_id(i)+1 <<
"\t";
1766 libmesh_error_msg(
"Unsupported IO package " << iop);
1780 if (this->
dim() < 2)
1783 std::vector<Real> edge_lengths(this->
n_edges());
1789 std::minmax_element(edge_lengths.begin(), edge_lengths.end());
1802 if (this->
dim() < 2)
1806 Real min_angle = std::numeric_limits<Real>::max();
1807 Real max_angle = -std::numeric_limits<Real>::max();
1817 auto N = adjacent_edge_ids.size();
1822 for (
unsigned int first = 0; first < N-1; ++first)
1823 for (
unsigned int second = first+1; second < N; ++second)
1826 auto first_edge = adjacent_edge_ids[first];
1827 auto second_edge = adjacent_edge_ids[second];
1836 if (first_edge_node_0 != n)
1837 std::swap(first_edge_node_0, first_edge_node_1);
1838 if (second_edge_node_0 != n)
1839 std::swap(second_edge_node_0, second_edge_node_1);
1841 libmesh_assert_equal_to(first_edge_node_0, n);
1842 libmesh_assert_equal_to(second_edge_node_0, n);
1846 first_ev = this->
point(first_edge_node_1) - this->
point(first_edge_node_0),
1847 second_ev = this->
point(second_edge_node_1) - this->
point(second_edge_node_0);
1850 Real theta = std::acos(first_ev.
unit() * second_ev.
unit());
1853 min_angle = std::min(theta, min_angle);
1854 max_angle = std::max(theta, max_angle);
1866 if (this->
dim() < 3)
1870 Real min_angle = std::numeric_limits<Real>::max();
1871 Real max_angle = -std::numeric_limits<Real>::max();
1890 libmesh_assert_equal_to(adjacent_side_ids.size(), 2);
1893 const auto side_0_node_ids = this->
nodes_on_side(adjacent_side_ids[0]);
1894 const auto side_1_node_ids = this->
nodes_on_side(adjacent_side_ids[1]);
1897 libmesh_assert_greater_equal(side_0_node_ids.size(), 3);
1898 libmesh_assert_greater_equal(side_1_node_ids.size(), 3);
1901 const auto side_0_normal =
1902 (this->
point(side_0_node_ids[2]) - this->
point(side_0_node_ids[0])).cross
1903 (this->
point(side_0_node_ids[1]) - this->
point(side_0_node_ids[0])).unit();
1904 const auto side_1_normal =
1905 (this->
point(side_1_node_ids[2]) - this->
point(side_1_node_ids[0])).cross
1906 (this->
point(side_1_node_ids[1]) - this->
point(side_1_node_ids[0])).unit();
1913 Real theta = std::acos(std::abs(side_0_normal * side_1_normal));
1916 min_angle = std::min(theta, min_angle);
1917 max_angle = std::max(theta, max_angle);
1929 const auto N = this->
dim();
1934 Real min_node_area = std::numeric_limits<Real>::max();
1949 if (adjacent_edge_ids.size() != N)
1953 std::vector<Point> oriented_edges(N);
1959 std::swap(node_0, node_1);
1960 oriented_edges[i] = this->
point(node_1) - this->
point(node_0);
1967 Real node_area = (N == 2) ?
1968 cross_norm(oriented_edges[0], oriented_edges[1]) :
1969 std::abs(
triple_product(oriented_edges[0], oriented_edges[1], oriented_edges[2]));
1977 Real len_i = oriented_edges[i].norm();
1978 node_area = (len_i == 0.) ? 0. : (node_area / len_i);
1982 min_node_area = std::min(node_area, min_node_area);
1985 return min_node_area;
1991 libmesh_do_once( libmesh_here();
1995 <<
" not implemented on element type " 2010 #ifdef LIBMESH_ENABLE_AMR 2013 const bool is_ancestor =
2040 #ifdef LIBMESH_ENABLE_AMR 2048 _children = std::make_unique<Elem *[]>(nc);
2050 for (
unsigned int c = 0; c != nc; c++)
2054 for (
unsigned int c = 0; c != nc; c++)
2058 libmesh_assert_equal_to (
this, elem->
parent());
2064 libmesh_error_msg(
"Error: Tried to add a child to an element with full children array");
2074 _children = std::make_unique<Elem *[]>(nc);
2076 for (
unsigned int i = 0; i != nc; i++)
2184 const Elem * neighbor,
2202 const Elem * neighbor,
2220 const Elem * neighbor,
2221 const Elem * subneighbor,
2240 const Elem * neighbor,
2241 const Elem * subneighbor,
2260 const Elem * neighbor,
2278 const Elem * neighbor,
2285 mesh, point_locator, pb,
2299 mesh, point_locator, pb,
2305 const unsigned int e)
const 2308 libmesh_assert_less (e, this->
n_edges());
2315 return (child_edge->node_id(0) == my_edge->node_id(0) ||
2316 child_edge->node_id(1) == my_edge->node_id(1));
2322 unsigned int current_min)
const 2329 return std::min(current_min, this->
p_level());
2336 if (current_min <= this->
p_level())
2339 unsigned int min_p_level = current_min;
2344 c.min_p_level_by_neighbor(neighbor_in, min_p_level);
2351 unsigned int current_min)
const 2359 unsigned int new_p_level = this->
p_level();
2364 libmesh_assert_greater (new_p_level, 0);
2367 return std::min(current_min, new_p_level);
2372 unsigned int min_p_level = current_min;
2377 c.min_new_p_level_by_neighbor(neighbor_in, min_p_level);
2385 unsigned int child_node)
const 2388 libmesh_assert_less(child, nc);
2392 std::vector<std::vector<std::vector<signed char>>> &
2401 if (em_vers >= cached_parent_indices.size())
2402 cached_parent_indices.resize(em_vers+1);
2404 if (child >= cached_parent_indices[em_vers].size())
2406 const signed char nn = cast_int<signed char>(this->
n_nodes());
2408 cached_parent_indices[em_vers].resize(nc);
2410 for (
unsigned int c = 0; c != nc; ++c)
2413 cached_parent_indices[em_vers][c].resize(ncn);
2414 for (
unsigned int cn = 0; cn != ncn; ++cn)
2416 for (
signed char n = 0; n != nn; ++n)
2422 cached_parent_indices[em_vers][c][cn] = n;
2428 cached_parent_indices[em_vers][c][cn] =
2435 libmesh_assert_not_equal_to (n+1, nn);
2441 const signed char cache_val =
2442 cached_parent_indices[em_vers][child][child_node];
2443 if (cache_val == -1)
2446 return cached_parent_indices[em_vers][child][child_node];
2451 const std::vector<std::pair<unsigned char, unsigned char>> &
2453 unsigned int child_node)
const 2457 std::vector<std::vector<std::vector<std::vector<std::pair<unsigned char, unsigned char>>>>> &
2466 if (cached_bracketing_nodes.size() <= em_vers)
2467 cached_bracketing_nodes.resize(em_vers+1);
2473 if (cached_bracketing_nodes[em_vers].size() < nc)
2484 libmesh_assert_equal_to
2491 std::unique_ptr<Elem> full_elem =
Elem::build(full_type);
2496 libmesh_assert_equal_to(em_vers, 0);
2502 full_elem->parent_bracketing_nodes(0,0);
2511 cached_bracketing_nodes =
2512 full_elem->_get_bracketing_node_cache();
2515 return cached_bracketing_nodes[em_vers][child][child_node];
2518 cached_bracketing_nodes[em_vers].resize(nc);
2520 const unsigned int nn = this->
n_nodes();
2523 for (
unsigned int c = 0; c != nc; ++c)
2527 cached_bracketing_nodes[em_vers][c].resize(ncn);
2530 for (
unsigned int n = 0; n != ncn; ++n)
2536 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
2545 for (
unsigned int pn = 0; pn != nn; ++pn)
2550 libmesh_assert_not_equal_to (em_val, 1);
2557 for (
unsigned int n1 = 0; n1 != ncn; ++n1)
2562 unsigned int parent_n1 =
2570 for (
unsigned int n2 = n1+1; n2 < nn; ++n2)
2575 unsigned int parent_n2 =
2583 Point pmid = (p1 + p2)/2;
2585 if (pmid == bracketed_pt)
2587 cached_bracketing_nodes[em_vers][c][n].emplace_back(parent_n1, parent_n2);
2608 for (
unsigned int pn = 0; pn != nn; ++pn)
2613 libmesh_assert_not_equal_to (em_val, 1);
2622 for (
unsigned int n1 = 0; n1 != nn; ++n1)
2624 if (n1 == parent_node)
2629 for (
unsigned int n2 = n1+1; n2 < nn; ++n2)
2631 if (n2 == parent_node)
2636 if (pmid == bracketed_pt)
2638 cached_bracketing_nodes[em_vers][c][n].emplace_back(n1, n2);
2650 return cached_bracketing_nodes[em_vers][child][child_node];
2654 const std::vector<std::pair<dof_id_type, dof_id_type>>
2656 unsigned int child_node)
const 2658 std::vector<std::pair<dof_id_type, dof_id_type>> returnval;
2660 const std::vector<std::pair<unsigned char, unsigned char>> & pbc =
2663 for (
const auto & pb : pbc)
2665 const unsigned short n_n = this->
n_nodes();
2666 if (pb.first < n_n && pb.second < n_n)
2667 returnval.emplace_back(this->
node_id(pb.first), this->node_id(pb.second));
2672 libmesh_assert_not_equal_to
2675 libmesh_assert_equal_to
2684 std::unique_ptr<Elem> full_elem =
Elem::build(full_type);
2694 for (
unsigned int c=0; c <= child; ++c)
2702 if (c == child && n == child_node)
2705 if (pb.first == full_elem->as_parent_node(c,n))
2714 if (pb.second == full_elem->as_parent_node(c,n))
2744 returnval.emplace_back(pt1, pt2);
2750 #endif // #ifdef LIBMESH_ENABLE_AMR 2765 <<
"WARNING: Resizing bounding box to match user-specified tolerance!\n" 2766 <<
"In the future, calls to Elem::contains_point() with tol > TOLERANCE\n" 2767 <<
"will be more optimized, but should not be used\n" 2768 <<
"to search for points 'close to' elements!\n" 2769 <<
"Instead, use Elem::close_to_point() for this purpose.\n" 2794 libmesh_assert_greater (box_tol, 0.);
2795 libmesh_assert_greater (map_tol, 0.);
2805 point_above_min_z =
false,
2806 point_below_max_z =
false,
2809 point_above_min_y =
false,
2810 point_below_max_y =
false,
2812 point_above_min_x =
false,
2813 point_below_max_x =
false;
2820 point_above_min_x = point_above_min_x || (n(0) - my_hmax*box_tol <= p(0));
2821 point_below_max_x = point_below_max_x || (n(0) + my_hmax*box_tol >= p(0));
2823 point_above_min_y = point_above_min_y || (n(1) - my_hmax*box_tol <= p(1));
2824 point_below_max_y = point_below_max_y || (n(1) + my_hmax*box_tol >= p(1));
2827 point_above_min_z = point_above_min_z || (n(2) - my_hmax*box_tol <= p(2));
2828 point_below_max_z = point_below_max_z || (n(2) + my_hmax*box_tol >= p(2));
2834 !point_above_min_z ||
2835 !point_below_max_z ||
2838 !point_above_min_y ||
2839 !point_below_max_y ||
2841 !point_above_min_x ||
2862 if (this->
dim() < 3)
2875 if (dist > this->
hmax() * map_tol)
2893 qnodal.allow_nodal_pyramid_quadrature =
true;
2895 auto & qp = qnodal.get_points();
2896 libmesh_assert_equal_to(qp.size(), this->
n_nodes());
2898 std::vector<Point> one_point(1);
2899 std::vector<Real> one_weight(1,1);
2905 one_point[0] = qp[i];
2929 std::ostringstream oss;
2931 oss <<
" Elem Information" <<
'\n' 2939 #ifdef LIBMESH_ENABLE_UNIQUE_ID 2940 oss <<
", unique_id()=";
2948 oss <<
", processor_id()=" << this->
processor_id() <<
'\n';
2951 <<
" dim()=" << this->
dim() <<
'\n' 2952 <<
" n_nodes()=" << this->
n_nodes() <<
'\n';
2958 oss <<
" " << n << this->
node_ref(n);
2961 const unsigned char datum_index = this->
mapping_data();
2962 oss <<
" weight=" <<
2967 oss <<
" n_sides()=" << this->
n_sides() <<
'\n';
2971 oss <<
" neighbor(" << s <<
")=";
2980 oss <<
" hmin()=" << this->
hmin()
2981 <<
", hmax()=" << this->
hmax() <<
'\n' 2982 <<
" volume()=" << this->
volume() <<
'\n';
2984 oss <<
" active()=" << this->
active()
2985 <<
", ancestor()=" << this->
ancestor()
2986 <<
", subactive()=" << this->
subactive()
2990 oss << this->
parent()->
id() <<
'\n';
2993 oss <<
" level()=" << this->
level()
2994 <<
", p_level()=" << this->
p_level() <<
'\n' 2995 #ifdef LIBMESH_ENABLE_AMR 2999 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 3000 <<
" infinite()=" << this->
infinite() <<
'\n';
3002 oss <<
" origin()=" << this->
origin() <<
'\n' 3010 oss <<
'(' << s <<
'/' << v <<
'/' << this->
dof_number(s,v,c) <<
") ";
3025 if (current_neighbor && current_neighbor !=
remote_elem)
3030 if (current_neighbor->
level() == this->
level())
3033 libmesh_assert_less (w_n_a_i, current_neighbor->
n_neighbors());
3053 const unsigned int)
const 3061 std::pair<unsigned short int, unsigned short int>
3065 return std::pair<unsigned short int, unsigned short int>(0,0);
3114 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 3140 const bool full_ordered)
3266 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 3315 libmesh_error_msg(
"No second order equivalent element type for et = " 3383 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 3402 #endif // LIBMESH_ENABLE_INFINITE_ELEMENTS 3407 libmesh_error_msg(
"No complete order equivalent element type for et = " 3447 fe->get_fe_map().set_jacobian_tolerance(std::numeric_limits<Real>::lowest());
3449 const std::vector<Real> & JxW = fe->get_JxW();
3455 fe->attach_quadrature_rule(&qrule);
3460 for (
auto jxw : JxW)
3474 unsigned int n_points = this->
n_nodes();
3475 for (
unsigned int p=0; p != n_points; ++p)
3476 for (
unsigned d=0; d<LIBMESH_DIM; ++d)
3479 if (pmin(d) > pt(d))
3482 if (pmax(d) < pt(d))
3492 unsigned int dim = this->
dim();
3493 const std::unique_ptr<const Elem> face = this->
build_side_ptr(s);
3494 std::unique_ptr<libMesh::FEBase> fe(
3496 const std::vector<Point> & normals = fe->get_normals();
3497 std::vector<Point> ref_side_vertex_average_v = {face->reference_elem()->vertex_average()};
3498 fe->reinit(
this, s,
TOLERANCE, &ref_side_vertex_average_v);
3503 unsigned int n)
const 3505 #ifdef LIBMESH_ENABLE_AMR 3507 unsigned int my_n_vertices = this->
n_vertices();
3508 for (
unsigned int n_parent = 0; n_parent != my_n_vertices;
3518 libmesh_error_msg(
"ERROR: AMR disabled, how did we get here?");
3529 libmesh_not_implemented();
3535 const unsigned int )
const 3538 libmesh_not_implemented();
3544 libmesh_assert_less (side, this->
n_sides());
3553 std::vector<boundary_id_type> ids1, ids2;
3559 boundary_info->
add_side(
this, s2, ids1);
3561 boundary_info->
add_side(
this, s1, ids2);
3569 std::vector<boundary_id_type> ids1, ids2;
3575 boundary_info->
add_edge(
this, e2, ids1);
3577 boundary_info->
add_edge(
this, e1, ids2);
3583 switch (this->
dim())
3598 libmesh_error_msg(
"impossible element dimension " << std::to_string(this->
dim()));
3606 libmesh_assert_less (i, this->
n_edges());
3615 libmesh_assert_less (i, this->
n_faces());
3621 const unsigned int N = side_i->n_sides();
3623 const std::vector<unsigned int> nodes = this->
nodes_on_side(i);
3625 auto cmp = [&](
const unsigned int & m,
const unsigned int & n) ->
bool 3629 std::min_element(nodes.begin(), nodes.begin() + N, cmp));
3631 return cmp(nodes[(V + N - 1) % N], nodes[(V + 1) % N]);
virtual Point true_centroid() const
void active_family_tree_by_topological_neighbor(std::vector< const Elem *> &family, const Elem *neighbor, const MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb, bool reset=true) const
Same as the active_family_tree_by_neighbor() member, but the neighbor here may be a topological (e...
class FEType hides (possibly multiple) FEFamily and approximation orders, thereby enabling specialize...
bool has_neighbor(const Elem *elem) const
unsigned char mapping_data() const
virtual bool is_vertex_on_parent(unsigned int c, unsigned int n) const
static const Order type_to_default_order_map[INVALID_ELEM]
This array maps the integer representation of the ElemType enum to the default approximation order of...
RefinementState refinement_flag() const
ElemType
Defines an enum for geometric element types.
void swap2boundaryedges(unsigned short e1, unsigned short e2, BoundaryInfo *boundary_info) const
Swaps two edges in boundary_info, if it is non-null.
void total_family_tree(T elem, std::vector< T > &family, bool reset)
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
void write_connectivity(std::ostream &out, const IOPackage iop) const
Writes the element connectivity for various IO packages to the passed ostream "out".
const Elem * parent() const
void add_scaled(const TypeVector< T2 > &, const T &)
Add a scaled value to this vector without creating a temporary.
virtual const std::vector< std::pair< dof_id_type, dof_id_type > > bracketing_nodes(unsigned int c, unsigned int n) const
Order
defines an enum for polynomial orders.
void print_info(std::ostream &os=libMesh::out) const
Prints relevant information about the element.
void active_family_tree_by_side(std::vector< const Elem *> &family, unsigned int side, bool reset=true) const
Same as the active_family_tree() member, but only adds elements which are next to side...
void remove_edge(const Elem *elem, const unsigned short int edge)
Removes all boundary conditions associated with edge edge of element elem, if any exist...
A Node is like a Point, but with more information.
Node ** _nodes
Pointers to the nodes we are connected to.
virtual std::vector< unsigned int > sides_on_edge(const unsigned int) const =0
static ElemType complete_order_equivalent_type(const ElemType et)
virtual Point origin() const
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
unsigned int n_comp(const unsigned int s, const unsigned int var) const
virtual void compute_map(const unsigned int dim, const std::vector< Real > &qw, const Elem *elem, bool calculate_d2phi)
Compute the jacobian and some other additional data fields.
std::string get_info() const
Prints relevant information about the element to a string.
static const unsigned int type_to_n_sides_map[INVALID_ELEM]
This array maps the integer representation of the ElemType enum to the number of sides on the element...
void find_interior_neighbors(T this_elem, std::set< T > &neighbor_set)
const Elem * interior_parent() const
const Elem * topological_neighbor(const unsigned int i, const MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb) const
virtual bool is_face(const unsigned int i) const =0
bool is_semilocal(const processor_id_type my_pid) const
void total_family_tree_by_neighbor(T elem, std::vector< T > &family, T neighbor_in, bool reset=true)
This class implements nodal quadrature rules for various element types.
IntRange< unsigned short > side_index_range() const
void libmesh_assert_valid_node_pointers() const
Checks for a valid id and pointers to nodes with valid ids on this element.
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int i)=0
void active_family_tree_by_neighbor(T elem, std::vector< T > &family, T neighbor_in, bool reset=true)
virtual dof_id_type key() const
static constexpr Real TOLERANCE
static Point inverse_map(const unsigned int dim, const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true, const bool extra_checks=true)
void active_family_tree(T elem, std::vector< T > &active_family, bool reset=true)
We're using a class instead of a typedef to allow forward declarations and future flexibility...
virtual unsigned int embedding_matrix_version() const
unsigned int which_side_am_i(const Elem *e) const
This function tells you which side the boundary element e is.
T cross_norm(const TypeVector< T > &b, const TypeVector< T > &c)
Calls cross_norm_sq() and takes the square root of the result.
RefinementState p_refinement_flag() const
IOPackage
libMesh interfaces with several different software packages for the purposes of creating, reading, and writing mesh files.
void find_interior_neighbors(std::set< const Elem *> &neighbor_set) const
This function finds all active elements (not including this one) in the parent manifold of this eleme...
static const unsigned int type_to_dim_map[INVALID_ELEM]
This array maps the integer representation of the ElemType enum to the geometric dimension of the ele...
void family_tree_by_subneighbor(std::vector< const Elem *> &family, const Elem *neighbor, const Elem *subneighbor, bool reset=true) const
Same as the family_tree() member, but only adds elements which are next to subneighbor.
Threads::spin_mutex parent_indices_mutex
void active_family_tree_by_side(T elem, std::vector< T > &family, unsigned int side, bool reset=true)
void family_tree(std::vector< const Elem *> &family, bool reset=true) const
Fills the vector family with the children of this element, recursively.
This is the base class from which all geometric element types are derived.
PeriodicBoundaryBase * boundary(boundary_id_type id)
void add_child(Elem *elem)
Adds a child pointer to the array of children of this element.
virtual BoundingBox loose_bounding_box() const
virtual bool on_reference_element(const Point &p, const Real eps=TOLERANCE) const =0
unsigned int min_new_p_level_by_neighbor(const Elem *neighbor, unsigned int current_min) const
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const =0
void active_family_tree(std::vector< const Elem *> &active_family, bool reset=true) const
Same as the family_tree() member, but only adds the active children.
unique_id_type unique_id() const
void swap2boundarysides(unsigned short s1, unsigned short s2, BoundaryInfo *boundary_info) const
Swaps two sides in boundary_info, if it is non-null.
Order default_quadrature_order() const
virtual unsigned int n_children() const =0
unsigned int p_level() const
void find_edge_neighbors(const Point &p1, const Point &p2, std::set< const Elem *> &neighbor_set) const
This function finds all active elements in the same manifold as this element which touch the current ...
side_iterator boundary_sides_end()
void boundary_ids(const Node *node, std::vector< boundary_id_type > &vec_to_fill) const
Fills a user-provided std::vector with the boundary ids associated with Node node.
void make_links_to_me_remote()
Resets this element's neighbors' appropriate neighbor pointers and its parent's and children's approp...
The libMesh namespace provides an interface to certain functionality in the library.
virtual Real hmax() const
Real distance(const Point &p)
unsigned int min_p_level_by_neighbor(const Elem *neighbor, unsigned int current_min) const
void set_interior_parent(Elem *p)
Sets the pointer to the element's interior_parent.
static const unsigned int type_to_n_nodes_map[INVALID_ELEM]
This array maps the integer representation of the ElemType enum to the number of nodes in the element...
bool contains_vertex_of(const Elem *e, bool mesh_connection=false) const
uint8_t processor_id_type
This is the MeshBase class.
SimpleRange< ChildRefIter > child_ref_range()
Returns a range with all children of a parent element, usable in range-based for loops.
void add(const TypeVector< T2 > &)
Add to this vector without creating a temporary.
bool has_topological_neighbor(const Elem *elem, const MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb) const
IntRange< unsigned short > edge_index_range() const
side_iterator boundary_sides_begin()
Iterator accessor functions.
virtual Real embedding_matrix(const unsigned int child_num, const unsigned int child_node_num, const unsigned int parent_node_num) const =0
uint32_t hashword(const uint32_t *k, size_t length, uint32_t initval=0)
The hashword function takes an array of uint32_t's of length 'length' and computes a single key from ...
T triple_product(const TypeVector< T > &a, const TypeVector< T > &b, const TypeVector< T > &c)
void family_tree_by_side(std::vector< const Elem *> &family, unsigned int side, bool reset=true) const
Same as the family_tree() member, but only adds elements which are next to side.
void replace_child(Elem *elem, unsigned int c)
Replaces the child pointer at the specified index in the child array.
void total_family_tree_by_subneighbor(std::vector< const Elem *> &family, const Elem *neighbor, const Elem *subneighbor, bool reset=true) const
Same as the family_tree_by_subneighbor() member, but also adds any subactive descendants.
TypeVector< T > unit() const
void libmesh_ignore(const Args &...)
void remove_links_to_me()
Resets this element's neighbors' appropriate neighbor pointers and its parent's and children's approp...
virtual std::vector< std::vector< std::vector< signed char > > > & _get_parent_indices_cache() const
Elem subclasses which don't do their own child-to-parent node calculations will need to supply a stat...
virtual bool contains_point(const Point &p, Real tol=TOLERANCE) const
Real length(const unsigned int n1, const unsigned int n2) const
ElemMappingType mapping_type() const
void make_links_to_me_local(unsigned int n, unsigned int neighbor_side)
Resets the neighbor_side pointers of our nth neighbor (and its descendants, if appropriate) to point ...
const Node & node_ref(const unsigned int i) const
void family_tree_by_neighbor(T elem, std::vector< T > &family, T neighbor_in, bool reset=true)
virtual Real hmin() const
static constexpr dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
virtual unsigned int n_nodes() const =0
virtual unsigned int local_side_node(unsigned int side, unsigned int side_node) const =0
unsigned int which_node_am_i(unsigned int side, unsigned int side_node) const
This function is deprecated, call local_side_node(side, side_node) instead.
static const unsigned int type_to_n_edges_map[INVALID_ELEM]
This array maps the integer representation of the ElemType enum to the number of edges on the element...
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
bool contains_edge_of(const Elem *e) const
unsigned int which_neighbor_am_i(const Elem *e) const
This function tells you which neighbor e is.
virtual unsigned int as_parent_node(unsigned int c, unsigned int n) const
virtual std::vector< unsigned int > edges_adjacent_to_node(const unsigned int) const =0
static std::unique_ptr< Elem > build(const ElemType type, Elem *p=nullptr)
unsigned int n_systems() const
virtual unsigned int opposite_node(const unsigned int n, const unsigned int s) const
virtual std::pair< unsigned short int, unsigned short int > second_order_child_vertex(const unsigned int n) const
Elem ** _elemlinks
Pointers to this element's parent and neighbors, and for lower-dimensional elements' interior_parent...
void find_point_neighbors(const Point &p, std::set< const Elem *> &neighbor_set) const
This function finds all active elements (including this one) which are in the same manifold as this e...
virtual unsigned int local_edge_node(unsigned int edge, unsigned int edge_node) const =0
Similar to Elem::local_side_node(), but instead of a side id, takes an edge id and a node id on that ...
The definition of the struct used for iterating over sides.
bool point_test(const Point &p, Real box_tol, Real map_tol) const
Shared private implementation used by the contains_point() and close_to_point() routines.
static std::unique_ptr< FEGenericBase > build(const unsigned int dim, const FEType &type)
Builds a specific finite element type.
The BoundaryInfo class contains information relevant to boundary conditions including storing faces...
void family_tree(T elem, std::vector< T > &family, bool reset=true)
virtual Point side_vertex_average_normal(const unsigned int s) const
Threads::spin_mutex parent_bracketing_nodes_mutex
const Elem * reference_elem() const
void libmesh_assert_valid_neighbors() const
Checks for consistent neighbor links on this element.
virtual bool is_remote() const
const std::vector< Real > & get_jacobian() const
bool valid_unique_id() const
This is the base class for point locators.
virtual unsigned int n_edges() const =0
ElemQuality
Defines an enum for element quality metrics.
virtual std::unique_ptr< Elem > disconnected_clone() const
virtual unsigned int n_second_order_adjacent_vertices(const unsigned int n) const
bool absolute_fuzzy_equals(const TypeVector< T > &rhs, Real tol=TOLERANCE) const
bool positive_edge_orientation(const unsigned int i) const
void set_neighbor(const unsigned int i, Elem *n)
Assigns n as the neighbor.
static ElemType second_order_equivalent_type(const ElemType et, const bool full_ordered=true)
unsigned int which_child_am_i(const Elem *e) const
std::string enum_to_string(const T e)
void init_reference_to_physical_map(const std::vector< Point > &qp, const Elem *elem)
void active_family_tree_by_neighbor(std::vector< const Elem *> &family, const Elem *neighbor, bool reset=true) const
Same as the active_family_tree() member, but only adds elements which are next to neighbor...
void total_family_tree_by_neighbor(std::vector< const Elem *> &family, const Elem *neighbor, bool reset=true) const
Same as the family_tree_by_neighbor() member, but also adds any subactive descendants.
SimpleRange< NodeRefIter > node_ref_range()
Returns a range with all nodes of an element, usable in range-based for loops.
Defines a Cartesian bounding box by the two corner extremum.
virtual unsigned int n_sides() const =0
bool topologically_equal(const Elem &rhs) const
const Elem * neighbor_ptr(unsigned int i) const
void remove_side(const Elem *elem, const unsigned short int side)
Removes all boundary conditions associated with side side of element elem, if any exist...
void family_tree_by_subneighbor(T elem, std::vector< T > &family, T neighbor_in, T subneighbor, bool reset=true)
virtual bool close_to_point(const Point &p, Real tol) const
unsigned int level() const
virtual unsigned int n_vertices() const =0
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual std::unique_ptr< Elem > side_ptr(unsigned int i)=0
subdomain_id_type subdomain_id() const
virtual bool is_singular_node(unsigned int) const
virtual unsigned short dim() const =0
const Node * node_ptr(const unsigned int i) const
virtual bool is_vertex(const unsigned int i) const =0
static Point map(const unsigned int dim, const Elem *elem, const Point &reference_point)
virtual Point master_point(const unsigned int i) const =0
static std::unique_ptr< Elem > build_with_id(const ElemType type, dof_id_type id)
Calls the build() method above with a nullptr parent, and additionally sets the newly-created Elem's ...
unsigned int n_neighbors() const
virtual Real quality(const ElemQuality q) const
void add_side(const dof_id_type elem, const unsigned short int side, const boundary_id_type id)
Add side side of element number elem with boundary id id to the boundary information data structure...
virtual unsigned short int second_order_adjacent_vertex(const unsigned int n, const unsigned int v) const
virtual Real volume() const
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
const Elem * neighbor(boundary_id_type boundary_id, const PointLocatorBase &point_locator, const Elem *e, unsigned int side, unsigned int *neigh_side=nullptr) const
This class implements specific orders of Gauss quadrature.
void set_child(unsigned int c, Elem *elem)
Sets the pointer to the child for this element.
virtual void connectivity(const unsigned int sc, const IOPackage iop, std::vector< dof_id_type > &conn) const =0
unsigned int size() const
Alias for n_points() to enable use in index_range.
virtual bool has_invertible_map(Real tol=TOLERANCE *TOLERANCE) const
IntRange< unsigned short > node_index_range() const
bool positive_face_orientation(const unsigned int i) const
unsigned int n_extra_integers() const
Returns how many extra integers are associated to the DofObject.
virtual bool is_vertex_on_child(unsigned int, unsigned int n) const
void edge_boundary_ids(const Elem *const elem, const unsigned short int edge, std::vector< boundary_id_type > &vec_to_fill) const
void find_point_neighbors(T this_elem, std::set< T > &neighbor_set, T start_elem)
void nullify_neighbors()
Replaces this element with nullptr for all of its neighbors.
SimpleRange< NeighborPtrIter > neighbor_ptr_range()
Returns a range with all neighbors of an element, usable in range-based for loops.
virtual unsigned int n_faces() const =0
T get_extra_datum(const unsigned int index) const
Gets the value on this object of the extra datum associated with index, which should have been obtain...
virtual bool infinite() const =0
FEFamily
defines an enum for finite element families.
virtual unsigned int n_sub_elem() const =0
void total_family_tree(std::vector< const Elem *> &family, bool reset=true) const
Same as the family_tree() member, but also adds any subactive descendants.
void family_tree_by_neighbor(std::vector< const Elem *> &family, const Elem *neighbor, bool reset=true) const
Same as the family_tree() member, but only adds elements which are next to neighbor.
virtual std::unique_ptr< Elem > build_edge_ptr(const unsigned int i)=0
virtual Order default_order() const =0
virtual const std::vector< std::pair< unsigned char, unsigned char > > & parent_bracketing_nodes(unsigned int c, unsigned int n) const
virtual std::vector< std::vector< std::vector< std::vector< std::pair< unsigned char, unsigned char > > > > > & _get_bracketing_node_cache() const
Elem subclasses which don't do their own bracketing node calculations will need to supply a static ca...
virtual unsigned int opposite_side(const unsigned int s) const
void family_tree_by_side(T elem, std::vector< T > &family, unsigned int s, bool reset)
Class contained in FE that encapsulates mapping (i.e.
static ElemType first_order_equivalent_type(const ElemType et)
processor_id_type processor_id() const
virtual ElemType type() const =0
A Point defines a location in LIBMESH_DIM dimensional Real space.
dof_id_type node_id(const unsigned int i) const
const Point & point(const unsigned int i) const
virtual Point centroid() const
Calls Elem::vertex_average() for backwards compatibility.
bool operator==(const Elem &rhs) const
bool has_children() const
virtual unsigned int center_node_on_side(const unsigned short side) const
auto index_range(const T &sizable)
Helper function that returns an IntRange<std::size_t> representing all the indices of the passed-in v...
std::unique_ptr< Elem *[]> _children
unique_ptr to array of this element's children.
virtual bool is_child_on_edge(const unsigned int c, const unsigned int e) const
virtual bool is_edge(const unsigned int i) const =0
const Elem & get(const ElemType type_in)
void total_family_tree_by_subneighbor(T elem, std::vector< T > &family, T neighbor_in, T subneighbor, bool reset=true)
virtual std::vector< unsigned int > nodes_on_side(const unsigned int) const =0
virtual unsigned int n_nodes_in_child(unsigned int) const
Point vertex_average() const
static const unsigned int max_n_nodes
The maximum number of nodes any element can contain.
const Elem * child_ptr(unsigned int i) const
void active_family_tree_by_topological_neighbor(T elem, std::vector< T > &family, T neighbor_in, const MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb, bool reset=true)
void add_edge(const dof_id_type elem, const unsigned short int edge, const boundary_id_type id)
Add edge edge of element number elem with boundary id id to the boundary information data structure...
static FEFamily map_fe_type(const Elem &elem)
virtual bool is_mid_infinite_edge_node(const unsigned int) const
Used to iterate over the sides of an element which are on the boundary of the Mesh.
bool is_internal(const unsigned int i) const
SideIter _first_side()
Side iterator helper functions.
const RemoteElem * remote_elem