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/tensor_value.h"
26#include "libmesh/node_elem.h"
27#include "libmesh/edge_edge2.h"
28#include "libmesh/edge_edge3.h"
29#include "libmesh/edge_edge4.h"
30#include "libmesh/edge_inf_edge2.h"
31#include "libmesh/face_c0polygon.h"
32#include "libmesh/face_tri3.h"
33#include "libmesh/face_tri3_subdivision.h"
34#include "libmesh/face_tri3_shell.h"
35#include "libmesh/face_tri6.h"
36#include "libmesh/face_tri7.h"
37#include "libmesh/face_quad4.h"
38#include "libmesh/face_quad4_shell.h"
39#include "libmesh/face_quad8.h"
40#include "libmesh/face_quad8_shell.h"
41#include "libmesh/face_quad9.h"
42#include "libmesh/face_quad9_shell.h"
43#include "libmesh/face_inf_quad4.h"
44#include "libmesh/face_inf_quad6.h"
45#include "libmesh/cell_tet4.h"
46#include "libmesh/cell_tet10.h"
47#include "libmesh/cell_tet14.h"
48#include "libmesh/cell_hex8.h"
49#include "libmesh/cell_hex20.h"
50#include "libmesh/cell_hex27.h"
51#include "libmesh/cell_inf_hex8.h"
52#include "libmesh/cell_inf_hex16.h"
53#include "libmesh/cell_inf_hex18.h"
54#include "libmesh/cell_prism6.h"
55#include "libmesh/cell_prism15.h"
56#include "libmesh/cell_prism18.h"
57#include "libmesh/cell_prism20.h"
58#include "libmesh/cell_prism21.h"
59#include "libmesh/cell_inf_prism6.h"
60#include "libmesh/cell_inf_prism12.h"
61#include "libmesh/cell_pyramid5.h"
62#include "libmesh/cell_pyramid13.h"
63#include "libmesh/cell_pyramid14.h"
64#include "libmesh/cell_pyramid18.h"
65#include "libmesh/fe_base.h"
66#include "libmesh/mesh_base.h"
67#include "libmesh/quadrature_nodal.h"
68#include "libmesh/quadrature_gauss.h"
69#include "libmesh/remote_elem.h"
70#include "libmesh/reference_elem.h"
71#include "libmesh/enum_to_string.h"
72#include "libmesh/threads.h"
73#include "libmesh/enum_elem_quality.h"
74#include "libmesh/enum_io_package.h"
75#include "libmesh/enum_order.h"
76#include "libmesh/elem_internal.h"
78#ifdef LIBMESH_ENABLE_PERIODIC
79#include "libmesh/mesh.h"
80#include "libmesh/periodic_boundaries.h"
352 std::unique_ptr<Elem> returnval;
354 switch (this->
type())
357 returnval = std::make_unique<C0Polygon>(this->
n_sides());
364 returnval->set_id() = this->
id();
365#ifdef LIBMESH_ENABLE_UNIQUE_ID
367 returnval->set_unique_id(this->
unique_id());
371 returnval->add_extra_integers(n_elem_ints);
372 for (
unsigned int i = 0; i != n_elem_ints; ++i)
373 returnval->set_extra_integer(i, this->get_extra_integer(i));
375 returnval->inherit_data_from(*
this);
389 return std::make_unique<NodeElem>(p);
393 return std::make_unique<Edge2>(p);
395 return std::make_unique<Edge3>(p);
397 return std::make_unique<Edge4>(p);
401 return std::make_unique<Tri3>(p);
403 return std::make_unique<TriShell3>(p);
405 return std::make_unique<Tri3Subdivision>(p);
407 return std::make_unique<Tri6>(p);
409 return std::make_unique<Tri7>(p);
411 return std::make_unique<Quad4>(p);
413 return std::make_unique<QuadShell4>(p);
415 return std::make_unique<Quad8>(p);
417 return std::make_unique<QuadShell8>(p);
419 return std::make_unique<Quad9>(p);
421 return std::make_unique<QuadShell9>(p);
425 return std::make_unique<C0Polygon>(6, p);
430 libmesh_not_implemented_msg
431 (
"Polyhedra cannot be built via Elem::build()");
435 return std::make_unique<Tet4>(p);
437 return std::make_unique<Tet10>(p);
439 return std::make_unique<Tet14>(p);
441 return std::make_unique<Hex8>(p);
443 return std::make_unique<Hex20>(p);
445 return std::make_unique<Hex27>(p);
447 return std::make_unique<Prism6>(p);
449 return std::make_unique<Prism15>(p);
451 return std::make_unique<Prism18>(p);
453 return std::make_unique<Prism20>(p);
455 return std::make_unique<Prism21>(p);
457 return std::make_unique<Pyramid5>(p);
459 return std::make_unique<Pyramid13>(p);
461 return std::make_unique<Pyramid14>(p);
463 return std::make_unique<Pyramid18>(p);
465#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
468 return std::make_unique<InfEdge2>(p);
472 return std::make_unique<InfQuad4>(p);
474 return std::make_unique<InfQuad6>(p);
478 return std::make_unique<InfHex8>(p);
480 return std::make_unique<InfHex16>(p);
482 return std::make_unique<InfHex18>(p);
484 return std::make_unique<InfPrism6>(p);
486 return std::make_unique<InfPrism12>(p);
558#ifdef LIBMESH_ENABLE_AMR
559 elem_copy->set_p_level(0);
564 elem_copy->set_node(n,
_nodes[n]);
566 return elem_copy->true_centroid();
577 fe->attach_quadrature_rule(&qrule);
580 const auto & JxW = fe->get_JxW();
581 const auto & phi = fe->get_phi();
588 libmesh_assert_equal_to(N, this->
n_nodes());
591 std::vector<Real> V(N);
594 V[i] += JxW[qp] * phi[i][qp];
602 cp += this->
point(i) * V[i];
616 cp.
add (this->point(n));
632 Real h_min=std::numeric_limits<Real>::max();
634 for (
unsigned int n_outer=0; n_outer<
n_vertices; n_outer++)
635 for (
unsigned int n_inner=n_outer+1; n_inner<
n_vertices; n_inner++)
637 const auto diff = (this->
point(n_outer) - this->
point(n_inner));
639 h_min = std::min(h_min, diff.norm_sq());
642 return std::sqrt(h_min);
654 for (
unsigned int n_outer=0; n_outer<
n_vertices; n_outer++)
655 for (
unsigned int n_inner=n_outer+1; n_inner<
n_vertices; n_inner++)
657 const auto diff = (this->
point(n_outer) - this->
point(n_inner));
659 h_max = std::max(h_max, diff.norm_sq());
662 return std::sqrt(h_max);
668 const unsigned int n2)
const
670 libmesh_assert_less ( n1, this->
n_vertices() );
671 libmesh_assert_less ( n2, this->
n_vertices() );
673 return (this->
point(n1) - this->
point(n2)).norm();
680 const unsigned short n_n = this->
n_nodes();
682 std::array<dof_id_type, Elem::max_n_nodes> node_ids;
684 for (
unsigned short n=0; n != n_n; ++n)
685 node_ids[n] = this->
node_id(n);
689 std::sort (node_ids.begin(), node_ids.begin()+n_n);
702 const unsigned short n_n = this->
n_nodes();
703 libmesh_assert_equal_to(n_n, rhs.
n_nodes());
707 std::array<dof_id_type, Elem::max_n_nodes> this_ids, rhs_ids;
709 for (
unsigned short n = 0; n != n_n; n++)
711 this_ids[n] = this->
node_id(n);
716 std::sort(this_ids.begin(), this_ids.begin()+n_n);
717 std::sort(rhs_ids.begin(), rhs_ids.begin()+n_n);
720 for (
unsigned short n = 0; n != n_n; ++n)
721 if (this_ids[n] != rhs_ids[n])
782 std::set<const Elem *> point_neighbors;
786 for (
const auto & elem : point_neighbors)
787 if (elem->processor_id() == my_pid)
799 const unsigned int ns = this->
n_sides();
800 const unsigned int nn = this->
n_nodes();
802 const unsigned int en = e->
n_nodes();
805 std::vector<bool> might_be_side(ns,
true);
807 for (
unsigned int i=0; i != en; ++i)
816 for (
unsigned int j=0; j != nn; ++j)
817 if (this->
point(j) == side_point)
827 for (
unsigned int s=0; s != ns; ++s)
829 might_be_side[s] =
false;
832 for (
unsigned int s=0; s != ns; ++s)
833 if (might_be_side[s])
836 for (
unsigned int s2=s+1; s2 < ns; ++s2)
852 const unsigned int my_nv = this->
n_vertices();
860 if (&this->
node_ref(my_n) == vertex)
867 const unsigned int l = this->
level();
868 const unsigned int el = e->
level();
888 unsigned int num_contained_edges = 0;
895 num_contained_edges++;
896 if (num_contained_edges>=2)
908 std::set<const Elem *> & neighbor_set)
const
913 neighbor_set.clear();
914 neighbor_set.insert(
this);
916 std::set<const Elem *> untested_set, next_untested_set;
917 untested_set.insert(
this);
919#ifdef LIBMESH_ENABLE_AMR
920 std::vector<const Elem *> active_neighbor_children;
923 while (!untested_set.empty())
927 for (
const auto & elem : untested_set)
928 for (
auto current_neighbor : elem->neighbor_ptr_range())
930 if (current_neighbor &&
933 if (current_neighbor->active())
935 auto it = neighbor_set.lower_bound(current_neighbor);
936 if ((it == neighbor_set.end() || *it != current_neighbor) &&
937 current_neighbor->contains_point(p))
940 next_untested_set.insert(current_neighbor);
941 neighbor_set.emplace_hint(it, current_neighbor);
944#ifdef LIBMESH_ENABLE_AMR
948 active_neighbor_children.clear();
949 current_neighbor->active_family_tree_by_neighbor
950 (active_neighbor_children, elem);
952 for (
const auto & current_child : active_neighbor_children)
954 auto it = neighbor_set.lower_bound(current_child);
955 if ((it == neighbor_set.end() || *it != current_child) &&
956 current_child->contains_point(p))
959 next_untested_set.insert(current_child);
960 neighbor_set.emplace_hint(it, current_child);
967 untested_set.swap(next_untested_set);
968 next_untested_set.clear();
982 const Elem * start_elem)
const
999 std::set<const Elem *> & neighbor_set)
const
1008 std::set<const Elem *>::iterator it = neighbor_set.begin();
1009 const std::set<const Elem *>::iterator end = neighbor_set.end();
1015 if (!(*it)->contains_point(p2))
1016 it = neighbor_set.erase(it);
1026 neighbor_set.clear();
1027 neighbor_set.insert(
this);
1029 std::set<const Elem *> untested_set, next_untested_set;
1030 untested_set.insert(
this);
1032 while (!untested_set.empty())
1036 for (
const auto & elem : untested_set)
1038 for (
auto current_neighbor : elem->neighbor_ptr_range())
1040 if (current_neighbor &&
1043 if (current_neighbor->active())
1046 || current_neighbor->contains_edge_of(
this))
1049 if (!neighbor_set.count(current_neighbor))
1050 next_untested_set.insert (current_neighbor);
1053 neighbor_set.insert (current_neighbor);
1056#ifdef LIBMESH_ENABLE_AMR
1060 std::vector<const Elem *> active_neighbor_children;
1062 current_neighbor->active_family_tree_by_neighbor
1063 (active_neighbor_children, elem);
1065 for (
const auto & current_child : active_neighbor_children)
1066 if (this->
contains_edge_of(current_child) || current_child->contains_edge_of(
this))
1069 if (!neighbor_set.count(current_child))
1070 next_untested_set.insert (current_child);
1072 neighbor_set.insert (current_child);
1079 untested_set.swap(next_untested_set);
1080 next_untested_set.clear();
1103 if (this->
dim() >= LIBMESH_DIM)
1124 (interior_p->
dim() > this->dim()));
1136 (interior_p->
level() <= this->level()) ||
1137 (this->level() == 0 &&
1148 if (this->
dim() >= LIBMESH_DIM)
1155 (interior_p->
dim() > this->dim()));
1166 this->
dim() < LIBMESH_DIM);
1176 (p->
dim() > this->dim()));
1183#ifdef LIBMESH_ENABLE_PERIODIC
1193 if (neighbor_i !=
nullptr)
1201 std::vector<boundary_id_type> bc_ids;
1202 mesh.get_boundary_info().boundary_ids(
this, cast_int<unsigned short>(i), bc_ids);
1203 for (
const auto &
id : bc_ids)
1209 const Elem *
const cn = pb->
neighbor(
id, point_locator,
this, i);
1210 neighbor_i =
const_cast<Elem *
>(cn);
1217 neighbor_i = neighbor_i->
parent();
1235 if (neighbor_i !=
nullptr)
1243 std::vector<boundary_id_type> bc_ids;
1244 mesh.get_boundary_info().boundary_ids(
this, cast_int<unsigned short>(i), bc_ids);
1245 for (
const auto &
id : bc_ids)
1248 neighbor_i = pb->
neighbor(
id, point_locator,
this, i);
1255 neighbor_i = neighbor_i->
parent();
1313 const Elem * elem =
this;
1321 for (elem =
this; !elem->
active();
1343 for (; elem != nn; elem = elem->
parent())
1359 (my_parent->
dim() == this->dim()))
1377 const unsigned int this_level = this->
level();
1378 const unsigned int neigh_level = neigh->
level();
1381 libmesh_assert_less_equal (neigh_level, this_level);
1390 (neigh->
active() && !this->subactive()) ||
1404 std::vector<Elem *> neigh_family;
1405#ifdef LIBMESH_ENABLE_AMR
1408 neigh_family.push_back(neigh);
1412 std::unique_ptr<Elem> my_side, neigh_side;
1415 for (
auto & neigh_family_member : neigh_family)
1418 const bool member_subactive = neigh_family_member->subactive();
1419 if (this->
subactive() && !member_subactive)
1426 const unsigned int member_level = neigh_family_member->level();
1427 if (member_level < this_level)
1437#ifdef LIBMESH_ENABLE_AMR
1439 (neigh_family_member->neighbor_ptr(nn)->active() ||
1440 this->is_ancestor_of(neigh_family_member->neighbor_ptr(nn)) ||
1441 neigh_family_member->neighbor_ptr(nn)->is_ancestor_of(
this))) ||
1442 (neigh_family_member->neighbor_ptr(nn) ==
remote_elem) ||
1444 (this->parent() !=
nullptr) &&
1445 (neigh_family_member->neighbor_ptr(nn) == this->parent())));
1447 libmesh_assert((neigh_family_member->neighbor_ptr(nn) ==
this) ||
1448 (neigh_family_member->neighbor_ptr(nn) ==
remote_elem));
1454 if (member_level > this_level)
1465 if (neigh_level < this_level &&
1466 member_level > neigh_level)
1471 neigh_family_member->side_ptr(neigh_side, nn);
1473 if (*my_side != *neigh_side)
1477 neigh_family_member->set_neighbor(nn,
this);
1487#if defined(LIBMESH_ENABLE_AMR) && defined(DEBUG)
1500 libmesh_assert_greater_equal (this->
level(), neigh->level());
1502 if (this->
level() == neigh->level() &&
1503 neigh->has_neighbor(
this))
1505#ifdef LIBMESH_ENABLE_AMR
1508 std::vector<Elem *> family;
1509 neigh->total_family_tree_by_neighbor (family,
this);
1513 for (
auto & n : family)
1518 unsigned int my_s = n->which_neighbor_am_i(
this);
1519 libmesh_assert_less (my_s, n->n_neighbors());
1520 libmesh_assert_equal_to (n->neighbor_ptr(my_s),
this);
1524 unsigned int my_s = neigh->which_neighbor_am_i(
this);
1525 libmesh_assert_less (my_s, neigh->n_neighbors());
1526 libmesh_assert_equal_to (neigh->neighbor_ptr(my_s),
this);
1530#ifdef LIBMESH_ENABLE_AMR
1533 else if (neigh->has_children())
1544 while (!neigh->has_neighbor(my_ancestor))
1546 my_ancestor = my_ancestor->
parent();
1552 std::vector<Elem *> family;
1553 neigh->total_family_tree_by_subneighbor (family, my_ancestor,
this);
1555 for (
auto & n : family)
1560 unsigned int my_s = n->which_neighbor_am_i(
this);
1561 libmesh_assert_less (my_s, n->n_neighbors());
1562 libmesh_assert_equal_to (n->neighbor_ptr(my_s),
this);
1571#ifdef LIBMESH_ENABLE_AMR
1578 this->
dim() == my_parent->
dim())
1581 libmesh_assert_equal_to (my_parent->
child_ptr(me),
this);
1593#ifdef LIBMESH_ENABLE_AMR
1604 libmesh_assert_greater_equal (this->
level(), neigh->level());
1606 if (this->
level() == neigh->level() &&
1607 neigh->has_neighbor(
this))
1609#ifdef LIBMESH_ENABLE_AMR
1612 std::vector<Elem *> family;
1613 neigh->total_family_tree_by_neighbor (family,
this);
1615 for (
auto & n : family)
1620 unsigned int my_s = n->which_neighbor_am_i(
this);
1621 libmesh_assert_less (my_s, n->n_neighbors());
1622 libmesh_assert_equal_to (n->neighbor_ptr(my_s),
this);
1623 n->set_neighbor(my_s,
nullptr);
1626 unsigned int my_s = neigh->which_neighbor_am_i(
this);
1627 libmesh_assert_less (my_s, neigh->n_neighbors());
1628 libmesh_assert_equal_to (neigh->neighbor_ptr(my_s),
this);
1629 neigh->set_neighbor(my_s,
nullptr);
1632#ifdef LIBMESH_ENABLE_AMR
1635 else if (neigh->has_children())
1646 while (!neigh->has_neighbor(my_ancestor))
1648 my_ancestor = my_ancestor->
parent();
1654 std::vector<Elem *> family;
1655 neigh->total_family_tree_by_subneighbor (family, my_ancestor,
this);
1657 for (
auto & n : family)
1662 unsigned int my_s = n->which_neighbor_am_i(
this);
1663 libmesh_assert_less (my_s, n->n_neighbors());
1664 libmesh_assert_equal_to (n->neighbor_ptr(my_s),
this);
1665 n->set_neighbor(my_s,
nullptr);
1672#ifdef LIBMESH_ENABLE_AMR
1693 std::vector<dof_id_type> conn;
1698 std::copy(conn.begin(),
1700 std::ostream_iterator<dof_id_type>(out_stream,
" "));
1710 out_stream << this->
node_id(i)+1 <<
"\t";
1717 libmesh_error_msg(
"Unsupported IO package " << iop);
1731 if (this->
dim() < 2)
1734 std::vector<Real> edge_lengths(this->
n_edges());
1740 std::minmax_element(edge_lengths.begin(), edge_lengths.end());
1753 if (this->
dim() < 2)
1757 Real min_angle = std::numeric_limits<Real>::max();
1758 Real max_angle = -std::numeric_limits<Real>::max();
1768 auto N = adjacent_edge_ids.size();
1773 for (
unsigned int first = 0; first < N-1; ++first)
1774 for (
unsigned int second = first+1; second < N; ++second)
1777 auto first_edge = adjacent_edge_ids[first];
1778 auto second_edge = adjacent_edge_ids[second];
1787 if (first_edge_node_0 != n)
1788 std::swap(first_edge_node_0, first_edge_node_1);
1789 if (second_edge_node_0 != n)
1790 std::swap(second_edge_node_0, second_edge_node_1);
1792 libmesh_assert_equal_to(first_edge_node_0, n);
1793 libmesh_assert_equal_to(second_edge_node_0, n);
1797 first_ev = this->
point(first_edge_node_1) - this->
point(first_edge_node_0),
1798 second_ev = this->
point(second_edge_node_1) - this->
point(second_edge_node_0);
1801 Real theta = std::acos(first_ev.
unit() * second_ev.
unit());
1804 min_angle = std::min(theta, min_angle);
1805 max_angle = std::max(theta, max_angle);
1817 if (this->
dim() < 3)
1821 Real min_angle = std::numeric_limits<Real>::max();
1822 Real max_angle = -std::numeric_limits<Real>::max();
1841 libmesh_assert_equal_to(adjacent_side_ids.size(), 2);
1844 const auto side_0_node_ids = this->
nodes_on_side(adjacent_side_ids[0]);
1845 const auto side_1_node_ids = this->
nodes_on_side(adjacent_side_ids[1]);
1848 libmesh_assert_greater_equal(side_0_node_ids.size(), 3);
1849 libmesh_assert_greater_equal(side_1_node_ids.size(), 3);
1852 const auto side_0_normal =
1853 (this->
point(side_0_node_ids[2]) - this->
point(side_0_node_ids[0])).cross
1854 (this->
point(side_0_node_ids[1]) - this->
point(side_0_node_ids[0])).unit();
1855 const auto side_1_normal =
1856 (this->
point(side_1_node_ids[2]) - this->
point(side_1_node_ids[0])).cross
1857 (this->
point(side_1_node_ids[1]) - this->
point(side_1_node_ids[0])).unit();
1864 Real theta = std::acos(std::abs(side_0_normal * side_1_normal));
1867 min_angle = std::min(theta, min_angle);
1868 max_angle = std::max(theta, max_angle);
1880 const auto N = this->
dim();
1885 Real min_node_area = std::numeric_limits<Real>::max();
1900 if (adjacent_edge_ids.size() != N)
1904 std::vector<Point> oriented_edges(N);
1910 std::swap(node_0, node_1);
1911 oriented_edges[i] = this->
point(node_1) - this->
point(node_0);
1918 Real node_area = (N == 2) ?
1919 cross_norm(oriented_edges[0], oriented_edges[1]) :
1920 std::abs(
triple_product(oriented_edges[0], oriented_edges[1], oriented_edges[2]));
1928 Real len_i = oriented_edges[i].norm();
1929 node_area = (len_i == 0.) ? 0. : (node_area / len_i);
1933 min_node_area = std::min(node_area, min_node_area);
1936 return min_node_area;
1952 const auto N = this->
dim();
1964 const Elem & ideal = *ideal_pair.first;
1969 auto nodal_det = [](
const Elem & el,
const unsigned int n,
1970 const std::vector<unsigned int> & edge_ids,
1971 const unsigned int dim)
1973 std::vector<Point> e(
dim);
1974 for (
unsigned int i = 0; i !=
dim; ++i)
1987 bool have_corner =
false;
1993 if (adjacent_edge_ids.size() != N)
1997 const Real a = nodal_det(*
this, n, adjacent_edge_ids, N);
1998 const Real aw = nodal_det(ideal, n, adjacent_edge_ids, N);
2001 if (a == 0. || aw == 0.)
2004 const Real tau = (a / aw) * vol_ratio;
2005 size = std::min(size, std::min(tau,
Real(1) / tau));
2008 return have_corner ? size : 0.;
2029 const auto N = this->
dim();
2037 const Elem & ideal = *ideal_pair.first;
2042 auto metric_tensor = [](
const Elem & el,
const unsigned int n,
2043 const std::vector<unsigned int> & edge_ids,
2044 const unsigned int dim)
2046 std::vector<Point> e(
dim);
2047 for (
unsigned int i = 0; i !=
dim; ++i)
2056 for (
unsigned int i = 0; i !=
dim; ++i)
2057 for (
unsigned int j = 0; j !=
dim; ++j)
2058 T(i, j) = e[i] * e[j];
2071 if (adjacent_edge_ids.size() != N)
2074 const RealTensor Ta = metric_tensor(*
this, n, adjacent_edge_ids, N);
2080 const RealTensor Tw = metric_tensor(ideal, n, adjacent_edge_ids, N);
2087 Real num1 = 0., num2 = 0.;
2091 num1 += Ta(i, j) * Tw_inv(i, j);
2092 num2 += Tw(i, j) * Ta_inv(i, j);
2095 max_cond = std::max(max_cond, std::sqrt(num1 * num2) / N);
2104 libmesh_do_once( libmesh_here();
2108 <<
" not implemented on element type "
2123#ifdef LIBMESH_ENABLE_AMR
2126 const bool is_ancestor =
2153#ifdef LIBMESH_ENABLE_AMR
2161 _children = std::make_unique<Elem *[]>(nc);
2163 for (
unsigned int c = 0; c != nc; c++)
2167 for (
unsigned int c = 0; c != nc; c++)
2171 libmesh_assert_equal_to (
this, elem->
parent());
2177 libmesh_error_msg(
"Error: Tried to add a child to an element with full children array");
2187 _children = std::make_unique<Elem *[]>(nc);
2189 for (
unsigned int i = 0; i != nc; i++)
2315 const Elem * neighbor,
2333 const Elem * neighbor,
2351 const Elem * neighbor,
2352 const Elem * subneighbor,
2371 const Elem * neighbor,
2372 const Elem * subneighbor,
2391 const Elem * neighbor,
2409 const Elem * neighbor,
2416 mesh, point_locator, pb,
2430 mesh, point_locator, pb,
2436 const unsigned int e)
const
2439 libmesh_assert_less (e, this->
n_edges());
2446 return (child_edge->node_id(0) == my_edge->node_id(0) ||
2447 child_edge->node_id(1) == my_edge->node_id(1));
2453 unsigned int current_min)
const
2460 return std::min(current_min, this->
p_level());
2467 if (current_min <= this->
p_level())
2470 unsigned int min_p_level = current_min;
2475 c.min_p_level_by_neighbor(neighbor_in, min_p_level);
2482 unsigned int current_min)
const
2490 unsigned int new_p_level = this->
p_level();
2495 libmesh_assert_greater (new_p_level, 0);
2498 return std::min(current_min, new_p_level);
2503 unsigned int min_p_level = current_min;
2508 c.min_new_p_level_by_neighbor(neighbor_in, min_p_level);
2516 unsigned int child_node)
const
2519 libmesh_assert_less(child, nc);
2523 std::vector<std::vector<std::vector<signed char>>> &
2532 if (em_vers >= cached_parent_indices.size())
2533 cached_parent_indices.resize(em_vers+1);
2535 if (child >= cached_parent_indices[em_vers].size())
2537 const signed char nn = cast_int<signed char>(this->
n_nodes());
2539 cached_parent_indices[em_vers].resize(nc);
2541 for (
unsigned int c = 0; c != nc; ++c)
2544 cached_parent_indices[em_vers][c].resize(ncn);
2545 for (
unsigned int cn = 0; cn != ncn; ++cn)
2547 for (
signed char n = 0; n != nn; ++n)
2553 cached_parent_indices[em_vers][c][cn] = n;
2559 cached_parent_indices[em_vers][c][cn] =
2566 libmesh_assert_not_equal_to (n+1, nn);
2572 const signed char cache_val =
2573 cached_parent_indices[em_vers][child][child_node];
2574 if (cache_val == -1)
2577 return cached_parent_indices[em_vers][child][child_node];
2582const std::vector<std::pair<unsigned char, unsigned char>> &
2584 unsigned int child_node)
const
2588 std::vector<std::vector<std::vector<std::vector<std::pair<unsigned char, unsigned char>>>>> &
2597 if (cached_bracketing_nodes.size() <= em_vers)
2598 cached_bracketing_nodes.resize(em_vers+1);
2604 if (cached_bracketing_nodes[em_vers].size() < nc)
2615 libmesh_assert_equal_to
2622 std::unique_ptr<Elem> full_elem =
Elem::build(full_type);
2627 libmesh_assert_equal_to(em_vers, 0);
2633 full_elem->parent_bracketing_nodes(0,0);
2642 cached_bracketing_nodes =
2643 full_elem->_get_bracketing_node_cache();
2646 return cached_bracketing_nodes[em_vers][child][child_node];
2649 cached_bracketing_nodes[em_vers].resize(nc);
2651 const unsigned int nn = this->
n_nodes();
2654 for (
unsigned int c = 0; c != nc; ++c)
2658 cached_bracketing_nodes[em_vers][c].resize(ncn);
2661 for (
unsigned int n = 0; n != ncn; ++n)
2667#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
2676 for (
unsigned int pn = 0; pn != nn; ++pn)
2681 libmesh_assert_not_equal_to (em_val, 1);
2688 for (
unsigned int n1 = 0; n1 != ncn; ++n1)
2693 unsigned int parent_n1 =
2701 for (
unsigned int n2 = n1+1; n2 < nn; ++n2)
2706 unsigned int parent_n2 =
2714 Point pmid = (p1 + p2)/2;
2716 if (pmid == bracketed_pt)
2718 cached_bracketing_nodes[em_vers][c][n].emplace_back(parent_n1, parent_n2);
2739 for (
unsigned int pn = 0; pn != nn; ++pn)
2744 libmesh_assert_not_equal_to (em_val, 1);
2753 for (
unsigned int n1 = 0; n1 != nn; ++n1)
2755 if (n1 == parent_node)
2760 for (
unsigned int n2 = n1+1; n2 < nn; ++n2)
2762 if (n2 == parent_node)
2767 if (pmid == bracketed_pt)
2769 cached_bracketing_nodes[em_vers][c][n].emplace_back(n1, n2);
2781 return cached_bracketing_nodes[em_vers][child][child_node];
2785const std::vector<std::pair<dof_id_type, dof_id_type>>
2787 unsigned int child_node)
const
2789 std::vector<std::pair<dof_id_type, dof_id_type>> returnval;
2791 const std::vector<std::pair<unsigned char, unsigned char>> & pbc =
2794 for (
const auto & pb : pbc)
2796 const unsigned short n_n = this->
n_nodes();
2797 if (pb.first < n_n && pb.second < n_n)
2798 returnval.emplace_back(this->
node_id(pb.first), this->node_id(pb.second));
2803 libmesh_assert_not_equal_to
2806 libmesh_assert_equal_to
2815 std::unique_ptr<Elem> full_elem =
Elem::build(full_type);
2825 for (
unsigned int c=0; c <= child; ++c)
2833 if (c == child && n == child_node)
2836 if (pb.first == full_elem->as_parent_node(c,n))
2845 if (pb.second == full_elem->as_parent_node(c,n))
2875 returnval.emplace_back(pt1, pt2);
2896 <<
"WARNING: Resizing bounding box to match user-specified tolerance!\n"
2897 <<
"In the future, calls to Elem::contains_point() with tol > TOLERANCE\n"
2898 <<
"will be more optimized, but should not be used\n"
2899 <<
"to search for points 'close to' elements!\n"
2900 <<
"Instead, use Elem::close_to_point() for this purpose.\n"
2925 libmesh_assert_greater (box_tol, 0.);
2926 libmesh_assert_greater (map_tol, 0.);
2936 point_above_min_z =
false,
2937 point_below_max_z =
false,
2940 point_above_min_y =
false,
2941 point_below_max_y =
false,
2943 point_above_min_x =
false,
2944 point_below_max_x =
false;
2951 point_above_min_x = point_above_min_x || (n(0) - my_hmax*box_tol <= p(0));
2952 point_below_max_x = point_below_max_x || (n(0) + my_hmax*box_tol >= p(0));
2954 point_above_min_y = point_above_min_y || (n(1) - my_hmax*box_tol <= p(1));
2955 point_below_max_y = point_below_max_y || (n(1) + my_hmax*box_tol >= p(1));
2958 point_above_min_z = point_above_min_z || (n(2) - my_hmax*box_tol <= p(2));
2959 point_below_max_z = point_below_max_z || (n(2) + my_hmax*box_tol >= p(2));
2965 !point_above_min_z ||
2966 !point_below_max_z ||
2969 !point_above_min_y ||
2970 !point_below_max_y ||
2972 !point_above_min_x ||
2993 if (this->
dim() < 3)
2999 Real dist = (xyz - p).norm();
3006 if (dist > this->
hmax() * map_tol)
3024 qnodal.allow_nodal_pyramid_quadrature =
true;
3026 auto & qp = qnodal.get_points();
3027 libmesh_assert_equal_to(qp.size(), this->n_nodes());
3029 std::vector<Point> one_point(1);
3030 std::vector<Real> one_weight(1,1);
3036 one_point[0] = qp[i];
3060 std::ostringstream oss;
3062 oss <<
" Elem Information" <<
'\n'
3070#ifdef LIBMESH_ENABLE_UNIQUE_ID
3071 oss <<
", unique_id()=";
3079 oss <<
", processor_id()=" << this->
processor_id() <<
'\n';
3082 <<
" dim()=" << this->
dim() <<
'\n'
3083 <<
" n_nodes()=" << this->
n_nodes() <<
'\n';
3089 oss <<
" " << n << this->
node_ref(n);
3092 const unsigned char datum_index = this->
mapping_data();
3093 oss <<
" weight=" <<
3098 oss <<
" n_sides()=" << this->
n_sides() <<
'\n';
3102 oss <<
" neighbor(" << s <<
")=";
3111 oss <<
" hmin()=" << this->
hmin()
3112 <<
", hmax()=" << this->
hmax() <<
'\n'
3113 <<
" volume()=" << this->
volume() <<
'\n';
3115 oss <<
" active()=" << this->
active()
3116 <<
", ancestor()=" << this->
ancestor()
3117 <<
", subactive()=" << this->
subactive()
3121 oss << this->
parent()->
id() <<
'\n';
3124 oss <<
" level()=" << this->
level()
3125 <<
", p_level()=" << this->
p_level() <<
'\n'
3126#ifdef LIBMESH_ENABLE_AMR
3130#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
3131 <<
" infinite()=" << this->
infinite() <<
'\n';
3133 oss <<
" origin()=" << this->
origin() <<
'\n'
3141 oss <<
'(' << s <<
'/' << v <<
'/' << this->
dof_number(s,v,c) <<
") ";
3156 if (current_neighbor && current_neighbor !=
remote_elem)
3161 if (current_neighbor->
level() == this->level())
3164 libmesh_assert_less (w_n_a_i, current_neighbor->
n_neighbors());
3184 const unsigned int)
const
3192std::pair<unsigned short int, unsigned short int>
3196 return std::pair<unsigned short int, unsigned short int>(0,0);
3245#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
3276 const unsigned int s)
3315 return (s == 0 || s == 4) ?
TRI3 :
QUAD4;
3317 return (s == 0 || s == 4) ?
TRI6 :
QUAD8;
3319 return (s == 0 || s == 4) ?
TRI6 :
QUAD9;
3322 return (s == 0 || s == 4) ?
TRI7 :
QUAD9;
3334#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
3432 const unsigned int side,
3433 const unsigned int side_node)
3513 const unsigned int edge,
3514 const unsigned int edge_node)
3572 const bool full_ordered)
3698#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
3747 libmesh_error_msg(
"No second order equivalent element type for et = "
3815#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
3839 libmesh_error_msg(
"No complete order equivalent element type for et = "
3879 fe->get_fe_map().set_jacobian_tolerance(std::numeric_limits<Real>::lowest());
3881 const std::vector<Real> & JxW = fe->get_JxW();
3887 fe->attach_quadrature_rule(&qrule);
3892 for (
auto jxw : JxW)
3906 unsigned int n_points = this->
n_nodes();
3907 for (
unsigned int p=0; p != n_points; ++p)
3908 for (
unsigned d=0; d<LIBMESH_DIM; ++d)
3911 if (pmin(d) > pt(d))
3914 if (pmax(d) < pt(d))
3924 unsigned int dim = this->
dim();
3925 const std::unique_ptr<const Elem> face = this->
build_side_ptr(s);
3926 std::unique_ptr<libMesh::FEBase> fe(
3928 fe->add_p_level_in_reinit(
false);
3929 const std::vector<Point> & normals = fe->get_normals();
3930 std::vector<Point> ref_side_vertex_average_v = {face->reference_elem()->vertex_average()};
3931 fe->reinit(
this, s,
TOLERANCE, &ref_side_vertex_average_v);
3936 unsigned int n)
const
3938#ifdef LIBMESH_ENABLE_AMR
3940 unsigned int my_n_vertices = this->
n_vertices();
3941 for (
unsigned int n_parent = 0; n_parent != my_n_vertices;
3951 libmesh_error_msg(
"ERROR: AMR disabled, how did we get here?");
3962 libmesh_not_implemented();
3968 const unsigned int )
const
3971 libmesh_not_implemented();
3977 libmesh_assert_less (side, this->
n_sides());
3986 std::vector<boundary_id_type> ids1, ids2;
3992 boundary_info->
add_side(
this, s2, ids1);
3994 boundary_info->
add_side(
this, s1, ids2);
4002 std::vector<boundary_id_type> ids1, ids2;
4008 boundary_info->
add_edge(
this, e2, ids1);
4010 boundary_info->
add_edge(
this, e1, ids2);
4016 switch (this->
dim())
4031 libmesh_error_msg(
"impossible element dimension " << std::to_string(this->
dim()));
4039 libmesh_assert_less (i, this->
n_edges());
4055 libmesh_assert_less (i, this->
n_faces());
4062 const std::vector<unsigned int> nodes = this->
nodes_on_side(i);
4064 auto cmp = [&](
const unsigned int & m,
const unsigned int & n) ->
bool
4067 const unsigned int v = std::distance(nodes.begin(),
4068 std::min_element(nodes.begin(), nodes.begin() + N, cmp));
4074 return 2 * v + cmp(nodes[(v - 1 + N) % N], nodes[(v + 1) % N]);
4077std::vector<unsigned int>
4082 const unsigned int least = orientation / 2;
4086 const bool backward = orientation % 2;
4088 std::vector<unsigned int> vertices(N);
4090 vertices[k] = this->
local_side_node(i, (least + (backward ? N - k : k)) % N);
4098 libmesh_assert_less (e, this->
n_edges());
4099 libmesh_assert_less (s, this->
n_faces());
4105 for (v = 0; v < N; v++)
The BoundaryInfo class contains information relevant to boundary conditions including storing faces,...
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.
void edge_boundary_ids(const Elem *const elem, const unsigned short int edge, std::vector< boundary_id_type > &vec_to_fill) const
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 remove_edge(const Elem *elem, const unsigned short int edge)
Removes all boundary conditions associated with edge edge of element elem, if any exist.
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.
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.
Defines a Cartesian bounding box by the two corner extremum.
unsigned int n_systems() const
unsigned int n_comp(const unsigned int s, const unsigned int var) const
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
unsigned int n_extra_integers() const
Returns how many extra integers are associated to the DofObject.
processor_id_type processor_id() const
static constexpr dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
unique_id_type unique_id() const
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...
bool valid_unique_id() const
This is the base class from which all geometric element types are derived.
virtual unsigned int n_nodes_in_child(unsigned int) const
void family_tree(std::vector< const Elem * > &family, bool reset=true) const
Fills the vector family with the children of this element, recursively.
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const =0
virtual std::unique_ptr< Elem > disconnected_clone() const
void total_family_tree_by_side(std::vector< const Elem * > &family, unsigned int side, bool reset=true) const
Same as the total_family_tree() member, but only adds elements which are next to side.
virtual const std::vector< std::pair< unsigned char, unsigned char > > & parent_bracketing_nodes(unsigned int c, unsigned int n) const
virtual BoundingBox loose_bounding_box() const
SimpleRange< NeighborPtrIter > neighbor_ptr_range()
Returns a range with all neighbors of an element, usable in range-based for loops.
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...
RefinementState refinement_flag() const
virtual unsigned int center_node_on_side(const unsigned short side) const
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.
unsigned char mapping_data() const
bool has_neighbor(const Elem *elem) const
void print_info(std::ostream &os=libMesh::out) const
Prints relevant information about the element.
virtual unsigned int n_vertices() const =0
const Point & point(const unsigned int i) const
virtual unsigned int local_side_node(unsigned int side, unsigned int side_node) const =0
const Node & node_ref(const unsigned int i) const
virtual Point true_centroid() const
virtual Point origin() const
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...
virtual bool is_child_on_edge(const unsigned int c, const unsigned int e) const
void set_child(unsigned int c, Elem *elem)
Sets the pointer to the child for this element.
bool has_children() const
virtual std::unique_ptr< Elem > side_ptr(unsigned int i)=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 ...
bool topologically_equal(const Elem &rhs) const
virtual unsigned int n_nodes() const =0
static ElemType edge_type(const ElemType t)
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.
const Elem * parent() const
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.
virtual std::pair< unsigned short int, unsigned short int > second_order_child_vertex(const unsigned int n) 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 ...
bool operator==(const Elem &rhs) const
void set_neighbor(const unsigned int i, Elem *n)
Assigns n as the neighbor.
static ElemType complete_order_equivalent_type(const ElemType et)
virtual bool on_reference_element(const Point &p, const Real eps=TOLERANCE) const =0
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....
const Elem * child_ptr(unsigned int i) const
virtual const std::vector< std::pair< dof_id_type, dof_id_type > > bracketing_nodes(unsigned int c, unsigned int n) const
bool positive_edge_orientation(const unsigned int i) const
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.
bool has_topological_neighbor(const Elem *elem, const MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb) const
unsigned int which_neighbor_am_i(const Elem *e) const
This function tells you which neighbor e is.
virtual void connectivity(const unsigned int sc, const IOPackage iop, std::vector< dof_id_type > &conn) const =0
SideIter _first_side()
Side iterator helper functions.
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.
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.
unsigned int n_neighbors() const
virtual bool is_mid_infinite_edge_node(const unsigned int) const
SimpleRange< NodeRefIter > node_ref_range()
Returns a range with all nodes of an element, usable in range-based for loops.
virtual unsigned int opposite_node(const unsigned int n, const unsigned int s) const
Node ** _nodes
Pointers to the nodes we are connected to.
virtual bool is_vertex_on_parent(unsigned int c, unsigned int n) const
virtual Order default_order() const =0
static std::unique_ptr< Elem > build(const ElemType type, Elem *p=nullptr)
virtual std::vector< unsigned int > nodes_on_side(const unsigned int) const =0
void set_interior_parent(Elem *p)
Sets the pointer to the element's interior_parent.
static ElemType first_order_equivalent_type(const ElemType et)
void remove_links_to_me()
Resets this element's neighbors' appropriate neighbor pointers and its parent's and children's approp...
bool positive_face_orientation(const unsigned int i) const
virtual unsigned int n_second_order_adjacent_vertices(const unsigned int n) const
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.
side_iterator boundary_sides_end()
virtual bool is_face(const unsigned int i) const =0
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...
side_iterator boundary_sides_begin()
Iterator accessor functions.
void nullify_neighbors()
Replaces this element with nullptr for all of its neighbors.
virtual bool has_invertible_map(Real tol=TOLERANCE *TOLERANCE) const
std::unique_ptr< Elem *[]> _children
unique_ptr to array of this element's children.
unsigned int min_new_p_level_by_neighbor(const Elem *neighbor, unsigned int current_min) const
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...
void swap2boundarysides(unsigned short s1, unsigned short s2, BoundaryInfo *boundary_info) const
Swaps two sides in boundary_info, if it is non-null.
virtual Real embedding_matrix(const unsigned int child_num, const unsigned int child_node_num, const unsigned int parent_node_num) const =0
virtual bool is_singular_node(unsigned int) const
bool contains_vertex_of(const Elem *e, bool mesh_connection=false) const
unsigned int which_child_am_i(const Elem *e) const
virtual Real hmin() const
static ElemType second_order_equivalent_type(const ElemType et, const bool full_ordered=true)
bool is_semilocal(const processor_id_type my_pid) const
void libmesh_assert_valid_neighbors() const
Checks for consistent neighbor links on this element.
virtual bool contains_point(const Point &p, Real tol=TOLERANCE) const
virtual unsigned short dim() const =0
virtual Real quality(const ElemQuality q) 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 ...
virtual bool is_vertex_on_child(unsigned int, unsigned int n) const
void libmesh_assert_valid_node_pointers() const
Checks for a valid id and pointers to nodes with valid ids on this element.
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 ...
subdomain_id_type subdomain_id() const
virtual unsigned int n_sub_elem() const =0
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...
SimpleRange< ChildRefIter > child_ref_range()
Returns a range with all children of a parent element, usable in range-based for loops.
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 make_links_to_me_remote()
Resets this element's neighbors' appropriate neighbor pointers and its parent's and children's approp...
virtual bool is_edge(const unsigned int i) const =0
virtual dof_id_type key() const
Elem ** _elemlinks
Pointers to this element's parent and neighbors, and for lower-dimensional elements' interior_parent.
unsigned int level() const
virtual Real hmax() const
ElemMappingType mapping_type() const
virtual bool is_remote() const
static const unsigned int max_n_nodes
The maximum number of nodes any element can contain.
static constexpr 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...
std::vector< unsigned int > oriented_face_vertices(const unsigned int i) const
unsigned int min_p_level_by_neighbor(const Elem *neighbor, unsigned int current_min) const
std::string get_info() const
Prints relevant information about the element to a string.
virtual Point side_vertex_average_normal(const unsigned int s) const
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 unsigned int n_faces() const =0
bool contains_edge_of(const Elem *e) const
virtual unsigned int opposite_side(const unsigned int s) const
const Node * node_ptr(const unsigned int i) const
void add_child(Elem *elem)
Adds a child pointer to the array of children of this element.
void replace_child(Elem *elem, unsigned int c)
Replaces the child pointer at the specified index in the child array.
virtual unsigned int as_parent_node(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...
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.
virtual std::vector< unsigned int > sides_on_edge(const unsigned int) const =0
const Elem * reference_elem() const
bool is_internal(const unsigned int i) const
virtual std::unique_ptr< Elem > build_edge_ptr(const unsigned int i)=0
IntRange< unsigned short > edge_index_range() const
Real length(const unsigned int n1, const unsigned int n2) const
unsigned int which_side_am_i(const Elem *e) const
This function tells you which side the boundary element e is.
virtual Real volume() const
virtual bool is_vertex(const unsigned int i) const =0
virtual unsigned int n_children() const =0
virtual unsigned int embedding_matrix_version() const
void swap2boundaryedges(unsigned short e1, unsigned short e2, BoundaryInfo *boundary_info) const
Swaps two edges in boundary_info, if it is non-null.
void write_connectivity(std::ostream &out, const IOPackage iop) const
Writes the element connectivity for various IO packages to the passed ostream "out".
virtual ElemType type() const =0
IntRange< unsigned short > node_index_range() const
virtual Point master_point(const unsigned int i) const =0
const Elem * interior_parent() const
bool relative_edge_face_order(const unsigned int e, const unsigned int s) const
virtual unsigned int n_edges() const =0
virtual ElemType side_type(const unsigned int s) const =0
virtual unsigned int n_sides() const =0
dof_id_type node_id(const unsigned int i) const
unsigned int p_level() const
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.
const Elem * topological_neighbor(const unsigned int i, const MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb) const
RefinementState p_refinement_flag() const
virtual unsigned short int second_order_adjacent_vertex(const unsigned int n, const unsigned int v) const
virtual bool close_to_point(const Point &p, Real tol) const
virtual bool is_edge_on_side(const unsigned int e, const unsigned int s) const =0
const Elem * neighbor_ptr(unsigned int i) const
virtual bool infinite() const =0
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.
Point vertex_average() const
IntRange< unsigned short > side_index_range() const
virtual std::vector< unsigned int > edges_adjacent_to_node(const unsigned int) const =0
unsigned int face_orientation(const unsigned int i) const
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int i)=0
static std::unique_ptr< FEGenericBase > build(const unsigned int dim, const FEType &type)
Builds a specific finite element type.
Class contained in FE that encapsulates mapping (i.e.
const std::vector< Real > & get_jacobian() const
static Point map(const unsigned int dim, const Elem *elem, const Point &reference_point)
static FEFamily map_fe_type(const Elem &elem)
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 init_reference_to_physical_map(const std::vector< Point > &qp, const Elem *elem)
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.
class FEType hides (possibly multiple) FEFamily and approximation orders, thereby enabling specialize...
Order default_quadrature_order() const
static constexpr const unsigned int(& side_nodes_map)[num_sides][nodes_per_side]
static constexpr const unsigned int(& edge_nodes_map)[num_edges][nodes_per_edge]
static constexpr const unsigned int(& side_nodes_map)[num_sides][nodes_per_side]
static constexpr const unsigned int(& edge_nodes_map)[num_edges][nodes_per_edge]
static constexpr unsigned int side_nodes_map[num_sides][nodes_per_side]
This maps the node of the side to element node numbers.
static constexpr unsigned int edge_nodes_map[num_edges][nodes_per_edge]
This maps the node of the edge to element node numbers.
This is the MeshBase class.
A Node is like a Point, but with more information.
We're using a class instead of a typedef to allow forward declarations and future flexibility.
PeriodicBoundaryBase * boundary(boundary_id_type id)
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 is the base class for point locators.
A Point defines a location in LIBMESH_DIM dimensional Real space.
static constexpr const unsigned int(& side_nodes_map)[num_sides][nodes_per_side]
static constexpr const unsigned int(& edge_nodes_map)[num_edges][nodes_per_edge]
static constexpr const unsigned int(& edge_nodes_map)[num_edges][nodes_per_edge]
static constexpr const unsigned int(& side_nodes_map)[num_sides][nodes_per_side]
static constexpr const unsigned int(& edge_nodes_map)[num_edges][nodes_per_edge]
static constexpr const unsigned int(& side_nodes_map)[num_sides][nodes_per_side]
static constexpr const unsigned int(& edge_nodes_map)[num_edges][nodes_per_edge]
static constexpr const unsigned int(& side_nodes_map)[num_sides][nodes_per_side]
static constexpr unsigned int side_nodes_map[num_sides][nodes_per_side]
This maps the node of the side to element node numbers.
static constexpr unsigned int edge_nodes_map[num_edges][nodes_per_edge]
This maps the node of the edge to element node numbers.
static constexpr const unsigned int(& edge_nodes_map)[num_edges][nodes_per_edge]
static constexpr const unsigned int(& side_nodes_map)[num_sides][nodes_per_side]
static constexpr const unsigned int(& side_nodes_map)[num_sides][nodes_per_side]
static constexpr const unsigned int(& edge_nodes_map)[num_edges][nodes_per_edge]
static constexpr const unsigned int(& edge_nodes_map)[num_edges][nodes_per_edge]
static constexpr const unsigned int(& side_nodes_map)[num_sides][nodes_per_side]
static constexpr unsigned int edge_nodes_map[num_edges][nodes_per_edge]
This maps the node of the edge to element node numbers.
static constexpr unsigned int side_nodes_map[num_sides][nodes_per_side]
This maps the node of the side to element node numbers.
This class implements specific orders of Gauss quadrature.
This class implements nodal quadrature rules for various element types.
static constexpr unsigned int side_nodes_map[num_sides][nodes_per_side]
This maps the node of the side to element node numbers.
static constexpr const unsigned int(& side_nodes_map)[num_sides][nodes_per_side]
static constexpr const unsigned int(& side_nodes_map)[num_sides][nodes_per_side]
In parallel meshes where a ghost element has neighbors which do not exist on the local processor,...
This class defines a tensor in LIBMESH_DIM dimensional Real or Complex space.
static constexpr const unsigned int(& edge_nodes_map)[num_edges][nodes_per_edge]
static constexpr const unsigned int(& side_nodes_map)[num_sides][nodes_per_side]
static constexpr const unsigned int(& side_nodes_map)[num_sides][nodes_per_side]
static constexpr const unsigned int(& edge_nodes_map)[num_edges][nodes_per_edge]
static constexpr unsigned int edge_nodes_map[num_edges][nodes_per_edge]
This maps the node of the edge to element node numbers.
static constexpr unsigned int side_nodes_map[num_sides][nodes_per_side]
This maps the node of the side to element node numbers.
static constexpr unsigned int side_nodes_map[num_sides][nodes_per_side]
This maps the node of the side to element node numbers.
static constexpr const unsigned int(& side_nodes_map)[num_sides][nodes_per_side]
static constexpr const unsigned int(& side_nodes_map)[num_sides][nodes_per_side]
TypeTensor< T > inverse() const
bool absolute_fuzzy_equals(const TypeVector< T > &rhs, Real tol=TOLERANCE) const
LIBMESH_DEVICE_INLINE TypeVector< T > unit() const
LIBMESH_DEVICE_INLINE void add_scaled(const TypeVector< T2 > &, const T &)
Add a scaled value to this vector without creating a temporary.
void add(const TypeVector< T2 > &)
Add to this vector without creating a temporary.
void family_tree_by_subneighbor(T elem, std::vector< T > &family, T neighbor_in, T subneighbor, bool reset=true)
void find_interior_neighbors(T this_elem, std::set< T > &neighbor_set)
void total_family_tree_by_side(T elem, std::vector< T > &family, unsigned int s, bool reset)
void family_tree(T elem, std::vector< T > &family, bool reset=true)
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 active_family_tree(T elem, std::vector< T > &active_family, bool reset=true)
void find_point_neighbors(T this_elem, std::set< T > &neighbor_set, T start_elem)
void family_tree_by_neighbor(T elem, std::vector< T > &family, T neighbor_in, bool reset=true)
void total_family_tree(T elem, std::vector< T > &family, bool reset)
void total_family_tree_by_subneighbor(T elem, std::vector< T > &family, T neighbor_in, T subneighbor, bool reset=true)
void total_family_tree_by_neighbor(T elem, std::vector< T > &family, T neighbor_in, bool reset=true)
void active_family_tree_by_side(T elem, std::vector< T > &family, unsigned int side, bool reset=true)
void active_family_tree_by_neighbor(T elem, std::vector< T > &family, T neighbor_in, bool reset=true)
void family_tree_by_side(T elem, std::vector< T > &family, unsigned int s, bool reset)
const Elem & get(const ElemType type_in)
std::pair< std::unique_ptr< Elem >, std::vector< std::unique_ptr< Node > > > ideal_target(const ElemType type)
std::string enum_to_string(const T e)
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 ...
The libMesh namespace provides an interface to certain functionality in the library.
LIBMESH_DEVICE_INLINE T cross_norm(const TypeVector< T > &b, const TypeVector< T > &c)
Calls cross_norm_sq() and takes the square root of the result.
auto index_range(const T &sizable)
Helper function that returns an IntRange<std::size_t> representing all the indices of the passed-in v...
IOPackage
libMesh interfaces with several different software packages for the purposes of creating,...
LIBMESH_DEVICE_INLINE T triple_product(const TypeVector< T > &a, const TypeVector< T > &b, const TypeVector< T > &c)
ElemType
Defines an enum for geometric element types.
void libmesh_ignore(const Args &...)
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
Threads::spin_mutex parent_indices_mutex
Threads::spin_mutex parent_bracketing_nodes_mutex
const RemoteElem * remote_elem
ElemQuality
Defines an enum for element quality metrics.
static constexpr Real TOLERANCE
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
uint8_t processor_id_type
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...
The definition of the struct used for iterating over sides.
Used to iterate over the sides of an element which are on the boundary of the Mesh.