libMesh
elem.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2019 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
8 
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
13 
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 
18 
19 
20 #ifndef LIBMESH_ELEM_H
21 #define LIBMESH_ELEM_H
22 
23 // Local includes
24 #include "libmesh/libmesh_common.h"
25 #include "libmesh/bounding_box.h"
26 #include "libmesh/dof_object.h"
27 #include "libmesh/id_types.h"
28 #include "libmesh/reference_counted_object.h"
29 #include "libmesh/node.h"
30 #include "libmesh/enum_elem_type.h" // INVALID_ELEM
31 #include "libmesh/multi_predicates.h"
32 #include "libmesh/pointer_to_pointer_iter.h"
33 #include "libmesh/int_range.h"
34 #include "libmesh/simple_range.h"
35 #include "libmesh/variant_filter_iterator.h"
36 #include "libmesh/hashword.h" // Used in compute_key() functions
37 
38 #ifdef LIBMESH_FORWARD_DECLARE_ENUMS
39 namespace libMesh
40 {
41 enum ElemQuality : int;
42 enum IOPackage : int;
43 enum Order : int;
44 }
45 #else
46 #include "libmesh/enum_elem_quality.h"
47 #include "libmesh/enum_io_package.h"
48 #include "libmesh/enum_order.h"
49 #endif
50 
51 // C++ includes
52 #include <algorithm>
53 #include <cstddef>
54 #include <iostream>
55 #include <limits.h> // CHAR_BIT
56 #include <set>
57 #include <vector>
58 #include <memory>
59 
60 namespace libMesh
61 {
62 
63 // Forward declarations
64 class MeshBase;
65 class MeshRefinement;
66 class Elem;
67 #ifdef LIBMESH_ENABLE_PERIODIC
68 class PeriodicBoundaries;
69 class PointLocatorBase;
70 #endif
71 
72 
100 class Elem : public ReferenceCountedObject<Elem>,
101  public DofObject
102 {
103 protected:
104 
111  Elem (const unsigned int n_nodes,
112  const unsigned int n_sides,
113  Elem * parent,
114  Elem ** elemlinkdata,
115  Node ** nodelinkdata);
116 
117 public:
118 
128  Elem (Elem &&) = delete;
129  Elem (const Elem &) = delete;
130  Elem & operator= (const Elem &) = delete;
131  Elem & operator= (Elem &&) = delete;
132 
136  virtual ~Elem();
137 
141  const Point & point (const unsigned int i) const;
142 
147  Point & point (const unsigned int i);
148 
153  virtual Point master_point (const unsigned int i) const = 0;
154 
158  dof_id_type node_id (const unsigned int i) const;
159 
164  unsigned int local_node (const dof_id_type i) const;
165 
170  unsigned int get_node_index (const Node * node_ptr) const;
171 
175  const Node * const * get_nodes () const;
176 
180  const Node * node_ptr (const unsigned int i) const;
181 
185  Node * node_ptr (const unsigned int i);
186 
190  const Node & node_ref (const unsigned int i) const;
191 
195  Node & node_ref (const unsigned int i);
196 
200  virtual Node * & set_node (const unsigned int i);
201 
205  class NodeRefIter;
206  class ConstNodeRefIter;
207 
216 
218 
223 
229 
245 
254  const Elem * reference_elem () const;
255 
261  virtual dof_id_type key (const unsigned int s) const = 0;
262 
269  virtual dof_id_type key () const;
270 
277  bool operator == (const Elem & rhs) const;
278 
288  const Elem * neighbor_ptr (unsigned int i) const;
289 
293  Elem * neighbor_ptr (unsigned int i);
294 
298  typedef Elem * const * NeighborPtrIter;
299  typedef const Elem * const * ConstNeighborPtrIter;
300 
310 
312 
313 #ifdef LIBMESH_ENABLE_PERIODIC
314 
320  const Elem * topological_neighbor (const unsigned int i,
321  const MeshBase & mesh,
322  const PointLocatorBase & point_locator,
323  const PeriodicBoundaries * pb) const;
324 
331  Elem * topological_neighbor (const unsigned int i,
332  MeshBase & mesh,
333  const PointLocatorBase & point_locator,
334  const PeriodicBoundaries * pb);
335 
340  bool has_topological_neighbor (const Elem * elem,
341  const MeshBase & mesh,
342  const PointLocatorBase & point_locator,
343  const PeriodicBoundaries * pb) const;
344 #endif
345 
349  void set_neighbor (const unsigned int i, Elem * n);
350 
355  bool has_neighbor (const Elem * elem) const;
356 
361  Elem * child_neighbor (Elem * elem);
362 
367  const Elem * child_neighbor (const Elem * elem) const;
368 
374  bool on_boundary () const;
375 
380  bool is_semilocal (const processor_id_type my_pid) const;
381 
387  unsigned int which_neighbor_am_i(const Elem * e) const;
388 
405  unsigned int which_side_am_i(const Elem * e) const;
406 
417  virtual unsigned int which_node_am_i(unsigned int side,
418  unsigned int side_node) const = 0;
419 
424  bool contains_vertex_of(const Elem * e) const;
425 
431  bool contains_edge_of(const Elem * e) const;
432 
449  void find_point_neighbors(const Point & p,
450  std::set<const Elem *> & neighbor_set) const;
451 
457  void find_point_neighbors(std::set<const Elem *> & neighbor_set) const;
458 
464  void find_point_neighbors(std::set<const Elem *> & neighbor_set,
465  const Elem * start_elem) const;
466 
470  void find_point_neighbors(std::set<Elem *> & neighbor_set,
471  Elem * start_elem);
472 
478  void find_edge_neighbors(const Point & p1,
479  const Point & p2,
480  std::set<const Elem *> & neighbor_set) const;
481 
490  void find_edge_neighbors(std::set<const Elem *> & neighbor_set) const;
491 
497  void find_interior_neighbors(std::set<const Elem *> & neighbor_set) const;
498 
503  void find_interior_neighbors(std::set<Elem *> & neighbor_set);
504 
512  void remove_links_to_me ();
513 
521  void make_links_to_me_remote ();
522 
529  void make_links_to_me_local (unsigned int n, unsigned int neighbor_side);
530 
542  virtual bool is_remote () const
543  { return false; }
544 
549  virtual void connectivity(const unsigned int sc,
550  const IOPackage iop,
551  std::vector<dof_id_type> & conn) const = 0;
552 
558  void write_connectivity (std::ostream & out,
559  const IOPackage iop) const;
560 
565  virtual ElemType type () const = 0;
566 
570  virtual unsigned short dim () const = 0;
571 
576  static const unsigned int type_to_n_nodes_map[INVALID_ELEM];
577 
581  virtual unsigned int n_nodes () const = 0;
582 
587  static const unsigned int max_n_nodes = 27;
588 
594 
600  virtual unsigned int n_nodes_in_child (unsigned int /*c*/) const
601  { return this->n_nodes(); }
602 
607  static const unsigned int type_to_n_sides_map[INVALID_ELEM];
608 
614  virtual unsigned int n_sides () const = 0;
615 
621 
631  unsigned int n_neighbors () const
632  { return this->n_sides(); }
633 
638  virtual unsigned int n_vertices () const = 0;
639 
644  virtual unsigned int n_edges () const = 0;
645 
651 
656  static const unsigned int type_to_n_edges_map[INVALID_ELEM];
657 
662  virtual unsigned int n_faces () const = 0;
663 
668  virtual unsigned int n_children () const = 0;
669 
673  virtual bool is_vertex(const unsigned int i) const = 0;
674 
681  virtual unsigned int is_vertex_on_child (unsigned int /*c*/,
682  unsigned int n) const
683  { return this->is_vertex(n); }
684 
689  virtual bool is_vertex_on_parent(unsigned int c,
690  unsigned int n) const;
691 
695  virtual bool is_edge(const unsigned int i) const = 0;
696 
700  virtual bool is_face(const unsigned int i) const = 0;
701 
706  virtual bool is_node_on_side(const unsigned int n,
707  const unsigned int s) const = 0;
708 
712  virtual std::vector<unsigned int> nodes_on_side(const unsigned int /*s*/) const = 0;
713 
718  virtual bool is_node_on_edge(const unsigned int n,
719  const unsigned int e) const = 0;
720 
724  virtual bool is_edge_on_side(const unsigned int e,
725  const unsigned int s) const = 0;
726 
731  virtual unsigned int opposite_side(const unsigned int s) const;
732 
738  virtual unsigned int opposite_node(const unsigned int n,
739  const unsigned int s) const;
740 
746  virtual unsigned int n_sub_elem () const = 0;
747 
762  virtual std::unique_ptr<Elem> side_ptr (unsigned int i) = 0;
763  std::unique_ptr<const Elem> side_ptr (unsigned int i) const;
764 
780  virtual void side_ptr (std::unique_ptr<Elem> & side, const unsigned int i) = 0;
781  void side_ptr (std::unique_ptr<const Elem> & side, const unsigned int i) const;
782 
804  virtual std::unique_ptr<Elem> build_side_ptr (const unsigned int i, bool proxy=true) = 0;
805  std::unique_ptr<const Elem> build_side_ptr (const unsigned int i, bool proxy=true) const;
806 
822  virtual void build_side_ptr (std::unique_ptr<Elem> & side, const unsigned int i) = 0;
823  void build_side_ptr (std::unique_ptr<const Elem> & side, const unsigned int i) const;
824 
838  virtual std::unique_ptr<Elem> build_edge_ptr (const unsigned int i) = 0;
839  std::unique_ptr<const Elem> build_edge_ptr (const unsigned int i) const;
840 
846  virtual Order default_order () const = 0;
847 
855  virtual Point centroid () const;
856 
860  virtual Real hmin () const;
861 
865  virtual Real hmax () const;
866 
870  virtual Real volume () const;
871 
882  virtual BoundingBox loose_bounding_box () const;
883 
888  virtual Real quality (const ElemQuality q) const;
889 
898  virtual std::pair<Real,Real> qual_bounds (const ElemQuality) const
899  { libmesh_not_implemented(); return std::make_pair(0.,0.); }
900 
916  virtual bool contains_point (const Point & p, Real tol=TOLERANCE) const;
917 
922  virtual bool close_to_point(const Point & p, Real tol) const;
923 
924 private:
931  bool point_test(const Point & p, Real box_tol, Real map_tol) const;
932 
933 public:
938  virtual bool has_affine_map () const { return false; }
939 
944  virtual bool is_linear () const { return false; }
945 
949  void print_info (std::ostream & os=libMesh::out) const;
950 
954  std::string get_info () const;
955 
962  bool active () const;
963 
969  bool ancestor () const;
970 
975  bool subactive () const;
976 
981  bool has_children () const;
982 
987  bool has_ancestor_children () const;
988 
994  bool is_ancestor_of(const Elem * descendant) const;
995 
1000  const Elem * parent () const;
1001 
1006  Elem * parent ();
1007 
1012  void set_parent (Elem * p);
1013 
1021  const Elem * top_parent () const;
1022 
1037  const Elem * interior_parent () const;
1038 
1039  Elem * interior_parent ();
1040 
1045  void set_interior_parent (Elem * p);
1046 
1052  Real length (const unsigned int n1,
1053  const unsigned int n2) const;
1054 
1065  virtual unsigned int n_second_order_adjacent_vertices (const unsigned int n) const;
1066 
1075  virtual unsigned short int second_order_adjacent_vertex (const unsigned int n,
1076  const unsigned int v) const;
1077 
1093  virtual std::pair<unsigned short int, unsigned short int>
1094  second_order_child_vertex (const unsigned int n) const;
1095 
1109  const bool full_ordered=true);
1110 
1118  static ElemType first_order_equivalent_type (const ElemType et);
1119 
1120 
1128  unsigned int level () const;
1129 
1135  unsigned int p_level () const;
1136 
1140  virtual bool is_child_on_side(const unsigned int c,
1141  const unsigned int s) const = 0;
1142 
1146  ElemMappingType mapping_type () const;
1147 
1151  void set_mapping_type (const ElemMappingType type);
1152 
1156  unsigned char mapping_data () const;
1157 
1161  void set_mapping_data (const unsigned char data);
1162 
1163 
1164 #ifdef LIBMESH_ENABLE_AMR
1165 
1177 
1182  const Elem * raw_child_ptr (unsigned int i) const;
1183 
1188  const Elem * child_ptr (unsigned int i) const;
1189 
1194  Elem * child_ptr (unsigned int i);
1195 
1200  class ChildRefIter;
1201  class ConstChildRefIter;
1202 
1211 
1213 
1214 private:
1219  void set_child (unsigned int c, Elem * elem);
1220 
1221 public:
1228  unsigned int which_child_am_i(const Elem * e) const;
1229 
1233  virtual bool is_child_on_edge(const unsigned int c,
1234  const unsigned int e) const;
1235 
1242  void add_child (Elem * elem);
1243 
1250  void add_child (Elem * elem, unsigned int c);
1251 
1255  void replace_child (Elem * elem, unsigned int c);
1256 
1268  void family_tree (std::vector<const Elem *> & family,
1269  bool reset = true) const;
1270 
1274  void family_tree (std::vector<Elem *> & family,
1275  bool reset = true);
1276 
1281  void total_family_tree (std::vector<const Elem *> & family,
1282  bool reset = true) const;
1283 
1287  void total_family_tree (std::vector<Elem *> & family,
1288  bool reset = true);
1289 
1296  void active_family_tree (std::vector<const Elem *> & active_family,
1297  bool reset = true) const;
1298 
1302  void active_family_tree (std::vector<Elem *> & active_family,
1303  bool reset = true);
1304 
1309  void family_tree_by_side (std::vector<const Elem *> & family,
1310  unsigned int side,
1311  bool reset = true) const;
1312 
1316  void family_tree_by_side (std::vector<Elem *> & family,
1317  unsigned int side,
1318  bool reset = true);
1319 
1324  void active_family_tree_by_side (std::vector<const Elem *> & family,
1325  unsigned int side,
1326  bool reset = true) const;
1327 
1331  void active_family_tree_by_side (std::vector<Elem *> & family,
1332  unsigned int side,
1333  bool reset = true);
1334 
1339  void family_tree_by_neighbor (std::vector<const Elem *> & family,
1340  const Elem * neighbor,
1341  bool reset = true) const;
1342 
1346  void family_tree_by_neighbor (std::vector<Elem *> & family,
1347  Elem * neighbor,
1348  bool reset = true);
1349 
1354  void total_family_tree_by_neighbor (std::vector<const Elem *> & family,
1355  const Elem * neighbor,
1356  bool reset = true) const;
1357 
1361  void total_family_tree_by_neighbor (std::vector<Elem *> & family,
1362  Elem * neighbor,
1363  bool reset = true);
1364 
1371  void family_tree_by_subneighbor (std::vector<const Elem *> & family,
1372  const Elem * neighbor,
1373  const Elem * subneighbor,
1374  bool reset = true) const;
1375 
1379  void family_tree_by_subneighbor (std::vector<Elem *> & family,
1380  Elem * neighbor,
1381  Elem * subneighbor,
1382  bool reset = true);
1383 
1388  void total_family_tree_by_subneighbor (std::vector<const Elem *> & family,
1389  const Elem * neighbor,
1390  const Elem * subneighbor,
1391  bool reset = true) const;
1392 
1396  void total_family_tree_by_subneighbor (std::vector<Elem *> & family,
1397  Elem * neighbor,
1398  Elem * subneighbor,
1399  bool reset = true);
1400 
1405  void active_family_tree_by_neighbor (std::vector<const Elem *> & family,
1406  const Elem * neighbor,
1407  bool reset = true) const;
1408 
1412  void active_family_tree_by_neighbor (std::vector<Elem *> & family,
1413  Elem * neighbor,
1414  bool reset = true);
1415 
1421  void active_family_tree_by_topological_neighbor (std::vector<const Elem *> & family,
1422  const Elem * neighbor,
1423  const MeshBase & mesh,
1424  const PointLocatorBase & point_locator,
1425  const PeriodicBoundaries * pb,
1426  bool reset = true) const;
1427 
1431  void active_family_tree_by_topological_neighbor (std::vector<Elem *> & family,
1432  Elem * neighbor,
1433  const MeshBase & mesh,
1434  const PointLocatorBase & point_locator,
1435  const PeriodicBoundaries * pb,
1436  bool reset = true);
1437 
1442 
1446  void set_refinement_flag (const RefinementState rflag);
1447 
1452 
1456  void set_p_refinement_flag (const RefinementState pflag);
1457 
1462  unsigned int max_descendant_p_level () const;
1463 
1469  unsigned int min_p_level_by_neighbor (const Elem * neighbor,
1470  unsigned int current_min) const;
1471 
1477  unsigned int min_new_p_level_by_neighbor (const Elem * neighbor,
1478  unsigned int current_min) const;
1479 
1485  void set_p_level (const unsigned int p);
1486 
1491  void hack_p_level (const unsigned int p);
1492 
1496  virtual void refine (MeshRefinement & mesh_refinement);
1497 
1502  void coarsen ();
1503 
1510  void contract ();
1511 
1512 #endif
1513 
1514 #ifdef DEBUG
1515 
1518  void libmesh_assert_valid_neighbors() const;
1519 
1525 #endif // DEBUG
1526 
1527 protected:
1528 
1539  class SideIter;
1540 
1541 public:
1546 
1551  struct side_iterator;
1552 
1558 
1559 private:
1565  SideIter _last_side();
1566 
1567 public:
1568 
1569 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1570 
1575  virtual bool infinite () const = 0;
1576 
1584  virtual bool is_mid_infinite_edge_node(const unsigned int /* n */) const
1585  { libmesh_assert (!this->infinite()); return false; }
1586 
1593  virtual Point origin () const { libmesh_not_implemented(); return Point(); }
1594 
1595 #endif
1596 
1597 
1598 
1599 
1603  static std::unique_ptr<Elem> build (const ElemType type,
1604  Elem * p=nullptr);
1605 
1606 #ifdef LIBMESH_ENABLE_AMR
1607 
1613  virtual unsigned int as_parent_node (unsigned int c,
1614  unsigned int n) const;
1615 
1620  virtual
1621  const std::vector<std::pair<unsigned char, unsigned char>> &
1622  parent_bracketing_nodes(unsigned int c,
1623  unsigned int n) const;
1624 
1629  virtual
1630  const std::vector<std::pair<dof_id_type, dof_id_type>>
1631  bracketing_nodes(unsigned int c,
1632  unsigned int n) const;
1633 
1634 
1638  virtual float embedding_matrix (const unsigned int child_num,
1639  const unsigned int child_node_num,
1640  const unsigned int parent_node_num) const = 0;
1641 
1649  virtual unsigned int embedding_matrix_version () const { return 0; }
1650 
1651 #endif // LIBMESH_ENABLE_AMR
1652 
1653 
1654 protected:
1655 
1659  static dof_id_type compute_key (dof_id_type n0);
1660 
1664  static dof_id_type compute_key (dof_id_type n0,
1665  dof_id_type n1);
1666 
1670  static dof_id_type compute_key (dof_id_type n0,
1671  dof_id_type n1,
1672  dof_id_type n2);
1673 
1677  static dof_id_type compute_key (dof_id_type n0,
1678  dof_id_type n1,
1679  dof_id_type n2,
1680  dof_id_type n3);
1681 
1685  template <typename Subclass>
1686  void simple_build_side_ptr(std::unique_ptr<Elem> & side,
1687  const unsigned int i,
1688  ElemType sidetype);
1689 
1693  template <typename Subclass, typename Mapclass>
1694  void simple_side_ptr(std::unique_ptr<Elem> & side,
1695  const unsigned int i,
1696  ElemType sidetype);
1697 
1698 #ifdef LIBMESH_ENABLE_AMR
1699 
1705  virtual
1706  std::vector<std::vector<std::vector<std::vector<std::pair<unsigned char, unsigned char>>>>> &
1708  {
1709  static std::vector<std::vector<std::vector<std::vector<std::pair<unsigned char, unsigned char>>>>> c;
1710  libmesh_error();
1711  return c;
1712  }
1713 
1719  virtual
1720  std::vector<std::vector<std::vector<signed char>>> &
1722  {
1723  static std::vector<std::vector<std::vector<signed char>>> c;
1724  libmesh_error();
1725  return c;
1726  }
1727 
1728 #endif // LIBMESH_ENABLE_AMR
1729 
1730 public:
1731 
1736  void nullify_neighbors ();
1737 
1738 protected:
1739 
1744 
1750 
1751 #ifdef LIBMESH_ENABLE_AMR
1752 
1756 #endif
1757 
1762 
1763 #ifdef LIBMESH_ENABLE_AMR
1764 
1768  unsigned char _rflag;
1769 
1774  unsigned char _pflag;
1775 
1784  unsigned char _p_level;
1785 #endif
1786 
1791  unsigned char _map_type;
1792 
1797  unsigned char _map_data;
1798 };
1799 
1800 
1801 
1802 // ------------------------------------------------------------
1803 // Elem helper classes
1804 //
1805 class
1807 {
1808 public:
1809  NodeRefIter (Node * const * nodepp) : PointerToPointerIter<Node>(nodepp) {}
1810 };
1811 
1812 
1813 class
1815 {
1816 public:
1817  ConstNodeRefIter (const Node * const * nodepp) : PointerToPointerIter<const Node>(nodepp) {}
1818 };
1819 
1820 
1821 #ifdef LIBMESH_ENABLE_AMR
1822 class
1824 {
1825 public:
1826  ChildRefIter (Elem * const * childpp) : PointerToPointerIter<Elem>(childpp) {}
1827 };
1828 
1829 
1830 class
1832 {
1833 public:
1834  ConstChildRefIter (const Elem * const * childpp) : PointerToPointerIter<const Elem>(childpp) {}
1835 };
1836 
1837 
1838 inline
1840 {
1842  return {_children, _children + this->n_children()};
1843 }
1844 
1845 
1846 inline
1848 {
1850  return {_children, _children + this->n_children()};
1851 }
1852 #endif // LIBMESH_ENABLE_AMR
1853 
1854 
1855 
1856 
1857 // ------------------------------------------------------------
1858 // global Elem functions
1859 
1860 inline
1861 std::ostream & operator << (std::ostream & os, const Elem & e)
1862 {
1863  e.print_info(os);
1864  return os;
1865 }
1866 
1867 
1868 // ------------------------------------------------------------
1869 // Elem class member functions
1870 inline
1871 Elem::Elem(const unsigned int nn,
1872  const unsigned int ns,
1873  Elem * p,
1874  Elem ** elemlinkdata,
1875  Node ** nodelinkdata) :
1876  _nodes(nodelinkdata),
1877  _elemlinks(elemlinkdata),
1878 #ifdef LIBMESH_ENABLE_AMR
1879  _children(nullptr),
1880 #endif
1881  _sbd_id(0),
1882 #ifdef LIBMESH_ENABLE_AMR
1883  _rflag(Elem::DO_NOTHING),
1884  _pflag(Elem::DO_NOTHING),
1885  _p_level(0),
1886 #endif
1887  _map_type(p ? p->mapping_type() : 0),
1888  _map_data(p ? p->mapping_data() : 0)
1889 {
1891 
1892  // If this ever legitimately fails we need to increase max_n_nodes
1893  libmesh_assert_less_equal(nn, max_n_nodes);
1894 
1895  // Initialize the nodes data structure
1896  if (_nodes)
1897  {
1898  for (unsigned int n=0; n<nn; n++)
1899  _nodes[n] = nullptr;
1900  }
1901 
1902  // Initialize the neighbors/parent data structure
1903  // _elemlinks = new Elem *[ns+1];
1904 
1905  if (_elemlinks)
1906  {
1907  _elemlinks[0] = p;
1908 
1909  for (unsigned int n=1; n<ns+1; n++)
1910  _elemlinks[n] = nullptr;
1911  }
1912 
1913  // Optionally initialize data from the parent
1914  if (this->parent() != nullptr)
1915  {
1916  this->subdomain_id() = this->parent()->subdomain_id();
1917  this->processor_id() = this->parent()->processor_id();
1918  _map_type = this->parent()->_map_type;
1919  _map_data = this->parent()->_map_data;
1920  }
1921 
1922 #ifdef LIBMESH_ENABLE_AMR
1923  if (this->parent())
1924  this->set_p_level(this->parent()->p_level());
1925 #endif
1926 }
1927 
1928 
1929 
1930 inline
1932 {
1933  // Deleting my parent/neighbor/nodes storage isn't necessary since it's
1934  // handled by the subclass
1935 
1936  // if (_nodes != nullptr)
1937  // delete [] _nodes;
1938  // _nodes = nullptr;
1939 
1940  // delete [] _elemlinks;
1941 
1942 #ifdef LIBMESH_ENABLE_AMR
1943 
1944  // Delete my children's storage
1945  if (_children != nullptr)
1946  delete [] _children;
1947  _children = nullptr;
1948 
1949 #endif
1950 }
1951 
1952 
1953 
1954 inline
1955 const Point & Elem::point (const unsigned int i) const
1956 {
1957  libmesh_assert_less (i, this->n_nodes());
1958  libmesh_assert(_nodes[i]);
1959  libmesh_assert_not_equal_to (_nodes[i]->id(), Node::invalid_id);
1960 
1961  return *_nodes[i];
1962 }
1963 
1964 
1965 
1966 inline
1967 Point & Elem::point (const unsigned int i)
1968 {
1969  libmesh_assert_less (i, this->n_nodes());
1970 
1971  return *_nodes[i];
1972 }
1973 
1974 
1975 
1976 inline
1977 dof_id_type Elem::node_id (const unsigned int i) const
1978 {
1979  libmesh_assert_less (i, this->n_nodes());
1980  libmesh_assert(_nodes[i]);
1981  libmesh_assert_not_equal_to (_nodes[i]->id(), Node::invalid_id);
1982 
1983  return _nodes[i]->id();
1984 }
1985 
1986 
1987 
1988 inline
1989 unsigned int Elem::local_node (const dof_id_type i) const
1990 {
1991  for (auto n : IntRange<unsigned int>(0, this->n_nodes()))
1992  if (this->node_id(n) == i)
1993  return n;
1994 
1995  return libMesh::invalid_uint;
1996 }
1997 
1998 
1999 
2000 inline
2001 const Node * const * Elem::get_nodes () const
2002 {
2003  return _nodes;
2004 }
2005 
2006 
2007 
2008 inline
2009 const Node * Elem::node_ptr (const unsigned int i) const
2010 {
2011  libmesh_assert_less (i, this->n_nodes());
2012  libmesh_assert(_nodes[i]);
2013 
2014  return _nodes[i];
2015 }
2016 
2017 
2018 
2019 inline
2020 Node * Elem::node_ptr (const unsigned int i)
2021 {
2022  libmesh_assert_less (i, this->n_nodes());
2023  libmesh_assert(_nodes[i]);
2024 
2025  return _nodes[i];
2026 }
2027 
2028 
2029 
2030 inline
2031 const Node & Elem::node_ref (const unsigned int i) const
2032 {
2033  return *this->node_ptr(i);
2034 }
2035 
2036 
2037 
2038 inline
2039 Node & Elem::node_ref (const unsigned int i)
2040 {
2041  return *this->node_ptr(i);
2042 }
2043 
2044 
2045 
2046 inline
2047 unsigned int Elem::get_node_index (const Node * node_ptr) const
2048 {
2049  for (auto n : IntRange<unsigned int>(0, this->n_nodes()))
2050  if (this->_nodes[n] == node_ptr)
2051  return n;
2052 
2053  return libMesh::invalid_uint;
2054 }
2055 
2056 
2057 
2058 inline
2059 Node * & Elem::set_node (const unsigned int i)
2060 {
2061  libmesh_assert_less (i, this->n_nodes());
2062 
2063  return _nodes[i];
2064 }
2065 
2066 
2067 
2068 inline
2070 {
2071  return _sbd_id;
2072 }
2073 
2074 
2075 
2076 inline
2078 {
2079  return _sbd_id;
2080 }
2081 
2082 
2083 
2084 inline
2085 const Elem * Elem::neighbor_ptr (unsigned int i) const
2086 {
2087  libmesh_assert_less (i, this->n_neighbors());
2088 
2089  return _elemlinks[i+1];
2090 }
2091 
2092 
2093 
2094 inline
2095 Elem * Elem::neighbor_ptr (unsigned int i)
2096 {
2097  libmesh_assert_less (i, this->n_neighbors());
2098 
2099  return _elemlinks[i+1];
2100 }
2101 
2102 
2103 
2104 inline
2105 void Elem::set_neighbor (const unsigned int i, Elem * n)
2106 {
2107  libmesh_assert_less (i, this->n_neighbors());
2108 
2109  _elemlinks[i+1] = n;
2110 }
2111 
2112 
2113 
2114 inline
2115 bool Elem::has_neighbor (const Elem * elem) const
2116 {
2117  for (auto n : this->neighbor_ptr_range())
2118  if (n == elem)
2119  return true;
2120 
2121  return false;
2122 }
2123 
2124 
2125 
2126 inline
2128 {
2129  for (auto n : elem->neighbor_ptr_range())
2130  if (n && n->parent() == this)
2131  return n;
2132 
2133  return nullptr;
2134 }
2135 
2136 
2137 
2138 inline
2139 const Elem * Elem::child_neighbor (const Elem * elem) const
2140 {
2141  for (auto n : elem->neighbor_ptr_range())
2142  if (n && n->parent() == this)
2143  return n;
2144 
2145  return nullptr;
2146 }
2147 
2148 
2149 
2150 inline
2153 {
2154  return {_nodes, _nodes+this->n_nodes()};
2155 }
2156 
2157 
2158 
2159 inline
2162 {
2163  return {_nodes, _nodes+this->n_nodes()};
2164 }
2165 
2166 
2167 
2168 inline
2171 {
2172  return {0, cast_int<unsigned short>(this->n_nodes())};
2173 }
2174 
2175 
2176 
2177 inline
2180 {
2181  return {0, cast_int<unsigned short>(this->n_edges())};
2182 }
2183 
2184 
2185 
2186 inline
2189 {
2190  return {0, cast_int<unsigned short>(this->n_sides())};
2191 }
2192 
2193 
2194 
2195 
2196 inline
2197 std::unique_ptr<const Elem> Elem::side_ptr (unsigned int i) const
2198 {
2199  // Call the non-const version of this function, return the result as
2200  // a std::unique_ptr<const Elem>.
2201  Elem * me = const_cast<Elem *>(this);
2202  const Elem * s = const_cast<const Elem *>(me->side_ptr(i).release());
2203  return std::unique_ptr<const Elem>(s);
2204 }
2205 
2206 
2207 
2208 inline
2209 void
2210 Elem::side_ptr (std::unique_ptr<const Elem> & elem,
2211  const unsigned int i) const
2212 {
2213  // Hand off to the non-const version of this function
2214  Elem * me = const_cast<Elem *>(this);
2215  std::unique_ptr<Elem> e {const_cast<Elem *>(elem.release())};
2216  me->side_ptr(e, i);
2217  elem.reset(e.release());
2218 }
2219 
2220 
2221 
2222 inline
2223 std::unique_ptr<const Elem>
2224 Elem::build_side_ptr (const unsigned int i, bool proxy) const
2225 {
2226  // Call the non-const version of this function, return the result as
2227  // a std::unique_ptr<const Elem>.
2228  Elem * me = const_cast<Elem *>(this);
2229  const Elem * s = const_cast<const Elem *>(me->build_side_ptr(i, proxy).release());
2230  return std::unique_ptr<const Elem>(s);
2231 }
2232 
2233 
2234 
2235 inline
2236 void
2237 Elem::build_side_ptr (std::unique_ptr<const Elem> & elem,
2238  const unsigned int i) const
2239 {
2240  // Hand off to the non-const version of this function
2241  Elem * me = const_cast<Elem *>(this);
2242  std::unique_ptr<Elem> e {const_cast<Elem *>(elem.release())};
2243  me->build_side_ptr(e, i);
2244  elem.reset(e.release());
2245 }
2246 
2247 
2248 
2249 template <typename Subclass>
2250 inline
2251 void
2252 Elem::simple_build_side_ptr (std::unique_ptr<Elem> & side,
2253  const unsigned int i,
2254  ElemType sidetype)
2255 {
2256  libmesh_assert_less (i, this->n_sides());
2257 
2258  if (!side.get() || side->type() != sidetype)
2259  {
2260  Subclass & real_me = cast_ref<Subclass&>(*this);
2261  side = real_me.Subclass::build_side_ptr(i, false);
2262  }
2263  else
2264  {
2265  side->subdomain_id() = this->subdomain_id();
2266 
2267  for (auto n : side->node_index_range())
2268  side->set_node(n) = this->node_ptr(Subclass::side_nodes_map[i][n]);
2269  }
2270 }
2271 
2272 
2273 
2274 template <typename Subclass, typename Mapclass>
2275 inline
2276 void
2277 Elem::simple_side_ptr (std::unique_ptr<Elem> & side,
2278  const unsigned int i,
2279  ElemType sidetype)
2280 {
2281  libmesh_assert_less (i, this->n_sides());
2282 
2283  if (!side.get() || side->type() != sidetype)
2284  {
2285  Subclass & real_me = cast_ref<Subclass&>(*this);
2286  side = real_me.Subclass::side_ptr(i);
2287  }
2288  else
2289  {
2290  side->subdomain_id() = this->subdomain_id();
2291 
2292  for (auto n : side->node_index_range())
2293  side->set_node(n) = this->node_ptr(Mapclass::side_nodes_map[i][n]);
2294  }
2295 }
2296 
2297 
2298 
2299 inline
2300 std::unique_ptr<const Elem>
2301 Elem::build_edge_ptr (const unsigned int i) const
2302 {
2303  // Call the non-const version of this function, return the result as
2304  // a std::unique_ptr<const Elem>.
2305  Elem * me = const_cast<Elem *>(this);
2306  const Elem * e = const_cast<const Elem *>(me->build_edge_ptr(i).release());
2307  return std::unique_ptr<const Elem>(e);
2308 }
2309 
2310 
2311 
2312 inline
2313 bool Elem::on_boundary () const
2314 {
2315  // By convention, the element is on the boundary
2316  // if it has a nullptr neighbor.
2317  return this->has_neighbor(nullptr);
2318 }
2319 
2320 
2321 
2322 inline
2323 unsigned int Elem::which_neighbor_am_i (const Elem * e) const
2324 {
2325  libmesh_assert(e);
2326 
2327  const Elem * eparent = e;
2328 
2329  while (eparent->level() > this->level())
2330  {
2331  eparent = eparent->parent();
2332  libmesh_assert(eparent);
2333  }
2334 
2335  for (auto s : IntRange<unsigned int>(0, this->n_sides()))
2336  if (this->neighbor_ptr(s) == eparent)
2337  return s;
2338 
2339  return libMesh::invalid_uint;
2340 }
2341 
2342 
2343 
2344 inline
2345 bool Elem::active() const
2346 {
2347 #ifdef LIBMESH_ENABLE_AMR
2348  if ((this->refinement_flag() == INACTIVE) ||
2349  (this->refinement_flag() == COARSEN_INACTIVE))
2350  return false;
2351  else
2352  return true;
2353 #else
2354  return true;
2355 #endif
2356 }
2357 
2358 
2359 
2360 
2361 
2362 inline
2363 bool Elem::subactive() const
2364 {
2365 #ifdef LIBMESH_ENABLE_AMR
2366  if (this->active())
2367  return false;
2368  if (!this->has_children())
2369  return true;
2370  for (const Elem * my_ancestor = this->parent();
2371  my_ancestor != nullptr;
2372  my_ancestor = my_ancestor->parent())
2373  if (my_ancestor->active())
2374  return true;
2375 #endif
2376 
2377  return false;
2378 }
2379 
2380 
2381 
2382 inline
2384 {
2385 #ifdef LIBMESH_ENABLE_AMR
2386  if (_children == nullptr)
2387  return false;
2388  else
2389  return true;
2390 #else
2391  return false;
2392 #endif
2393 }
2394 
2395 
2396 inline
2398 {
2399 #ifdef LIBMESH_ENABLE_AMR
2400  if (_children == nullptr)
2401  return false;
2402  else
2403  for (auto & c : child_ref_range())
2404  if (c.has_children())
2405  return true;
2406 #endif
2407  return false;
2408 }
2409 
2410 
2411 
2412 inline
2414 #ifdef LIBMESH_ENABLE_AMR
2415  descendant
2416 #endif
2417  ) const
2418 {
2419 #ifdef LIBMESH_ENABLE_AMR
2420  const Elem * e = descendant;
2421  while (e)
2422  {
2423  if (this == e)
2424  return true;
2425  e = e->parent();
2426  }
2427 #endif
2428  return false;
2429 }
2430 
2431 
2432 
2433 inline
2434 const Elem * Elem::parent () const
2435 {
2436  return _elemlinks[0];
2437 }
2438 
2439 
2440 
2441 inline
2443 {
2444  return _elemlinks[0];
2445 }
2446 
2447 
2448 
2449 inline
2451 {
2452  // We no longer support using parent() as interior_parent()
2453  libmesh_assert_equal_to(this->dim(), p ? p->dim() : this->dim());
2454  _elemlinks[0] = p;
2455 }
2456 
2457 
2458 
2459 inline
2460 const Elem * Elem::top_parent () const
2461 {
2462  const Elem * tp = this;
2463 
2464  // Keep getting the element's parent
2465  // until that parent is at level-0
2466  while (tp->parent() != nullptr)
2467  tp = tp->parent();
2468 
2469  libmesh_assert(tp);
2470  libmesh_assert_equal_to (tp->level(), 0);
2471 
2472  return tp;
2473 }
2474 
2475 
2476 
2477 inline
2478 unsigned int Elem::level() const
2479 {
2480 #ifdef LIBMESH_ENABLE_AMR
2481 
2482  // if I don't have a parent I was
2483  // created directly from file
2484  // or by the user, so I am a
2485  // level-0 element
2486  if (this->parent() == nullptr)
2487  return 0;
2488 
2489  // if the parent and this element are of different
2490  // dimensionality we are at the same level as
2491  // the parent (e.g. we are the 2D side of a
2492  // 3D element)
2493  if (this->dim() != this->parent()->dim())
2494  return this->parent()->level();
2495 
2496  // otherwise we are at a level one
2497  // higher than our parent
2498  return (this->parent()->level() + 1);
2499 
2500 #else
2501 
2502  // Without AMR all elements are
2503  // at level 0.
2504  return 0;
2505 
2506 #endif
2507 }
2508 
2509 
2510 
2511 inline
2512 unsigned int Elem::p_level() const
2513 {
2514 #ifdef LIBMESH_ENABLE_AMR
2515  return _p_level;
2516 #else
2517  return 0;
2518 #endif
2519 }
2520 
2521 
2522 
2523 inline
2525 {
2526  return static_cast<ElemMappingType>(_map_type);
2527 }
2528 
2529 
2530 
2531 inline
2533 {
2534  _map_type = cast_int<unsigned char>(type);
2535 }
2536 
2537 
2538 
2539 inline
2540 unsigned char Elem::mapping_data () const
2541 {
2542  return _map_data;
2543 }
2544 
2545 
2546 
2547 inline
2548 void Elem::set_mapping_data(const unsigned char data)
2549 {
2550  _map_data = data;
2551 }
2552 
2553 
2554 
2555 #ifdef LIBMESH_ENABLE_AMR
2556 
2557 inline
2558 const Elem * Elem::raw_child_ptr (unsigned int i) const
2559 {
2560  if (!_children)
2561  return nullptr;
2562 
2563  return _children[i];
2564 }
2565 
2566 inline
2567 const Elem * Elem::child_ptr (unsigned int i) const
2568 {
2571 
2572  return _children[i];
2573 }
2574 
2575 inline
2576 Elem * Elem::child_ptr (unsigned int i)
2577 {
2580 
2581  return _children[i];
2582 }
2583 
2584 
2585 inline
2586 void Elem::set_child (unsigned int c, Elem * elem)
2587 {
2588  libmesh_assert (this->has_children());
2589 
2590  _children[c] = elem;
2591 }
2592 
2593 
2594 
2595 inline
2596 unsigned int Elem::which_child_am_i (const Elem * e) const
2597 {
2598  libmesh_assert(e);
2599  libmesh_assert (this->has_children());
2600 
2601  unsigned int nc = this->n_children();
2602  for (unsigned int c=0; c != nc; c++)
2603  if (this->child_ptr(c) == e)
2604  return c;
2605 
2606  libmesh_error_msg("ERROR: which_child_am_i() was called with a non-child!");
2607 
2608  return libMesh::invalid_uint;
2609 }
2610 
2611 
2612 
2613 inline
2615 {
2616  return static_cast<RefinementState>(_rflag);
2617 }
2618 
2619 
2620 
2621 inline
2623 {
2624  _rflag = cast_int<unsigned char>(rflag);
2625 }
2626 
2627 
2628 
2629 inline
2631 {
2632  return static_cast<RefinementState>(_pflag);
2633 }
2634 
2635 
2636 
2637 inline
2639 {
2640  if (this->p_level() == 0)
2641  libmesh_assert_not_equal_to
2642  (pflag, Elem::JUST_REFINED);
2643 
2644  _pflag = cast_int<unsigned char>(pflag);
2645 }
2646 
2647 
2648 
2649 inline
2650 unsigned int Elem::max_descendant_p_level () const
2651 {
2652  // This is undefined for subactive elements,
2653  // which have no active descendants
2654  libmesh_assert (!this->subactive());
2655  if (this->active())
2656  return this->p_level();
2657 
2658  unsigned int max_p_level = _p_level;
2659  for (auto & c : child_ref_range())
2660  max_p_level = std::max(max_p_level,
2661  c.max_descendant_p_level());
2662  return max_p_level;
2663 }
2664 
2665 
2666 
2667 inline
2668 void Elem::hack_p_level(unsigned int p)
2669 {
2670  if (p == 0)
2671  libmesh_assert_not_equal_to
2673 
2674  _p_level = cast_int<unsigned char>(p);
2675 }
2676 
2677 
2678 
2679 #endif // ifdef LIBMESH_ENABLE_AMR
2680 
2681 
2682 inline
2684 {
2685  return n0;
2686 }
2687 
2688 
2689 
2690 inline
2692  dof_id_type n1)
2693 {
2694  // Order the two so that n0 < n1
2695  if (n0 > n1) std::swap (n0, n1);
2696 
2697  return Utility::hashword2(n0, n1);
2698 }
2699 
2700 
2701 
2702 inline
2704  dof_id_type n1,
2705  dof_id_type n2)
2706 {
2707  // Order the numbers such that n0 < n1 < n2.
2708  // We'll do it in 3 steps like this:
2709  //
2710  // n0 n1 n2
2711  // min(n0,n1) max(n0,n1) n2
2712  // min(n0,n1) min(n2,max(n0,n1) max(n2,max(n0,n1)
2713  // |\ /| |
2714  // | \ / | |
2715  // | / | |
2716  // | / \| |
2717  // gb min= min max gb max
2718 
2719  // Step 1
2720  if (n0 > n1) std::swap (n0, n1);
2721 
2722  // Step 2
2723  if (n1 > n2) std::swap (n1, n2);
2724 
2725  // Step 3
2726  if (n0 > n1) std::swap (n0, n1);
2727 
2728  libmesh_assert ((n0 < n1) && (n1 < n2));
2729 
2730  dof_id_type array[3] = {n0, n1, n2};
2731  return Utility::hashword(array, 3);
2732 }
2733 
2734 
2735 
2736 inline
2738  dof_id_type n1,
2739  dof_id_type n2,
2740  dof_id_type n3)
2741 {
2742  // Sort first
2743  // Step 1
2744  if (n0 > n1) std::swap (n0, n1);
2745 
2746  // Step 2
2747  if (n2 > n3) std::swap (n2, n3);
2748 
2749  // Step 3
2750  if (n0 > n2) std::swap (n0, n2);
2751 
2752  // Step 4
2753  if (n1 > n3) std::swap (n1, n3);
2754 
2755  // Finally sort step 5
2756  if (n1 > n2) std::swap (n1, n2);
2757 
2758  libmesh_assert ((n0 < n1) && (n1 < n2) && (n2 < n3));
2759 
2760  dof_id_type array[4] = {n0, n1, n2, n3};
2761  return Utility::hashword(array, 4);
2762 }
2763 
2764 
2765 
2770 {
2771 public:
2772  // Constructor with arguments.
2773  SideIter(const unsigned int side_number,
2774  Elem * parent)
2775  : _side(),
2776  _side_ptr(nullptr),
2777  _parent(parent),
2778  _side_number(side_number)
2779  {}
2780 
2781 
2782  // Empty constructor.
2784  : _side(),
2785  _side_ptr(nullptr),
2786  _parent(nullptr),
2788  {}
2789 
2790 
2791  // Copy constructor
2792  SideIter(const SideIter & other)
2793  : _side(),
2794  _side_ptr(nullptr),
2795  _parent(other._parent),
2796  _side_number(other._side_number)
2797  {}
2798 
2799 
2800  // op=
2801  SideIter & operator=(const SideIter & other)
2802  {
2803  this->_parent = other._parent;
2804  this->_side_number = other._side_number;
2805  return *this;
2806  }
2807 
2808  // unary op*
2809  Elem *& operator*() const
2810  {
2811  // Set the std::unique_ptr
2812  this->_update_side_ptr();
2813 
2814  // Return a reference to _side_ptr
2815  return this->_side_ptr;
2816  }
2817 
2818  // op++
2820  {
2821  ++_side_number;
2822  return *this;
2823  }
2824 
2825  // op== Two side iterators are equal if they have
2826  // the same side number and the same parent element.
2827  bool operator == (const SideIter & other) const
2828  {
2829  return (this->_side_number == other._side_number &&
2830  this->_parent == other._parent);
2831  }
2832 
2833 
2834  // Consults the parent Elem to determine if the side
2835  // is a boundary side. Note: currently side N is a
2836  // boundary side if neighbor N is nullptr. Be careful,
2837  // this could possibly change in the future?
2838  bool side_on_boundary() const
2839  {
2840  return this->_parent->neighbor_ptr(_side_number) == nullptr;
2841  }
2842 
2843 private:
2844  // Update the _side pointer by building the correct side.
2845  // This has to be called before dereferencing.
2846  void _update_side_ptr() const
2847  {
2848  // Construct new side, store in std::unique_ptr
2849  this->_side = this->_parent->build_side_ptr(this->_side_number);
2850 
2851  // Also set our internal naked pointer. Memory is still owned
2852  // by the std::unique_ptr.
2853  this->_side_ptr = _side.get();
2854  }
2855 
2856  // std::unique_ptr to the actual side, handles memory management for
2857  // the sides which are created during the course of iteration.
2858  mutable std::unique_ptr<Elem> _side;
2859 
2860  // Raw pointer needed to facilitate passing back to the user a
2861  // reference to a non-temporary raw pointer in order to conform to
2862  // the variant_filter_iterator interface. It points to the same
2863  // thing the std::unique_ptr "_side" above holds. What happens if the user
2864  // calls delete on the pointer passed back? Well, this is an issue
2865  // which is not addressed by the iterators in libMesh. Basically it
2866  // is a bad idea to ever call delete on an iterator from the library.
2867  mutable Elem * _side_ptr;
2868 
2869  // Pointer to the parent Elem class which generated this iterator
2871 
2872  // A counter variable which keeps track of the side number
2873  unsigned int _side_number;
2874 };
2875 
2876 
2877 
2878 
2879 
2880 
2881 // Private implementation functions in the Elem class for the side iterators.
2882 // They have to come after the definition of the SideIter class.
2883 inline
2885 {
2886  return SideIter(0, this);
2887 }
2888 
2889 
2890 
2891 inline
2893 {
2894  return SideIter(this->n_neighbors(), this);
2895 }
2896 
2897 
2898 
2899 
2903 struct
2904 Elem::side_iterator : variant_filter_iterator<Elem::Predicate, Elem *>
2905 {
2906  // Templated forwarding ctor -- forwards to appropriate variant_filter_iterator ctor
2907  template <typename PredType, typename IterType>
2908  side_iterator (const IterType & d,
2909  const IterType & e,
2910  const PredType & p ) :
2912 };
2913 
2914 
2915 
2916 inline
2918 {
2919  return {_elemlinks+1, _elemlinks + 1 + this->n_neighbors()};
2920 }
2921 
2922 
2923 inline
2925 {
2926  return {_elemlinks+1, _elemlinks + 1 + this->n_neighbors()};
2927 }
2928 
2929 } // namespace libMesh
2930 
2931 
2932 // Helper function for default caches in Elem subclasses
2933 
2934 #define LIBMESH_ENABLE_TOPOLOGY_CACHES \
2935  virtual \
2936  std::vector<std::vector<std::vector<std::vector<std::pair<unsigned char, unsigned char>>>>> & \
2937  _get_bracketing_node_cache() const override \
2938  { \
2939  static std::vector<std::vector<std::vector<std::vector<std::pair<unsigned char, unsigned char>>>>> c; \
2940  return c; \
2941  } \
2942  \
2943  virtual \
2944  std::vector<std::vector<std::vector<signed char>>> & \
2945  _get_parent_indices_cache() const override \
2946  { \
2947  static std::vector<std::vector<std::vector<signed char>>> c; \
2948  return c; \
2949  }
2950 
2951 
2952 
2953 
2954 
2955 
2956 #endif // LIBMESH_ELEM_H
libMesh::Elem::mapping_data
unsigned char mapping_data() const
Definition: elem.h:2540
libMesh::Elem::active_family_tree_by_side
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.
Definition: elem.C:1507
libMesh::Elem::find_point_neighbors
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...
Definition: elem.C:560
libMesh::dof_id_type
uint8_t dof_id_type
Definition: id_types.h:67
libMesh::Elem::nullify_neighbors
void nullify_neighbors()
Replaces this element with nullptr for all of its neighbors.
Definition: elem.C:2317
libMesh::Elem::which_node_am_i
virtual unsigned int which_node_am_i(unsigned int side, unsigned int side_node) const =0
libMesh::Elem::child_ptr
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2567
libMesh::Elem::bracketing_nodes
virtual const std::vector< std::pair< dof_id_type, dof_id_type > > bracketing_nodes(unsigned int c, unsigned int n) const
Definition: elem.C:1999
libMesh::Elem::is_node_on_side
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const =0
libMesh::Elem::is_vertex_on_child
virtual unsigned int is_vertex_on_child(unsigned int, unsigned int n) const
Definition: elem.h:681
libMesh::Elem::_last_side
SideIter _last_side()
Definition: elem.h:2892
libMesh::PeriodicBoundaries
We're using a class instead of a typedef to allow forward declarations and future flexibility.
Definition: periodic_boundaries.h:51
libMesh::Elem::n_edges
virtual unsigned int n_edges() const =0
libMesh::invalid_uint
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value.
Definition: libmesh.h:249
libMesh::Elem::compute_key
static dof_id_type compute_key(dof_id_type n0)
Definition: elem.h:2683
libMesh::Elem::n_second_order_adjacent_vertices
virtual unsigned int n_second_order_adjacent_vertices(const unsigned int n) const
Definition: elem.C:2343
libMesh::Elem::replace_child
void replace_child(Elem *elem, unsigned int c)
Replaces the child pointer at the specified index in the child array.
Definition: elem.C:1430
libMesh::Elem::set_p_refinement_flag
void set_p_refinement_flag(const RefinementState pflag)
Sets the value of the p-refinement flag for the element.
Definition: elem.h:2638
libMesh::Predicates::multi_predicate
Definition: multi_predicates.h:50
libMesh::Elem::n_faces
virtual unsigned int n_faces() const =0
libMesh::Elem::total_family_tree
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.
Definition: elem.C:1457
libMesh::Elem::JUST_REFINED
Definition: elem.h:1172
libMesh::Elem::on_boundary
bool on_boundary() const
Definition: elem.h:2313
libMesh::Elem::build_side_ptr
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int i, bool proxy=true)=0
libMesh::Elem::set_parent
void set_parent(Elem *p)
Sets the pointer to the element's parent.
Definition: elem.h:2450
libMesh::Elem::set_interior_parent
void set_interior_parent(Elem *p)
Sets the pointer to the element's interior_parent.
Definition: elem.C:801
libMesh::Elem::contains_edge_of
bool contains_edge_of(const Elem *e) const
Definition: elem.C:539
libMesh::Elem::close_to_point
virtual bool close_to_point(const Point &p, Real tol) const
Definition: elem.C:2119
libMesh::SimpleRange
The SimpleRange templated class is intended to make it easy to construct ranges from pairs of iterato...
Definition: simple_range.h:36
libMesh::Elem::find_edge_neighbors
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 ...
Definition: elem.C:646
libMesh::Elem::level
unsigned int level() const
Definition: elem.h:2478
libMesh::Elem::child_ref_range
SimpleRange< ChildRefIter > child_ref_range()
Returns a range with all children of a parent element, usable in range-based for loops.
Definition: elem.h:1839
libMesh::Elem::SideIter::SideIter
SideIter(const SideIter &other)
Definition: elem.h:2792
libMesh::Elem::_first_side
SideIter _first_side()
Side iterator helper functions.
Definition: elem.h:2884
libMesh::Elem::n_nodes
virtual unsigned int n_nodes() const =0
libMesh::Elem::embedding_matrix
virtual float embedding_matrix(const unsigned int child_num, const unsigned int child_node_num, const unsigned int parent_node_num) const =0
libMesh::Elem::contains_point
virtual bool contains_point(const Point &p, Real tol=TOLERANCE) const
Definition: elem.C:2094
libMesh::Elem::edge_index_range
IntRange< unsigned short > edge_index_range() const
Definition: elem.h:2179
libMesh::Elem::SideIter::_update_side_ptr
void _update_side_ptr() const
Definition: elem.h:2846
libMesh::Elem::is_semilocal
bool is_semilocal(const processor_id_type my_pid) const
Definition: elem.C:460
variant_filter_iterator
variant_filter_iterator(const IterType &d, const IterType &e, const PredType &p)
Templated Constructor.
Definition: variant_filter_iterator.h:364
libMesh::IOPackage
IOPackage
libMesh interfaces with several different software packages for the purposes of creating,...
Definition: enum_io_package.h:37
libMesh::Elem::parent_bracketing_nodes
virtual const std::vector< std::pair< unsigned char, unsigned char > > & parent_bracketing_nodes(unsigned int c, unsigned int n) const
Definition: elem.C:1794
libMesh::Elem::COARSEN
Definition: elem.h:1169
libMesh::Elem::n_neighbors
unsigned int n_neighbors() const
Definition: elem.h:631
libMesh::Elem::contract
void contract()
Contract an active element, i.e.
Definition: elem_refinement.C:230
libMesh::BoundingBox
Defines a Cartesian bounding box by the two corner extremum.
Definition: bounding_box.h:40
libMesh::Elem::ancestor
bool ancestor() const
Definition: elem.C:1350
libMesh::Elem::_children
Elem ** _children
Pointers to this element's children.
Definition: elem.h:1755
libMesh::Elem::ConstNodeRefIter::ConstNodeRefIter
ConstNodeRefIter(const Node *const *nodepp)
Definition: elem.h:1817
libMesh::ReferenceCountedObject
This class implements reference counting.
Definition: reference_counted_object.h:65
libMesh::Elem::ChildRefIter
Definition: elem.h:1822
libMesh
The libMesh namespace provides an interface to certain functionality in the library.
Definition: factoryfunction.C:55
libMesh::Elem::set_p_level
void set_p_level(const unsigned int p)
Sets the value of the p-refinement level for the element.
Definition: elem_refinement.C:41
libMesh::Elem::dim
virtual unsigned short dim() const =0
libMesh::Elem::COARSEN_INACTIVE
Definition: elem.h:1175
libMesh::Elem::which_side_am_i
unsigned int which_side_am_i(const Elem *e) const
This function tells you which side the boundary element e is.
Definition: elem.C:475
libMesh::operator<<
std::ostream & operator<<(std::ostream &os, const OrderWrapper &order)
Overload stream operators.
Definition: fe_type.h:164
libMesh::Elem::side_iterator::side_iterator
side_iterator(const IterType &d, const IterType &e, const PredType &p)
Definition: elem.h:2908
libMesh::Elem::set_mapping_data
void set_mapping_data(const unsigned char data)
Sets the value of the mapping data for the element.
Definition: elem.h:2548
libMesh::Elem::add_child
void add_child(Elem *elem)
Adds a child pointer to the array of children of this element.
Definition: elem.C:1384
libMesh::Order
Order
Definition: enum_order.h:40
libMesh::Elem::infinite
virtual bool infinite() const =0
libMesh::Elem::min_new_p_level_by_neighbor
unsigned int min_new_p_level_by_neighbor(const Elem *neighbor, unsigned int current_min) const
Definition: elem.C:1692
libMesh::Elem::SideIter::_parent
Elem * _parent
Definition: elem.h:2870
libMesh::TOLERANCE
static const Real TOLERANCE
Definition: libmesh_common.h:128
libMesh::Elem::set_neighbor
void set_neighbor(const unsigned int i, Elem *n)
Assigns n as the neighbor.
Definition: elem.h:2105
libMesh::Elem::find_interior_neighbors
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...
Definition: elem.C:735
libMesh::Elem::contains_vertex_of
bool contains_vertex_of(const Elem *e) const
Definition: elem.C:528
libMesh::Elem::p_level
unsigned int p_level() const
Definition: elem.h:2512
libMesh::Elem::neighbor_ptr_range
SimpleRange< NeighborPtrIter > neighbor_ptr_range()
Returns a range with all neighbors of an element, usable in range-based for loops.
Definition: elem.h:2917
libMesh::Elem::second_order_child_vertex
virtual std::pair< unsigned short int, unsigned short int > second_order_child_vertex(const unsigned int n) const
Definition: elem.C:2361
libMesh::Elem::SideIter
The definition of the protected nested SideIter class.
Definition: elem.h:2769
libMesh::Elem::node_index_range
IntRange< unsigned short > node_index_range() const
Definition: elem.h:2170
libMesh::Elem::_sbd_id
subdomain_id_type _sbd_id
The subdomain to which this element belongs.
Definition: elem.h:1761
libMesh::Elem::RefinementState
RefinementState
Enumeration of possible element refinement states.
Definition: elem.h:1169
mesh
MeshBase & mesh
Definition: mesh_communication.C:1257
libMesh::Elem::print_info
void print_info(std::ostream &os=libMesh::out) const
Prints relevant information about the element.
Definition: elem.C:2225
libMesh::Elem::refine
virtual void refine(MeshRefinement &mesh_refinement)
Refine the element.
Definition: elem_refinement.C:87
libMesh::Elem::_map_data
unsigned char _map_data
Mapping function data; currently used when needed to store the RATIONAL_BERNSTEIN nodal weight data i...
Definition: elem.h:1797
libMesh::Elem::_pflag
unsigned char _pflag
p refinement flag.
Definition: elem.h:1774
libMesh::Elem::_p_level
unsigned char _p_level
p refinement level - the difference between the polynomial degree on this element and the minimum pol...
Definition: elem.h:1784
libMesh::Elem::simple_side_ptr
void simple_side_ptr(std::unique_ptr< Elem > &side, const unsigned int i, ElemType sidetype)
An implementation for simple (all sides equal) elements.
Definition: elem.h:2277
libMesh::Elem::is_remote
virtual bool is_remote() const
Definition: elem.h:542
libMesh::DofObject::processor_id
processor_id_type processor_id() const
Definition: dof_object.h:829
libMesh::Elem::is_child_on_edge
virtual bool is_child_on_edge(const unsigned int c, const unsigned int e) const
Definition: elem.C:1646
libMesh::Elem::active
bool active() const
Definition: elem.h:2345
libMesh::Elem::_nodes
Node ** _nodes
Pointers to the nodes we are connected to.
Definition: elem.h:1743
libMesh::DofObject
The DofObject defines an abstract base class for objects that have degrees of freedom associated with...
Definition: dof_object.h:53
libMesh::Elem::family_tree_by_side
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.
Definition: elem.C:1489
libMesh::Elem::length
Real length(const unsigned int n1, const unsigned int n2) const
Definition: elem.C:399
libMesh::Elem::_rflag
unsigned char _rflag
h refinement flag.
Definition: elem.h:1768
libMesh::Elem::is_vertex_on_parent
virtual bool is_vertex_on_parent(unsigned int c, unsigned int n) const
Definition: elem.C:2671
libMesh::Elem::point
const Point & point(const unsigned int i) const
Definition: elem.h:1955
libMesh::Elem::centroid
virtual Point centroid() const
Definition: elem.C:345
libMesh::Elem::boundary_sides_end
side_iterator boundary_sides_end()
Definition: elem.C:2608
libMesh::Elem::Predicate
Predicates::multi_predicate Predicate
Useful iterator typedefs.
Definition: elem.h:1539
libMesh::Elem::opposite_side
virtual unsigned int opposite_side(const unsigned int s) const
Definition: elem.C:2695
libMesh::Elem::SideIter::operator*
Elem *& operator*() const
Definition: elem.h:2809
libMesh::Elem::invalid_subdomain_id
static const subdomain_id_type invalid_subdomain_id
A static integral constant representing an invalid subdomain id.
Definition: elem.h:244
libMesh::Elem::make_links_to_me_remote
void make_links_to_me_remote()
Resets this element's neighbors' appropriate neighbor pointers and its parent's and children's approp...
Definition: elem.C:1085
libMesh::Elem::ConstChildRefIter::ConstChildRefIter
ConstChildRefIter(const Elem *const *childpp)
Definition: elem.h:1834
libMesh::Elem::has_neighbor
bool has_neighbor(const Elem *elem) const
Definition: elem.h:2115
libMesh::Elem::second_order_adjacent_vertex
virtual unsigned short int second_order_adjacent_vertex(const unsigned int n, const unsigned int v) const
Definition: elem.C:2351
libMesh::Elem::SideIter::operator++
SideIter & operator++()
Definition: elem.h:2819
libMesh::Elem::NodeRefIter::NodeRefIter
NodeRefIter(Node *const *nodepp)
Definition: elem.h:1809
libMesh::MeshRefinement
Implements (adaptive) mesh refinement algorithms for a MeshBase.
Definition: mesh_refinement.h:61
libMesh::Elem::family_tree_by_subneighbor
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.
Definition: elem.C:1561
libMesh::Elem::local_node
unsigned int local_node(const dof_id_type i) const
Definition: elem.h:1989
libMesh::libmesh_assert
libmesh_assert(ctx)
libMesh::Elem::connectivity
virtual void connectivity(const unsigned int sc, const IOPackage iop, std::vector< dof_id_type > &conn) const =0
libMesh::Elem::is_mid_infinite_edge_node
virtual bool is_mid_infinite_edge_node(const unsigned int) const
Definition: elem.h:1584
libMesh::IntRange
The IntRange templated class is intended to make it easy to loop over integers which are indices of a...
Definition: int_range.h:53
libMesh::Elem::libmesh_assert_valid_node_pointers
void libmesh_assert_valid_node_pointers() const
Checks for a valid id and pointers to nodes with valid ids on this element.
Definition: elem.C:923
libMesh::Elem::has_ancestor_children
bool has_ancestor_children() const
Definition: elem.h:2397
libMesh::Elem::subactive
bool subactive() const
Definition: elem.h:2363
libMesh::MeshBase
This is the MeshBase class.
Definition: mesh_base.h:78
libMesh::Elem::~Elem
virtual ~Elem()
Destructor.
Definition: elem.h:1931
libMesh::Elem::node_ref_range
SimpleRange< NodeRefIter > node_ref_range()
Returns a range with all nodes of an element, usable in range-based for loops.
Definition: elem.h:2152
libMesh::Elem::SideIter::SideIter
SideIter()
Definition: elem.h:2783
libMesh::Elem::child_neighbor
Elem * child_neighbor(Elem *elem)
Definition: elem.h:2127
libMesh::Elem::ConstChildRefIter
Definition: elem.h:1830
libMesh::Elem::set_mapping_type
void set_mapping_type(const ElemMappingType type)
Sets the value of the mapping type for the element.
Definition: elem.h:2532
libMesh::Elem::active_family_tree_by_topological_neighbor
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....
Definition: elem.C:1619
libMesh::Elem::p_refinement_flag
RefinementState p_refinement_flag() const
Definition: elem.h:2630
libMesh::Elem::volume
virtual Real volume() const
Definition: elem.C:2617
libMesh::Elem::type_to_n_edges_map
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...
Definition: elem.h:656
libMesh::Elem::get_nodes
const Node *const * get_nodes() const
Definition: elem.h:2001
libMesh::Elem::first_order_equivalent_type
static ElemType first_order_equivalent_type(const ElemType et)
Definition: elem.C:2369
libMesh::DofObject::invalid_id
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:421
libMesh::Elem::write_connectivity
void write_connectivity(std::ostream &out, const IOPackage iop) const
Writes the element connectivity for various IO packages to the passed ostream "out".
Definition: elem.C:1283
libMesh::Point
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:38
libMesh::Elem::side_ptr
virtual std::unique_ptr< Elem > side_ptr(unsigned int i)=0
libMesh::Elem::type_to_n_sides_map
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...
Definition: elem.h:607
libMesh::Elem::key
virtual dof_id_type key() const
Definition: elem.C:410
libMesh::processor_id_type
uint8_t processor_id_type
Definition: id_types.h:104
libMesh::Elem::mapping_type
ElemMappingType mapping_type() const
Definition: elem.h:2524
libMesh::Elem::operator==
bool operator==(const Elem &rhs) const
Definition: elem.C:428
libMesh::Elem::total_family_tree_by_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.
Definition: elem.C:1543
libMesh::Elem::n_vertices
virtual unsigned int n_vertices() const =0
libMesh::Utility::hashword2
uint32_t hashword2(const uint32_t &first, const uint32_t &second, uint32_t initval=0)
This is a hard-coded version of hashword for hashing exactly 2 numbers.
Definition: hashword.h:210
libMesh::Elem::qual_bounds
virtual std::pair< Real, Real > qual_bounds(const ElemQuality) const
Definition: elem.h:898
libMesh::Elem::side_iterator
The definition of the struct used for iterating over sides.
Definition: elem.h:2903
libMesh::Node
A Node is like a Point, but with more information.
Definition: node.h:52
libMesh::Elem::raw_child_ptr
const Elem * raw_child_ptr(unsigned int i) const
Definition: elem.h:2558
libMesh::Elem::default_order
virtual Order default_order() const =0
libMesh::Elem::SideIter::SideIter
SideIter(const unsigned int side_number, Elem *parent)
Definition: elem.h:2773
libMesh::Elem::DO_NOTHING
Definition: elem.h:1170
libMesh::Elem::quality
virtual Real quality(const ElemQuality q) const
Definition: elem.C:1326
libMesh::Elem::SideIter::operator==
bool operator==(const SideIter &other) const
Definition: elem.h:2827
libMesh::Elem::JUST_COARSENED
Definition: elem.h:1173
libMesh::Elem::is_child_on_side
virtual bool is_child_on_side(const unsigned int c, const unsigned int s) const =0
libMesh::Elem::REFINE
Definition: elem.h:1171
libMesh::Elem::is_node_on_edge
virtual bool is_node_on_edge(const unsigned int n, const unsigned int e) const =0
libMesh::Elem::n_nodes_in_child
virtual unsigned int n_nodes_in_child(unsigned int) const
Definition: elem.h:600
libMesh::Elem::loose_bounding_box
virtual BoundingBox loose_bounding_box() const
Definition: elem.C:2649
libMesh::Elem::Elem
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Constructor.
Definition: elem.h:1871
libMesh::Elem::set_child
void set_child(unsigned int c, Elem *elem)
Sets the pointer to the child for this element.
Definition: elem.h:2586
libMesh::Elem::as_parent_node
virtual unsigned int as_parent_node(unsigned int c, unsigned int n) const
Definition: elem.C:1726
libMesh::Elem::set_node
virtual Node *& set_node(const unsigned int i)
Definition: elem.h:2059
libMesh::Elem::SideIter::side_on_boundary
bool side_on_boundary() const
Definition: elem.h:2838
libMesh::Elem::family_tree
void family_tree(std::vector< const Elem * > &family, bool reset=true) const
Fills the vector family with the children of this element, recursively.
Definition: elem.C:1441
libMesh::Elem::make_links_to_me_local
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 ...
Definition: elem.C:1007
libMesh::ElemQuality
ElemQuality
Defines an enum for element quality metrics.
Definition: enum_elem_quality.h:34
libMesh::Elem::parent
const Elem * parent() const
Definition: elem.h:2434
libMesh::Elem::SideIter::operator=
SideIter & operator=(const SideIter &other)
Definition: elem.h:2801
libMesh::Elem::boundary_sides_begin
side_iterator boundary_sides_begin()
Iterator accessor functions.
Definition: elem.C:2599
libMesh::Elem::refinement_flag
RefinementState refinement_flag() const
Definition: elem.h:2614
libMesh::Elem::max_descendant_p_level
unsigned int max_descendant_p_level() const
Definition: elem.h:2650
libMesh::INVALID_ELEM
Definition: enum_elem_type.h:75
libMesh::Elem::interior_parent
const Elem * interior_parent() const
Definition: elem.C:749
libMesh::Utility::hashword
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 ...
Definition: hashword.h:153
libMesh::Elem::family_tree_by_neighbor
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.
Definition: elem.C:1525
swap
void swap(Iterator &lhs, Iterator &rhs)
swap, used to implement op=
Definition: variant_filter_iterator.h:478
libMesh::Elem::is_edge
virtual bool is_edge(const unsigned int i) const =0
libMesh::Elem::remove_links_to_me
void remove_links_to_me()
Resets this element's neighbors' appropriate neighbor pointers and its parent's and children's approp...
Definition: elem.C:1191
libMesh::Elem::ConstNeighborPtrIter
const typedef Elem *const * ConstNeighborPtrIter
Definition: elem.h:299
libMesh::Elem::type_to_n_nodes_map
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...
Definition: elem.h:576
libMesh::Elem::hmax
virtual Real hmax() const
Definition: elem.C:379
libMesh::Elem::n_children
virtual unsigned int n_children() const =0
libMesh::Elem::opposite_node
virtual unsigned int opposite_node(const unsigned int n, const unsigned int s) const
Definition: elem.C:2703
libMesh::Elem::is_ancestor_of
bool is_ancestor_of(const Elem *descendant) const
Definition: elem.h:2413
libMesh::Elem::topological_neighbor
const Elem * topological_neighbor(const unsigned int i, const MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb) const
Definition: elem.C:865
libMesh::Elem::SideIter::_side
std::unique_ptr< Elem > _side
Definition: elem.h:2858
libMesh::Elem::reference_elem
const Elem * reference_elem() const
Definition: elem.C:338
libMesh::ElemMappingType
ElemMappingType
Enumeration of possible element master->physical mapping types.
Definition: enum_elem_type.h:82
libMesh::Elem::hmin
virtual Real hmin() const
Definition: elem.C:359
libMesh::Elem::total_family_tree_by_subneighbor
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.
Definition: elem.C:1581
libMesh::Elem::subdomain_id
subdomain_id_type subdomain_id() const
Definition: elem.h:2069
libMesh::Elem::SideIter::_side_number
unsigned int _side_number
Definition: elem.h:2873
libMesh::DofObject::id
dof_id_type id() const
Definition: dof_object.h:767
libMesh::Elem::active_family_tree
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.
Definition: elem.C:1473
libMesh::Elem::max_n_nodes
static const unsigned int max_n_nodes
The maximum number of nodes any element can contain.
Definition: elem.h:587
libMesh::Elem::SideIter::_side_ptr
Elem * _side_ptr
Definition: elem.h:2867
libMesh::Elem::has_affine_map
virtual bool has_affine_map() const
Definition: elem.h:938
libMesh::Elem::has_children
bool has_children() const
Definition: elem.h:2383
libMesh::Elem::side_index_range
IntRange< unsigned short > side_index_range() const
Definition: elem.h:2188
libMesh::Elem::embedding_matrix_version
virtual unsigned int embedding_matrix_version() const
Definition: elem.h:1649
libMesh::Elem::coarsen
void coarsen()
Coarsen the element.
Definition: elem_refinement.C:163
libMesh::Elem::is_vertex
virtual bool is_vertex(const unsigned int i) const =0
libMesh::Elem::min_p_level_by_neighbor
unsigned int min_p_level_by_neighbor(const Elem *neighbor, unsigned int current_min) const
Definition: elem.C:1663
libMesh::Elem::master_point
virtual Point master_point(const unsigned int i) const =0
libMesh::DofObject::invalid_processor_id
static const processor_id_type invalid_processor_id
An invalid processor_id to distinguish DoFs that have not been assigned to a processor.
Definition: dof_object.h:432
libMesh::Elem::get_info
std::string get_info() const
Prints relevant information about the element to a string.
Definition: elem.C:2233
libMesh::Elem
This is the base class from which all geometric element types are derived.
Definition: elem.h:100
libMesh::Elem::second_order_equivalent_type
static ElemType second_order_equivalent_type(const ElemType et, const bool full_ordered=true)
Definition: elem.C:2432
libMesh::Elem::is_face
virtual bool is_face(const unsigned int i) const =0
libMesh::Elem::is_edge_on_side
virtual bool is_edge_on_side(const unsigned int e, const unsigned int s) const =0
libMesh::Elem::libmesh_assert_valid_neighbors
void libmesh_assert_valid_neighbors() const
Checks for consistent neighbor links on this element.
Definition: elem.C:935
data
IterBase * data
Ideally this private member data should have protected access.
Definition: variant_filter_iterator.h:337
libMesh::Elem::set_refinement_flag
void set_refinement_flag(const RefinementState rflag)
Sets the value of the refinement flag for the element.
Definition: elem.h:2622
libMesh::Elem::get_node_index
unsigned int get_node_index(const Node *node_ptr) const
Definition: elem.h:2047
libMesh::PointerToPointerIter< Node >
libMesh::Elem::origin
virtual Point origin() const
Definition: elem.h:1593
libMesh::Elem::neighbor_ptr
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:2085
libMesh::TestClass
Definition: id_types.h:33
libMesh::Elem::node_id
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:1977
libMesh::Elem::node_ref
const Node & node_ref(const unsigned int i) const
Definition: elem.h:2031
libMesh::Elem::_map_type
unsigned char _map_type
Mapping function type; currently either 0 (LAGRANGE) or 1 (RATIONAL_BERNSTEIN).
Definition: elem.h:1791
libMesh::Real
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Definition: libmesh_common.h:121
libMesh::Elem::operator=
Elem & operator=(const Elem &)=delete
libMesh::Elem::_elemlinks
Elem ** _elemlinks
Pointers to this element's parent and neighbors, and for lower-dimensional elements' interior_parent.
Definition: elem.h:1749
libMesh::Elem::is_linear
virtual bool is_linear() const
Definition: elem.h:944
libMesh::Elem::INACTIVE
Definition: elem.h:1174
libMesh::Elem::active_family_tree_by_neighbor
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.
Definition: elem.C:1601
libMesh::Elem::simple_build_side_ptr
void simple_build_side_ptr(std::unique_ptr< Elem > &side, const unsigned int i, ElemType sidetype)
An implementation for simple (all sides equal) elements.
Definition: elem.h:2252
libMesh::Elem::n_sides
virtual unsigned int n_sides() const =0
libMesh::Elem::_get_parent_indices_cache
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...
Definition: elem.h:1721
libMesh::Elem::n_sub_elem
virtual unsigned int n_sub_elem() const =0
libMesh::Elem::build
static std::unique_ptr< Elem > build(const ElemType type, Elem *p=nullptr)
Definition: elem.C:246
libMesh::Elem::build_edge_ptr
virtual std::unique_ptr< Elem > build_edge_ptr(const unsigned int i)=0
libMesh::Elem::NeighborPtrIter
Elem *const * NeighborPtrIter
Nested "classes" for use iterating over all neighbors of an element.
Definition: elem.h:298
libMesh::out
OStreamProxy out
libMesh::Elem::node_ptr
const Node * node_ptr(const unsigned int i) const
Definition: elem.h:2009
libMesh::PointLocatorBase
This is the base class for point locators.
Definition: point_locator_base.h:62
libMesh::Elem::hack_p_level
void hack_p_level(const unsigned int p)
Sets the value of the p-refinement level for the element without altering the p-level of its ancestor...
Definition: elem.h:2668
libMesh::Elem::NodeRefIter
Definition: elem.h:1805
libMesh::Elem::nodes_on_side
virtual std::vector< unsigned int > nodes_on_side(const unsigned int) const =0
libMesh::Elem::type
virtual ElemType type() const =0
libMesh::Elem::which_neighbor_am_i
unsigned int which_neighbor_am_i(const Elem *e) const
This function tells you which neighbor e is.
Definition: elem.h:2323
libMesh::Elem::has_topological_neighbor
bool has_topological_neighbor(const Elem *elem, const MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb) const
Definition: elem.C:902
libMesh::Elem::INVALID_REFINEMENTSTATE
Definition: elem.h:1176
libMesh::Elem::which_child_am_i
unsigned int which_child_am_i(const Elem *e) const
Definition: elem.h:2596
int
void ErrorVector unsigned int
Definition: adjoints_ex3.C:360
libMesh::Elem::ConstNodeRefIter
Definition: elem.h:1813
libMesh::Elem::ChildRefIter::ChildRefIter
ChildRefIter(Elem *const *childpp)
Definition: elem.h:1826
libMesh::Elem::_get_bracketing_node_cache
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...
Definition: elem.h:1707
libMesh::ElemType
ElemType
Defines an enum for geometric element types.
Definition: enum_elem_type.h:33
libMesh::Elem::point_test
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.
Definition: elem.C:2131
libMesh::Elem::top_parent
const Elem * top_parent() const
Definition: elem.h:2460