76 #ifdef LIBMESH_ENABLE_PERIODIC 252 return libmesh_make_unique<NodeElem>(p);
256 return libmesh_make_unique<Edge2>(p);
258 return libmesh_make_unique<Edge3>(p);
260 return libmesh_make_unique<Edge4>(p);
264 return libmesh_make_unique<Tri3>(p);
266 return libmesh_make_unique<TriShell3>(p);
268 return libmesh_make_unique<Tri3Subdivision>(p);
270 return libmesh_make_unique<Tri6>(p);
272 return libmesh_make_unique<Quad4>(p);
274 return libmesh_make_unique<QuadShell4>(p);
276 return libmesh_make_unique<Quad8>(p);
278 return libmesh_make_unique<QuadShell8>(p);
280 return libmesh_make_unique<Quad9>(p);
284 return libmesh_make_unique<Tet4>(p);
286 return libmesh_make_unique<Tet10>(p);
288 return libmesh_make_unique<Hex8>(p);
290 return libmesh_make_unique<Hex20>(p);
292 return libmesh_make_unique<Hex27>(p);
294 return libmesh_make_unique<Prism6>(p);
296 return libmesh_make_unique<Prism15>(p);
298 return libmesh_make_unique<Prism18>(p);
300 return libmesh_make_unique<Pyramid5>(p);
302 return libmesh_make_unique<Pyramid13>(p);
304 return libmesh_make_unique<Pyramid14>(p);
306 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 309 return libmesh_make_unique<InfEdge2>(p);
313 return libmesh_make_unique<InfQuad4>(p);
315 return libmesh_make_unique<InfQuad6>(p);
319 return libmesh_make_unique<InfHex8>(p);
321 return libmesh_make_unique<InfHex16>(p);
323 return libmesh_make_unique<InfHex18>(p);
325 return libmesh_make_unique<InfPrism6>(p);
327 return libmesh_make_unique<InfPrism12>(p);
331 libmesh_error_msg(
"ERROR: Undefined element type!");
348 for (
unsigned int n=0; n<this->
n_vertices(); n++)
349 cp.
add (this->point(n));
351 return (cp /= static_cast<Real>(this->
n_vertices()));
360 for (
unsigned int n_outer=0; n_outer<this->
n_vertices(); n_outer++)
361 for (
unsigned int n_inner=n_outer+1; n_inner<this->
n_vertices(); n_inner++)
368 return std::sqrt(h_min);
377 for (
unsigned int n_outer=0; n_outer<this->
n_vertices(); n_outer++)
378 for (
unsigned int n_inner=n_outer+1; n_inner<this->
n_vertices(); n_inner++)
385 return std::sqrt(h_max);
391 const unsigned int n2)
const 393 libmesh_assert_less ( n1, this->
n_vertices() );
394 libmesh_assert_less ( n2, this->
n_vertices() );
396 return (this->
point(n1) - this->
point(n2)).norm();
403 const unsigned short n_n = this->
n_nodes();
405 std::array<dof_id_type, Elem::max_n_nodes> node_ids;
407 for (
unsigned short n=0; n != n_n; ++n)
408 node_ids[n] = this->
node_id(n);
412 std::sort (node_ids.begin(), node_ids.begin()+n_n);
425 const unsigned short n_n = this->
n_nodes();
426 libmesh_assert_equal_to(n_n, rhs.
n_nodes());
430 std::array<dof_id_type, Elem::max_n_nodes> this_ids, rhs_ids;
432 for (
unsigned short n = 0; n != n_n; n++)
434 this_ids[n] = this->
node_id(n);
439 std::sort(this_ids.begin(), this_ids.begin()+n_n);
440 std::sort(rhs_ids.begin(), rhs_ids.begin()+n_n);
443 for (
unsigned short n = 0; n != n_n; ++n)
444 if (this_ids[n] != rhs_ids[n])
453 std::set<const Elem *> point_neighbors;
457 for (
const auto & elem : point_neighbors)
458 if (elem->processor_id() == my_pid)
469 for (
unsigned int n = 0; n != e->
n_vertices(); ++n)
479 unsigned int num_contained_edges = 0;
482 for (
unsigned int n = 0; n != e->
n_vertices(); ++n)
486 num_contained_edges++;
487 if (num_contained_edges>=2)
499 std::set<const Elem *> & neighbor_set)
const 502 libmesh_assert(this->
active());
504 neighbor_set.clear();
505 neighbor_set.insert(
this);
507 std::set<const Elem *> untested_set, next_untested_set;
508 untested_set.insert(
this);
510 while (!untested_set.empty())
514 for (
const auto & elem : untested_set)
515 for (
auto current_neighbor : elem->neighbor_ptr_range())
517 if (current_neighbor &&
520 if (current_neighbor->active())
522 if (current_neighbor->contains_point(p))
525 if (!neighbor_set.count(current_neighbor))
526 next_untested_set.insert (current_neighbor);
529 neighbor_set.insert (current_neighbor);
532 #ifdef LIBMESH_ENABLE_AMR 536 std::vector<const Elem *> active_neighbor_children;
538 current_neighbor->active_family_tree_by_neighbor
539 (active_neighbor_children, elem);
541 for (
const auto & current_child : active_neighbor_children)
542 if (current_child->contains_point(p))
545 if (!neighbor_set.count(current_child))
546 next_untested_set.insert (current_child);
548 neighbor_set.insert (current_child);
551 #endif // #ifdef LIBMESH_ENABLE_AMR 554 untested_set.swap(next_untested_set);
555 next_untested_set.clear();
569 const Elem * start_elem)
const 571 libmesh_assert(start_elem);
572 libmesh_assert(start_elem->
active());
576 neighbor_set.clear();
577 neighbor_set.insert(start_elem);
579 std::set<const Elem *> untested_set, next_untested_set;
580 untested_set.insert(start_elem);
582 while (!untested_set.empty())
586 for (
const auto & elem : untested_set)
587 for (
auto current_neighbor : elem->neighbor_ptr_range())
589 if (current_neighbor &&
592 if (current_neighbor->active())
595 || current_neighbor->contains_vertex_of(
this))
598 if (!neighbor_set.count(current_neighbor))
599 next_untested_set.insert (current_neighbor);
602 neighbor_set.insert (current_neighbor);
605 #ifdef LIBMESH_ENABLE_AMR 609 std::vector<const Elem *> active_neighbor_children;
611 current_neighbor->active_family_tree_by_neighbor
612 (active_neighbor_children, elem);
614 for (
const auto & current_child : active_neighbor_children)
620 if (!neighbor_set.count(current_child))
621 next_untested_set.insert (current_child);
623 neighbor_set.insert (current_child);
627 #endif // #ifdef LIBMESH_ENABLE_AMR 630 untested_set.swap(next_untested_set);
631 next_untested_set.clear();
639 std::set<const Elem *> & neighbor_set)
const 648 std::set<const Elem *>::iterator it = neighbor_set.begin();
649 const std::set<const Elem *>::iterator
end = neighbor_set.end();
655 if (!(*it)->contains_point(p2))
656 it = neighbor_set.erase(it);
666 neighbor_set.clear();
667 neighbor_set.insert(
this);
669 std::set<const Elem *> untested_set, next_untested_set;
670 untested_set.insert(
this);
672 while (!untested_set.empty())
676 for (
const auto & elem : untested_set)
678 for (
auto current_neighbor : elem->neighbor_ptr_range())
680 if (current_neighbor &&
683 if (current_neighbor->active())
686 || current_neighbor->contains_edge_of(
this))
689 if (!neighbor_set.count(current_neighbor))
690 next_untested_set.insert (current_neighbor);
693 neighbor_set.insert (current_neighbor);
696 #ifdef LIBMESH_ENABLE_AMR 700 std::vector<const Elem *> active_neighbor_children;
702 current_neighbor->active_family_tree_by_neighbor
703 (active_neighbor_children, elem);
705 for (
const auto & current_child : active_neighbor_children)
706 if (this->
contains_edge_of(current_child) || current_child->contains_edge_of(
this))
709 if (!neighbor_set.count(current_child))
710 next_untested_set.insert (current_child);
712 neighbor_set.insert (current_child);
715 #endif // #ifdef LIBMESH_ENABLE_AMR 719 untested_set.swap(next_untested_set);
720 next_untested_set.clear();
727 neighbor_set.clear();
729 if ((this->
dim() >= LIBMESH_DIM) ||
739 #ifdef LIBMESH_ENABLE_AMR 765 std::set<const Elem *>::iterator it = neighbor_set.begin();
766 const std::set<const Elem *>::iterator
end = neighbor_set.end();
770 std::set<const Elem *>::iterator current = it++;
771 const Elem * elem = *current;
777 unsigned int vertices_contained = 0;
780 vertices_contained++;
782 if (vertices_contained <= this->
dim())
784 neighbor_set.erase(current);
794 neighbor_set.erase(current);
807 libmesh_assert_less (this->
dim(), LIBMESH_DIM);
825 libmesh_assert (!interior_p ||
827 (interior_p->
dim() > this->
dim()));
832 libmesh_assert_less_equal (interior_p->
level(), this->
level());
842 libmesh_assert_less (this->
dim(), LIBMESH_DIM);
845 libmesh_assert (!interior_p ||
847 (interior_p->
dim() > this->
dim()));
849 libmesh_assert_less_equal (interior_p->
level(), this->
level());
859 libmesh_assert_less (this->
dim(), LIBMESH_DIM);
867 libmesh_assert (!p ||
869 (p->
dim() > this->
dim()));
876 #ifdef LIBMESH_ENABLE_PERIODIC 886 if (neighbor_i !=
nullptr)
894 std::vector<boundary_id_type> bc_ids;
895 mesh.get_boundary_info().boundary_ids(
this, cast_int<unsigned short>(i), bc_ids);
896 for (
const auto &
id : bc_ids)
902 const Elem *
const cn = pb->
neighbor(
id, point_locator,
this, i);
903 neighbor_i =
const_cast<Elem *
>(cn);
910 neighbor_i = neighbor_i->
parent();
928 if (neighbor_i !=
nullptr)
936 std::vector<boundary_id_type> bc_ids;
937 mesh.get_boundary_info().boundary_ids(
this, cast_int<unsigned short>(i), bc_ids);
938 for (
const auto &
id : bc_ids)
941 neighbor_i = pb->
neighbor(
id, point_locator,
this, i);
948 neighbor_i = neighbor_i->
parent();
981 for (
unsigned int n=0; n != this->
n_nodes(); ++n)
1006 const Elem * elem =
this;
1014 for (elem =
this; !elem->active();
1015 elem = elem->parent())
1016 libmesh_assert(elem);
1027 libmesh_assert(elem->parent());
1028 elem = elem->parent();
1036 for (; elem != nn; elem = elem->
parent())
1037 libmesh_assert(elem);
1052 (my_parent->
dim() == this->
dim()))
1067 libmesh_assert(neigh);
1071 libmesh_assert_less_equal (neigh->
level(), this->
level());
1079 libmesh_assert((neigh->
level() == this->
level()) ||
1091 const std::unique_ptr<Elem> my_side = this->
side_ptr(n);
1092 unsigned int nn = 0;
1093 for (; nn != neigh->
n_sides(); ++nn)
1095 const std::unique_ptr<Elem> neigh_side = neigh->
side_ptr(nn);
1096 if (*my_side == *neigh_side)
1101 libmesh_assert_less (nn, neigh->
n_sides());
1104 std::vector<const Elem *> neigh_family;
1105 #ifdef LIBMESH_ENABLE_AMR 1110 neigh_family.push_back(neigh);
1113 for (
auto & const_elem : neigh_family)
1118 Elem * neigh_family_member =
const_cast<Elem *
>(const_elem);
1131 #ifdef LIBMESH_ENABLE_AMR 1132 libmesh_assert((neigh_family_member->
neighbor_ptr(nn) &&
1137 (this->
parent() !=
nullptr) &&
1140 libmesh_assert((neigh_family_member->
neighbor_ptr(nn) ==
this) ||
1154 #if defined(LIBMESH_ENABLE_AMR) && defined(DEBUG) 1167 libmesh_assert_greater_equal (this->
level(), neigh->level());
1169 if (this->
level() == neigh->level() &&
1170 neigh->has_neighbor(
this))
1172 #ifdef LIBMESH_ENABLE_AMR 1175 std::vector<const Elem *> family;
1176 neigh->total_family_tree_by_neighbor (family,
this);
1181 for (
auto & const_elem : family)
1183 Elem * n =
const_cast<Elem *
>(const_elem);
1193 unsigned int my_s = neigh->which_neighbor_am_i(
this);
1194 libmesh_assert_less (my_s, neigh->n_neighbors());
1195 libmesh_assert_equal_to (neigh->neighbor_ptr(my_s),
this);
1196 neigh->set_neighbor(my_s, const_cast<RemoteElem *>(
remote_elem));
1199 #ifdef LIBMESH_ENABLE_AMR 1202 else if (neigh->has_children())
1206 libmesh_assert(this->
level() > neigh->level() ||
1212 libmesh_assert(my_ancestor);
1213 while (!neigh->has_neighbor(my_ancestor))
1215 my_ancestor = my_ancestor->parent();
1216 libmesh_assert(my_ancestor);
1221 std::vector<const Elem *> family;
1222 neigh->total_family_tree_by_subneighbor (family, my_ancestor,
this);
1227 for (
auto & const_elem : family)
1229 Elem * n =
const_cast<Elem *
>(const_elem);
1243 #ifdef LIBMESH_ENABLE_AMR 1250 this->
dim() == my_parent->
dim())
1253 libmesh_assert_equal_to (my_parent->
child_ptr(me),
this);
1265 #ifdef LIBMESH_ENABLE_AMR 1276 libmesh_assert_greater_equal (this->
level(), neigh->level());
1278 if (this->
level() == neigh->level() &&
1279 neigh->has_neighbor(
this))
1281 #ifdef LIBMESH_ENABLE_AMR 1284 std::vector<const Elem *> family;
1285 neigh->total_family_tree_by_neighbor (family,
this);
1290 for (
auto & const_elem : family)
1292 Elem * n =
const_cast<Elem *
>(const_elem);
1302 unsigned int my_s = neigh->which_neighbor_am_i(
this);
1303 libmesh_assert_less (my_s, neigh->n_neighbors());
1304 libmesh_assert_equal_to (neigh->neighbor(my_s),
this);
1305 neigh->set_neighbor(my_s,
nullptr);
1308 #ifdef LIBMESH_ENABLE_AMR 1311 else if (neigh->has_children())
1315 libmesh_assert(this->
level() > neigh->level() ||
1321 libmesh_assert(my_ancestor);
1322 while (!neigh->has_neighbor(my_ancestor))
1324 my_ancestor = my_ancestor->parent();
1325 libmesh_assert(my_ancestor);
1330 std::vector<const Elem *> family;
1331 neigh->total_family_tree_by_subneighbor (family, my_ancestor,
this);
1336 for (
auto & const_elem : family)
1338 Elem * n =
const_cast<Elem *
>(const_elem);
1352 #ifdef LIBMESH_ENABLE_AMR 1354 libmesh_assert (!this->
parent());
1363 libmesh_assert (out_stream.good());
1373 std::vector<dof_id_type> conn;
1374 for (
unsigned int sc=0; sc <this->
n_sub_elem(); sc++)
1378 std::copy(conn.begin(),
1380 std::ostream_iterator<dof_id_type>(out_stream,
" "));
1390 out_stream << this->
node_id(i)+1 <<
"\t";
1397 libmesh_error_msg(
"Unsupported IO package " << iop);
1412 libmesh_do_once( libmesh_here();
1417 <<
"Cowardly returning 1." 1429 #ifdef LIBMESH_ENABLE_AMR 1432 const bool is_ancestor =
1443 libmesh_assert(!c.active());
1444 libmesh_assert(!c.ancestor());
1459 #ifdef LIBMESH_ENABLE_AMR 1469 for (
unsigned int c = 0; c != nc; c++)
1473 for (
unsigned int c = 0; c != nc; c++)
1477 libmesh_assert_equal_to (
this, elem->
parent());
1483 libmesh_error_msg(
"Error: Tried to add a child to an element with full children array");
1495 for (
unsigned int i = 0; i != nc; i++)
1519 const unsigned int e)
const 1522 libmesh_assert_less (e, this->
n_edges());
1525 std::unique_ptr<const Elem> child_edge = this->
build_edge_ptr(e);
1529 return (child_edge->node_id(0) == my_edge->node_id(0) ||
1530 child_edge->node_id(1) == my_edge->node_id(1));
1535 const bool reset)
const 1545 family.push_back(
this);
1552 c.family_tree (family,
false);
1558 const bool reset)
const 1565 family.push_back(
this);
1572 c.total_family_tree (family,
false);
1578 const bool reset)
const 1585 active_family.clear();
1589 active_family.push_back(
this);
1596 c.active_family_tree (active_family,
false);
1602 const unsigned int s,
1603 const bool reset)
const 1612 libmesh_assert_less (s, this->
n_sides());
1615 family.push_back(
this);
1622 for (
unsigned int c = 0; c != nc; c++)
1631 const unsigned int s,
1632 const bool reset)
const 1642 libmesh_assert_less (s, this->
n_sides());
1646 family.push_back(
this);
1653 for (
unsigned int c = 0; c != nc; c++)
1662 const Elem * neighbor_in,
1663 const bool reset)
const 1676 family.push_back(
this);
1683 c.family_tree_by_neighbor (family, neighbor_in,
false);
1689 const Elem * neighbor_in,
1690 const bool reset)
const 1700 family.push_back(
this);
1707 c.total_family_tree_by_neighbor (family, neighbor_in,
false);
1713 const Elem * neighbor_in,
1714 const Elem * subneighbor,
1715 const bool reset)
const 1725 libmesh_assert (neighbor_in);
1726 libmesh_assert_not_equal_to (neighbor_in,
remote_elem);
1730 libmesh_assert (subneighbor);
1731 libmesh_assert_not_equal_to (subneighbor,
remote_elem);
1735 if (neighbor_in == subneighbor)
1736 family.push_back(
this);
1743 for (
auto child_neigh : c.neighbor_ptr_range())
1745 (child_neigh == neighbor_in ||
1746 (child_neigh->parent() == neighbor_in &&
1748 c.family_tree_by_subneighbor (family, child_neigh,
1749 subneighbor,
false);
1755 const Elem * neighbor_in,
1756 const Elem * subneighbor,
1757 const bool reset)
const 1764 libmesh_assert (neighbor_in);
1765 libmesh_assert_not_equal_to (neighbor_in,
remote_elem);
1769 libmesh_assert (subneighbor);
1770 libmesh_assert_not_equal_to (subneighbor,
remote_elem);
1774 if (neighbor_in == subneighbor)
1775 family.push_back(
this);
1782 for (
auto child_neigh : c.neighbor_ptr_range())
1784 (child_neigh == neighbor_in ||
1785 (child_neigh->parent() == neighbor_in &&
1787 c.total_family_tree_by_subneighbor
1788 (family, child_neigh, subneighbor,
false);
1796 const Elem * neighbor_in,
1800 const bool reset)
const 1822 family.push_back(
this);
1826 else if (!this->
active())
1831 c.active_family_tree_by_topological_neighbor
1832 (family, neighbor_in,
mesh, point_locator, pb,
false);
1838 const Elem * neighbor_in,
1839 const bool reset)
const 1858 family.push_back(
this);
1862 else if (!this->
active())
1865 c.active_family_tree_by_neighbor (family, neighbor_in,
false);
1871 unsigned int current_min)
const 1874 libmesh_assert(neighbor_in->
active());
1885 if (current_min <= this->
p_level())
1888 unsigned int min_p_level = current_min;
1893 c.min_p_level_by_neighbor(neighbor_in, min_p_level);
1900 unsigned int current_min)
const 1903 libmesh_assert(neighbor_in->
active());
1908 unsigned int new_p_level = this->
p_level();
1913 libmesh_assert_greater (new_p_level, 0);
1916 return std::min(current_min, new_p_level);
1921 unsigned int min_p_level = current_min;
1926 c.min_new_p_level_by_neighbor(neighbor_in, min_p_level);
1934 unsigned int child_node)
const 1937 libmesh_assert_less(
child, nc);
1941 std::vector<std::vector<std::vector<signed char>>> &
1950 if (em_vers >= cached_parent_indices.size())
1951 cached_parent_indices.resize(em_vers+1);
1953 if (
child >= cached_parent_indices[em_vers].size())
1955 const signed char nn = cast_int<signed char>(this->
n_nodes());
1957 cached_parent_indices[em_vers].resize(nc);
1959 for (
unsigned int c = 0; c != nc; ++c)
1962 cached_parent_indices[em_vers][c].resize(ncn);
1963 for (
unsigned int cn = 0; cn != ncn; ++cn)
1965 for (
signed char n = 0; n != nn; ++n)
1971 cached_parent_indices[em_vers][c][cn] = n;
1977 cached_parent_indices[em_vers][c][cn] =
1984 libmesh_assert_not_equal_to (n+1, nn);
1990 const signed char cache_val =
1991 cached_parent_indices[em_vers][
child][child_node];
1992 if (cache_val == -1)
1995 return cached_parent_indices[em_vers][
child][child_node];
2000 const std::vector<std::pair<unsigned char, unsigned char>> &
2002 unsigned int child_node)
const 2006 std::vector<std::vector<std::vector<std::vector<std::pair<unsigned char, unsigned char>>>>> &
2015 if (cached_bracketing_nodes.size() <= em_vers)
2016 cached_bracketing_nodes.resize(em_vers+1);
2022 if (cached_bracketing_nodes[em_vers].size() < nc)
2033 libmesh_assert_equal_to
2040 std::unique_ptr<Elem> full_elem =
Elem::build(full_type);
2045 libmesh_assert_equal_to(em_vers, 0);
2051 full_elem->parent_bracketing_nodes(0,0);
2060 cached_bracketing_nodes =
2061 full_elem->_get_bracketing_node_cache();
2064 return cached_bracketing_nodes[em_vers][
child][child_node];
2067 cached_bracketing_nodes[em_vers].resize(nc);
2069 const unsigned int nn = this->
n_nodes();
2072 for (
unsigned int c = 0; c != nc; ++c)
2076 cached_bracketing_nodes[em_vers][c].resize(ncn);
2079 for (
unsigned int n = 0; n != ncn; ++n)
2085 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
2094 for (
unsigned int pn = 0; pn != nn; ++pn)
2096 const float em_val =
2099 libmesh_assert_not_equal_to (em_val, 1);
2106 for (
unsigned int n1 = 0; n1 != ncn; ++n1)
2111 unsigned int parent_n1 =
2119 for (
unsigned int n2 = n1+1; n2 < nn; ++n2)
2124 unsigned int parent_n2 =
2132 Point pmid = (p1 + p2)/2;
2134 if (pmid == bracketed_pt)
2136 cached_bracketing_nodes[em_vers][c][n].push_back
2137 (std::make_pair(parent_n1,parent_n2));
2158 for (
unsigned int pn = 0; pn != nn; ++pn)
2160 const float em_val =
2163 libmesh_assert_not_equal_to (em_val, 1);
2172 for (
unsigned int n1 = 0; n1 != nn; ++n1)
2174 if (n1 == parent_node)
2179 for (
unsigned int n2 = n1+1; n2 < nn; ++n2)
2181 if (n2 == parent_node)
2186 if (pmid == bracketed_pt)
2188 cached_bracketing_nodes[em_vers][c][n].push_back
2189 (std::make_pair(n1,n2));
2201 return cached_bracketing_nodes[em_vers][
child][child_node];
2205 const std::vector<std::pair<dof_id_type, dof_id_type>>
2207 unsigned int child_node)
const 2209 std::vector<std::pair<dof_id_type, dof_id_type>> returnval;
2211 const std::vector<std::pair<unsigned char, unsigned char>> & pbc =
2214 for (
const auto & pb : pbc)
2216 const unsigned short n_n = this->
n_nodes();
2217 if (pb.first < n_n && pb.second < n_n)
2218 returnval.push_back(std::make_pair(this->
node_id(pb.first),
2219 this->node_id(pb.second)));
2224 libmesh_assert_not_equal_to
2227 libmesh_assert_equal_to
2236 std::unique_ptr<Elem> full_elem =
Elem::build(full_type);
2246 for (
unsigned int c=0; c <=
child; ++c)
2249 if (c ==
child && n == child_node)
2252 if (pb.first == full_elem->as_parent_node(c,n))
2261 if (pb.second == full_elem->as_parent_node(c,n))
2290 returnval.push_back(std::make_pair(pt1, pt2));
2296 #endif // #ifdef LIBMESH_ENABLE_AMR 2311 <<
"WARNING: Resizing bounding box to match user-specified tolerance!\n" 2312 <<
"In the future, calls to Elem::contains_point() with tol > TOLERANCE\n" 2313 <<
"will be more optimized, but should not be used\n" 2314 <<
"to search for points 'close to' elements!\n" 2315 <<
"Instead, use Elem::close_to_point() for this purpose.\n" 2340 libmesh_assert_greater (box_tol, 0.);
2341 libmesh_assert_greater (map_tol, 0.);
2351 point_above_min_z =
false,
2352 point_below_max_z =
false,
2355 point_above_min_y =
false,
2356 point_below_max_y =
false,
2358 point_above_min_x =
false,
2359 point_below_max_x =
false;
2366 point_above_min_x = point_above_min_x || (n(0) - my_hmax*box_tol <= p(0));
2367 point_below_max_x = point_below_max_x || (n(0) + my_hmax*box_tol >= p(0));
2369 point_above_min_y = point_above_min_y || (n(1) - my_hmax*box_tol <= p(1));
2370 point_below_max_y = point_below_max_y || (n(1) + my_hmax*box_tol >= p(1));
2373 point_above_min_z = point_above_min_z || (n(2) - my_hmax*box_tol <= p(2));
2374 point_below_max_z = point_below_max_z || (n(2) + my_hmax*box_tol >= p(2));
2380 !point_above_min_z ||
2381 !point_below_max_z ||
2384 !point_above_min_y ||
2385 !point_below_max_y ||
2387 !point_above_min_x ||
2412 if (this->
dim() < 3)
2421 Real dist = (xyz - p).norm();
2428 if (dist > this->
hmax() * map_tol)
2450 std::ostringstream oss;
2452 oss <<
" Elem Information" <<
'\n' 2460 #ifdef LIBMESH_ENABLE_UNIQUE_ID 2461 oss <<
", unique_id()=";
2468 oss <<
", processor_id()=" << this->
processor_id() <<
'\n';
2471 <<
" dim()=" << this->
dim() <<
'\n' 2472 <<
" n_nodes()=" << this->
n_nodes() <<
'\n';
2474 for (
unsigned int n=0; n != this->
n_nodes(); ++n)
2475 oss <<
" " << n << this->
node_ref(n);
2477 oss <<
" n_sides()=" << this->
n_sides() <<
'\n';
2479 for (
unsigned int s=0; s != this->
n_sides(); ++s)
2481 oss <<
" neighbor(" << s <<
")=";
2488 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 2492 oss <<
" hmin()=" << this->
hmin()
2493 <<
", hmax()=" << this->
hmax() <<
'\n' 2494 <<
" volume()=" << this->
volume() <<
'\n';
2495 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 2498 oss <<
" active()=" << this->
active()
2499 <<
", ancestor()=" << this->
ancestor()
2500 <<
", subactive()=" << this->
subactive()
2504 oss << this->
parent()->
id() <<
'\n';
2507 oss <<
" level()=" << this->
level()
2508 <<
", p_level()=" << this->
p_level() <<
'\n' 2509 #ifdef LIBMESH_ENABLE_AMR 2513 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 2514 <<
" infinite()=" << this->
infinite() <<
'\n';
2516 oss <<
" origin()=" << this->
origin() <<
'\n' 2521 for (
unsigned int s=0; s != this->
n_systems(); ++s)
2522 for (
unsigned int v=0; v != this->
n_vars(s); ++v)
2523 for (
unsigned int c=0; c != this->
n_comp(s,v); ++c)
2524 oss <<
'(' << s <<
'/' << v <<
'/' << this->
dof_number(s,v,c) <<
") ";
2539 if (current_neighbor && current_neighbor !=
remote_elem)
2544 if (current_neighbor->
level() == this->
level())
2547 libmesh_assert_less (w_n_a_i, current_neighbor->
n_neighbors());
2567 const unsigned int)
const 2575 std::pair<unsigned short int, unsigned short int>
2579 return std::pair<unsigned short int, unsigned short int>(0,0);
2620 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 2644 const bool full_ordered)
2752 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 2837 const std::vector<Real> & JxW = fe->get_JxW();
2843 fe->attach_quadrature_rule(&qrule);
2848 for (
unsigned int qp=0; qp<qrule.n_points(); ++qp)
2862 unsigned int n_points = this->
n_nodes();
2863 for (
unsigned int p=0; p != n_points; ++p)
2864 for (
unsigned d=0; d<LIBMESH_DIM; ++d)
2867 if (pmin(d) > pt(d))
2870 if (pmax(d) < pt(d))
2880 unsigned int n)
const 2882 #ifdef LIBMESH_ENABLE_AMR 2884 unsigned int my_n_vertices = this->
n_vertices();
2885 for (
unsigned int n_parent = 0; n_parent != my_n_vertices;
2895 libmesh_error_msg(
"ERROR: AMR disabled, how did we get here?");
2906 libmesh_not_implemented();
2912 const unsigned int )
const 2915 libmesh_not_implemented();
Manages the family, order, etc. parameters for a given FE.
void total_family_tree_by_subneighbor(std::vector< const Elem *> &family, const Elem *neighbor, const Elem *subneighbor, const bool reset=true) const
bool has_neighbor(const Elem *elem) const
virtual bool is_vertex_on_parent(unsigned int c, unsigned int n) const
static Point map(unsigned int dim, const FEType &fe_t, const Elem *elem, const Point &p)
RefinementState refinement_flag() const
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
const Elem * parent() const
virtual const std::vector< std::pair< dof_id_type, dof_id_type > > bracketing_nodes(unsigned int c, unsigned int n) const
void print_info(std::ostream &os=libMesh::out) const
bool is_ancestor_of(const Elem *descendant) const
void family_tree_by_neighbor(std::vector< const Elem *> &family, const Elem *neighbor, const bool reset=true) const
virtual Point origin() const
const unsigned int invalid_uint
unsigned int n_comp(const unsigned int s, const unsigned int var) const
std::string get_info() const
static const unsigned int type_to_n_sides_map[INVALID_ELEM]
const Elem * interior_parent() const
const Elem * topological_neighbor(const unsigned int i, const MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb) const
bool is_semilocal(const processor_id_type my_pid) const
IntRange< unsigned short > side_index_range() const
void libmesh_assert_valid_node_pointers() const
virtual dof_id_type key() const
void add_scaled(const TypeVector< T2 > &, const T)
Maps between boundary ids and PeriodicBoundaryBase objects.
virtual unsigned int embedding_matrix_version() const
virtual bool is_child_on_side(const unsigned int c, const unsigned int s) const =0
RefinementState p_refinement_flag() const
void find_interior_neighbors(std::set< const Elem *> &neighbor_set) const
Threads::spin_mutex parent_indices_mutex
The base class for all geometric element types.
uint8_t processor_id_type
PeriodicBoundaryBase * boundary(boundary_id_type id)
void add_child(Elem *elem)
virtual BoundingBox loose_bounding_box() const
unsigned int min_new_p_level_by_neighbor(const Elem *neighbor, unsigned int current_min) const
virtual float embedding_matrix(const unsigned int child_num, const unsigned int child_node_num, const unsigned int parent_node_num) const =0
unique_id_type unique_id() const
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
side_iterator boundary_sides_end()
static const Real TOLERANCE
void active_family_tree(std::vector< const Elem *> &active_family, const bool reset=true) 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, const bool reset=true) const
void make_links_to_me_remote()
virtual Real hmax() const
long double max(long double a, double b)
unsigned int min_p_level_by_neighbor(const Elem *neighbor, unsigned int current_min) const
void set_interior_parent(Elem *p)
static const unsigned int type_to_n_nodes_map[INVALID_ELEM]
void total_family_tree(std::vector< const Elem *> &active_family, const bool reset=true) const
SimpleRange< ChildRefIter > child_ref_range()
void family_tree_by_side(std::vector< const Elem *> &family, const unsigned int side, const bool reset=true) const
void add(const TypeVector< T2 > &)
bool has_topological_neighbor(const Elem *elem, const MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb) const
side_iterator boundary_sides_begin()
uint32_t hashword(const uint32_t *k, size_t length, uint32_t initval=0)
void total_family_tree_by_neighbor(std::vector< const Elem *> &family, const Elem *neighbor, const bool reset=true) const
void replace_child(Elem *elem, unsigned int c)
void libmesh_ignore(const Args &...)
static const subdomain_id_type invalid_subdomain_id
void remove_links_to_me()
virtual std::vector< std::vector< std::vector< signed char > > > & _get_parent_indices_cache() const
virtual bool contains_point(const Point &p, Real tol=TOLERANCE) const
Real length(const unsigned int n1, const unsigned int n2) const
void active_family_tree_by_side(std::vector< const Elem *> &family, const unsigned int side, const bool reset=true) const
const Node & node_ref(const unsigned int i) const
virtual Real hmin() const
virtual unsigned int n_nodes() const =0
static const unsigned int type_to_n_edges_map[INVALID_ELEM]
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
virtual unsigned int as_parent_node(unsigned int c, unsigned int n) const
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
void find_point_neighbors(const Point &p, std::set< const Elem *> &neighbor_set) const
bool point_test(const Point &p, Real box_tol, Real map_tol) const
static std::unique_ptr< FEGenericBase > build(const unsigned int dim, const FEType &type)
void family_tree(std::vector< const Elem *> &family, const bool reset=true) const
static const dof_id_type invalid_id
Threads::spin_mutex parent_bracketing_nodes_mutex
const Elem * reference_elem() const
static Point inverse_map(const unsigned int dim, const FEType &fe_t, const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true)
void libmesh_assert_valid_neighbors() const
virtual bool is_remote() const
bool valid_unique_id() const
OStreamProxy err(std::cerr)
virtual unsigned int n_edges() const =0
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
void set_neighbor(const unsigned int i, Elem *n)
static bool on_reference_element(const Point &p, const ElemType t, const Real eps=TOLERANCE)
static ElemType second_order_equivalent_type(const ElemType et, const bool full_ordered=true)
unsigned int which_child_am_i(const Elem *e) const
bool contains_vertex_of(const Elem *e) const
std::string enum_to_string(const T e)
void active_family_tree_by_neighbor(std::vector< const Elem *> &family, const Elem *neighbor, const bool reset=true) const
Elem * child(const unsigned int i) const
SimpleRange< NodeRefIter > node_ref_range()
virtual unsigned int is_vertex_on_child(unsigned int, unsigned int n) const
virtual unsigned int n_sides() const =0
const Elem * neighbor_ptr(unsigned int i) const
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
const Elem * neighbor(boundary_id_type boundary_id, const PointLocatorBase &point_locator, const Elem *e, unsigned int side) const
virtual unsigned short dim() const =0
const Node * node_ptr(const unsigned int i) const
virtual Point master_point(const unsigned int i) const =0
unsigned int n_neighbors() const
virtual Real quality(const ElemQuality q) const
virtual unsigned short int second_order_adjacent_vertex(const unsigned int n, const unsigned int v) const
virtual Real volume() const
Implements 1, 2, and 3D "Gaussian" quadrature rules.
void set_child(unsigned int c, Elem *elem)
virtual void connectivity(const unsigned int sc, const IOPackage iop, std::vector< dof_id_type > &conn) const =0
IntRange< unsigned short > node_index_range() const
SimpleRange< NeighborPtrIter > neighbor_ptr_range()
virtual bool infinite() const =0
virtual unsigned int n_sub_elem() const =0
virtual std::unique_ptr< Elem > build_edge_ptr(const unsigned int i)=0
void make_links_to_me_local(unsigned int n)
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
virtual unsigned int opposite_side(const unsigned int s) const
static ElemType first_order_equivalent_type(const ElemType et)
processor_id_type processor_id() const
virtual ElemType type() const =0
long double min(long double a, double b)
A geometric point in (x,y,z) space.
dof_id_type node_id(const unsigned int i) const
const Point & point(const unsigned int i) const
virtual Point centroid() const
bool operator==(const Elem &rhs) const
bool has_children() const
virtual bool is_child_on_edge(const unsigned int c, const unsigned int e) const
const Elem & get(const ElemType type_in)
virtual unsigned int n_nodes_in_child(unsigned int) const
static const unsigned int max_n_nodes
const Elem * child_ptr(unsigned int i) const
void family_tree_by_subneighbor(std::vector< const Elem *> &family, const Elem *neighbor, const Elem *subneighbor, const bool reset=true) const
virtual bool is_mid_infinite_edge_node(const unsigned int) const
const RemoteElem * remote_elem