libMesh::InfQuad Class Referenceabstract

The base class for all 2D infinite quadrilateral element types. More...

#include <face_inf_quad.h>

Inheritance diagram for libMesh::InfQuad:

Public Types

enum  RefinementState {
  COARSEN = 0, DO_NOTHING, REFINE, JUST_REFINED,
  JUST_COARSENED, INACTIVE, COARSEN_INACTIVE, INVALID_REFINEMENTSTATE
}
 
typedef Elem *const * NeighborPtrIter
 
typedef const Elem *const * ConstNeighborPtrIter
 
typedef Predicates::multi_predicate Predicate
 

Public Member Functions

 InfQuad (const unsigned int nn, Elem *p, Node **nodelinkdata)
 
virtual Point master_point (const unsigned int i) const libmesh_override
 
virtual unsigned int dim () const libmesh_override
 
virtual unsigned int n_sides () const libmesh_override
 
virtual unsigned int n_vertices () const libmesh_override
 
virtual unsigned int n_edges () const libmesh_override
 
virtual unsigned int n_faces () const libmesh_override
 
virtual unsigned int n_children () const libmesh_override
 
virtual bool is_mid_infinite_edge_node (const unsigned int i) const libmesh_override
 
virtual bool is_child_on_side (const unsigned int c, const unsigned int s) const libmesh_override
 
virtual dof_id_type key (const unsigned int s) const libmesh_override
 
virtual unsigned int which_node_am_i (unsigned int side, unsigned int side_node) const libmesh_override
 
virtual std::unique_ptr< Elemside_ptr (const unsigned int i) libmesh_override
 
virtual std::unique_ptr< Elembuild_edge_ptr (const unsigned int i) libmesh_override
 
virtual bool is_edge_on_side (const unsigned int e, const unsigned int s) const libmesh_override
 
virtual Real quality (const ElemQuality q) const libmesh_override
 
virtual std::pair< Real, Realqual_bounds (const ElemQuality q) const libmesh_override
 
virtual bool infinite () const libmesh_override
 
virtual Point origin () const libmesh_override
 
const Pointpoint (const unsigned int i) const
 
Pointpoint (const unsigned int i)
 
dof_id_type node_id (const unsigned int i) const
 
dof_id_type node (const unsigned int i) const
 
unsigned int local_node (const dof_id_type i) const
 
unsigned int get_node_index (const Node *node_ptr) const
 
const Node *const * get_nodes () const
 
const Nodenode_ptr (const unsigned int i) const
 
Nodenode_ptr (const unsigned int i)
 
const Nodenode_ref (const unsigned int i) const
 
Nodenode_ref (const unsigned int i)
 
Nodeget_node (const unsigned int i) const
 
virtual Node *& set_node (const unsigned int i)
 
SimpleRange< NodeRefIternode_ref_range ()
 
SimpleRange< ConstNodeRefIternode_ref_range () const
 
subdomain_id_type subdomain_id () const
 
subdomain_id_typesubdomain_id ()
 
const Elemreference_elem () const
 
virtual dof_id_type key () const
 
bool operator== (const Elem &rhs) const
 
const Elemneighbor_ptr (unsigned int i) const
 
Elemneighbor_ptr (unsigned int i)
 
Elemneighbor (const unsigned int i) const
 
SimpleRange< NeighborPtrIterneighbor_ptr_range ()
 
SimpleRange< ConstNeighborPtrIterneighbor_ptr_range () const
 
const Elemtopological_neighbor (const unsigned int i, const MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb) const
 
Elemtopological_neighbor (const unsigned int i, MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb)
 
bool has_topological_neighbor (const Elem *elem, const MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb) const
 
void set_neighbor (const unsigned int i, Elem *n)
 
bool has_neighbor (const Elem *elem) const
 
Elemchild_neighbor (Elem *elem)
 
const Elemchild_neighbor (const Elem *elem) const
 
bool on_boundary () const
 
bool is_semilocal (const processor_id_type my_pid) const
 
unsigned int which_neighbor_am_i (const Elem *e) const
 
unsigned int which_side_am_i (const Elem *e) const
 
bool contains_vertex_of (const Elem *e) const
 
bool contains_edge_of (const Elem *e) const
 
void find_point_neighbors (const Point &p, std::set< const Elem * > &neighbor_set) const
 
void find_point_neighbors (std::set< const Elem * > &neighbor_set) const
 
void find_point_neighbors (std::set< const Elem * > &neighbor_set, const Elem *start_elem) const
 
void find_edge_neighbors (const Point &p1, const Point &p2, std::set< const Elem * > &neighbor_set) const
 
void find_edge_neighbors (std::set< const Elem * > &neighbor_set) const
 
void find_interior_neighbors (std::set< const Elem * > &neighbor_set) const
 
void remove_links_to_me ()
 
void make_links_to_me_remote ()
 
void make_links_to_me_local (unsigned int n)
 
virtual bool is_remote () const
 
virtual void connectivity (const unsigned int sc, const IOPackage iop, std::vector< dof_id_type > &conn) const =0
 
void write_connectivity (std::ostream &out, const IOPackage iop) const
 
virtual ElemType type () const =0
 
virtual unsigned int n_nodes () const =0
 
IntRange< unsigned short > node_index_range () const
 
virtual unsigned int n_nodes_in_child (unsigned int) const
 
IntRange< unsigned short > side_index_range () const
 
unsigned int n_neighbors () const
 
IntRange< unsigned short > edge_index_range () const
 
virtual bool is_vertex (const unsigned int i) const =0
 
virtual unsigned int is_vertex_on_child (unsigned int, unsigned int n) const
 
virtual bool is_vertex_on_parent (unsigned int c, unsigned int n) const
 
virtual bool is_edge (const unsigned int i) const =0
 
virtual bool is_face (const unsigned int i) const =0
 
virtual bool is_node_on_side (const unsigned int n, const unsigned int s) const =0
 
virtual bool is_node_on_edge (const unsigned int n, const unsigned int e) const =0
 
virtual unsigned int opposite_side (const unsigned int s) const
 
virtual unsigned int opposite_node (const unsigned int n, const unsigned int s) const
 
virtual unsigned int n_sub_elem () const =0
 
std::unique_ptr< const Elemside_ptr (unsigned int i) const
 
std::unique_ptr< Elemside (const unsigned int i) const
 
virtual std::unique_ptr< Elembuild_side_ptr (const unsigned int i, bool proxy=true)=0
 
std::unique_ptr< const Elembuild_side_ptr (const unsigned int i, bool proxy=true) const
 
std::unique_ptr< Elembuild_side (const unsigned int i, bool proxy=true) const
 
std::unique_ptr< const Elembuild_edge_ptr (const unsigned int i) const
 
std::unique_ptr< Elembuild_edge (const unsigned int i) const
 
virtual Order default_order () const =0
 
virtual Point centroid () const
 
virtual Real hmin () const
 
virtual Real hmax () const
 
virtual Real volume () const
 
virtual BoundingBox loose_bounding_box () const
 
virtual bool contains_point (const Point &p, Real tol=TOLERANCE) const
 
virtual bool close_to_point (const Point &p, Real tol) const
 
virtual bool has_affine_map () const
 
virtual bool is_linear () const
 
void print_info (std::ostream &os=libMesh::out) const
 
std::string get_info () const
 
bool active () const
 
bool ancestor () const
 
bool subactive () const
 
bool has_children () const
 
bool has_ancestor_children () const
 
bool is_ancestor_of (const Elem *descendant) const
 
const Elemparent () const
 
Elemparent ()
 
void set_parent (Elem *p)
 
const Elemtop_parent () const
 
const Eleminterior_parent () const
 
Eleminterior_parent ()
 
void set_interior_parent (Elem *p)
 
Real length (const unsigned int n1, const unsigned int n2) const
 
virtual unsigned int n_second_order_adjacent_vertices (const unsigned int n) const
 
virtual unsigned short int second_order_adjacent_vertex (const unsigned int n, const unsigned int v) const
 
virtual std::pair< unsigned short int, unsigned short int > second_order_child_vertex (const unsigned int n) const
 
unsigned int level () const
 
unsigned int p_level () const
 
const Elemraw_child_ptr (unsigned int i) const
 
const Elemchild_ptr (unsigned int i) const
 
Elemchild_ptr (unsigned int i)
 
Elemchild (const unsigned int i) const
 
SimpleRange< ChildRefIterchild_ref_range ()
 
SimpleRange< ConstChildRefIterchild_ref_range () const
 
unsigned int which_child_am_i (const Elem *e) const
 
virtual bool is_child_on_edge (const unsigned int c, const unsigned int e) const
 
void add_child (Elem *elem)
 
void add_child (Elem *elem, unsigned int c)
 
void replace_child (Elem *elem, unsigned int c)
 
void family_tree (std::vector< const Elem * > &family, const bool reset=true) const
 
void total_family_tree (std::vector< const Elem * > &active_family, const bool reset=true) const
 
void active_family_tree (std::vector< const Elem * > &active_family, const bool reset=true) const
 
void family_tree_by_side (std::vector< const Elem * > &family, const unsigned int side, const bool reset=true) const
 
void active_family_tree_by_side (std::vector< const Elem * > &family, const unsigned int side, const bool reset=true) const
 
void family_tree_by_neighbor (std::vector< const Elem * > &family, const Elem *neighbor, const bool reset=true) const
 
void total_family_tree_by_neighbor (std::vector< const Elem * > &family, const Elem *neighbor, const bool reset=true) const
 
void family_tree_by_subneighbor (std::vector< const Elem * > &family, const Elem *neighbor, const Elem *subneighbor, const bool reset=true) const
 
void total_family_tree_by_subneighbor (std::vector< const Elem * > &family, const Elem *neighbor, const Elem *subneighbor, const bool reset=true) const
 
void active_family_tree_by_neighbor (std::vector< const Elem * > &family, const Elem *neighbor, 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
 
RefinementState refinement_flag () const
 
void set_refinement_flag (const RefinementState rflag)
 
RefinementState p_refinement_flag () const
 
void set_p_refinement_flag (const RefinementState pflag)
 
unsigned int max_descendant_p_level () const
 
unsigned int min_p_level_by_neighbor (const Elem *neighbor, unsigned int current_min) const
 
unsigned int min_new_p_level_by_neighbor (const Elem *neighbor, unsigned int current_min) const
 
void set_p_level (const unsigned int p)
 
void hack_p_level (const unsigned int p)
 
virtual void refine (MeshRefinement &mesh_refinement)
 
void coarsen ()
 
void contract ()
 
void libmesh_assert_valid_neighbors () const
 
void libmesh_assert_valid_node_pointers () const
 
side_iterator boundary_sides_begin ()
 
side_iterator boundary_sides_end ()
 
virtual unsigned int as_parent_node (unsigned int c, unsigned int n) const
 
virtual const std::vector< std::pair< unsigned char, unsigned char > > & parent_bracketing_nodes (unsigned int c, unsigned int n) const
 
virtual const std::vector< std::pair< dof_id_type, dof_id_type > > bracketing_nodes (unsigned int c, unsigned int n) const
 
virtual float embedding_matrix (const unsigned int child_num, const unsigned int child_node_num, const unsigned int parent_node_num) const =0
 
virtual unsigned int embedding_matrix_version () const
 
void nullify_neighbors ()
 
void clear_old_dof_object ()
 
void set_old_dof_object ()
 
void clear_dofs ()
 
void invalidate_dofs (const unsigned int sys_num=libMesh::invalid_uint)
 
void invalidate_id ()
 
void invalidate_processor_id ()
 
void invalidate ()
 
unsigned int n_dofs (const unsigned int s, const unsigned int var=libMesh::invalid_uint) const
 
dof_id_type id () const
 
dof_id_typeset_id ()
 
void set_id (const dof_id_type dofid)
 
unique_id_type unique_id () const
 
unique_id_typeset_unique_id ()
 
bool valid_id () const
 
bool valid_unique_id () const
 
processor_id_type processor_id () const
 
processor_id_typeprocessor_id ()
 
void processor_id (const processor_id_type pid)
 
bool valid_processor_id () const
 
unsigned int n_systems () const
 
void set_n_systems (const unsigned int s)
 
void add_system ()
 
unsigned int n_var_groups (const unsigned int s) const
 
unsigned int n_vars (const unsigned int s, const unsigned int vg) const
 
unsigned int n_vars (const unsigned int s) const
 
void set_n_vars_per_group (const unsigned int s, const std::vector< unsigned int > &nvpg)
 
unsigned int n_comp (const unsigned int s, const unsigned int var) const
 
unsigned int n_comp_group (const unsigned int s, const unsigned int vg) const
 
void set_n_comp (const unsigned int s, const unsigned int var, const unsigned int ncomp)
 
void set_n_comp_group (const unsigned int s, const unsigned int vg, const unsigned int ncomp)
 
dof_id_type dof_number (const unsigned int s, const unsigned int var, const unsigned int comp) const
 
void set_dof_number (const unsigned int s, const unsigned int var, const unsigned int comp, const dof_id_type dn)
 
bool has_dofs (const unsigned int s=libMesh::invalid_uint) const
 
void set_vg_dof_base (const unsigned int s, const unsigned int vg, const dof_id_type db)
 
dof_id_type vg_dof_base (const unsigned int s, const unsigned int vg) const
 
unsigned int packed_indexing_size () const
 
void unpack_indexing (std::vector< largest_id_type >::const_iterator begin)
 
void pack_indexing (std::back_insert_iterator< std::vector< largest_id_type >> target) const
 
void debug_buffer () const
 
void print_dof_info () const
 
void set_buffer (const std::vector< dof_id_type > &buf)
 

Static Public Member Functions

static void print_info (std::ostream &out=libMesh::out)
 
static void print_info (std::ostream &out=libMesh::out)
 
static std::string get_info ()
 
static std::string get_info ()
 
static ElemType second_order_equivalent_type (const ElemType et, const bool full_ordered=true)
 
static ElemType first_order_equivalent_type (const ElemType et)
 
static std::unique_ptr< Elembuild (const ElemType type, Elem *p=libmesh_nullptr)
 
static unsigned int n_objects ()
 
static unsigned int n_objects ()
 
static void enable_print_counter_info ()
 
static void enable_print_counter_info ()
 
static void disable_print_counter_info ()
 
static void disable_print_counter_info ()
 
static unsigned int unpackable_indexing_size (std::vector< largest_id_type >::const_iterator begin)
 

Public Attributes

DofObjectold_dof_object
 

Static Public Attributes

static const subdomain_id_type invalid_subdomain_id = std::numeric_limits<subdomain_id_type>::max()
 
static const unsigned int type_to_n_nodes_map [INVALID_ELEM]
 
static const unsigned int type_to_n_sides_map [INVALID_ELEM]
 
static const unsigned int type_to_n_edges_map [INVALID_ELEM]
 
static const dof_id_type invalid_id = static_cast<dof_id_type>(-1)
 
static const unique_id_type invalid_unique_id = static_cast<unique_id_type>(-1)
 
static const processor_id_type invalid_processor_id = static_cast<processor_id_type>(-1)
 

Protected Types

typedef std::map< std::string, std::pair< unsigned int, unsigned int > > Counts
 
typedef std::map< std::string, std::pair< unsigned int, unsigned int > > Counts
 

Protected Member Functions

virtual std::vector< std::vector< std::vector< std::vector< std::pair< unsigned char, unsigned char > > > > > & _get_bracketing_node_cache () const
 
virtual std::vector< std::vector< std::vector< signed char > > > & _get_parent_indices_cache () const
 
void increment_constructor_count (const std::string &name)
 
void increment_constructor_count (const std::string &name)
 
void increment_destructor_count (const std::string &name)
 
void increment_destructor_count (const std::string &name)
 

Static Protected Member Functions

static dof_id_type compute_key (dof_id_type n0)
 
static dof_id_type compute_key (dof_id_type n0, dof_id_type n1)
 
static dof_id_type compute_key (dof_id_type n0, dof_id_type n1, dof_id_type n2)
 
static dof_id_type compute_key (dof_id_type n0, dof_id_type n1, dof_id_type n2, dof_id_type n3)
 

Protected Attributes

Elem_elemlinks_data [4+(LIBMESH_DIM >2)]
 
Node ** _nodes
 
Elem ** _elemlinks
 
Elem ** _children
 
subdomain_id_type _sbd_id
 
unsigned char _rflag
 
unsigned char _pflag
 
unsigned char _p_level
 

Static Protected Attributes

static const Real _master_points [6][3]
 
static Counts _counts
 
static Counts _counts
 
static Threads::atomic< unsigned int > _n_objects
 
static Threads::atomic< unsigned int > _n_objects
 
static Threads::spin_mutex _mutex
 
static Threads::spin_mutex _mutex
 
static bool _enable_print_counter = true
 
static bool _enable_print_counter = true
 

Detailed Description

The base class for all 2D infinite quadrilateral element types.

The InfQuad is an abstract element type that lives in two dimensions. Here, an infinite face is always a quadrilateral, so this class is directly derived from Elem, without an intermediate InfFace class.

It looks like this:

*                                   closer to infinity
*          |           |
*          |           |
*   side 2 |           | side 1
*          |           |
*          |           |
*           -----------             base side
*
*             side 0
* 
Author
Daniel Dreyer
Date
2003

Definition at line 56 of file face_inf_quad.h.

Member Typedef Documentation

typedef const Elem* const* libMesh::Elem::ConstNeighborPtrIter
inherited

Definition at line 300 of file elem.h.

typedef std::map<std::string, std::pair<unsigned int, unsigned int> > libMesh::ReferenceCounter::Counts
protectedinherited

Data structure to log the information. The log is identified by the class name.

Definition at line 119 of file reference_counter.h.

typedef std::map<std::string, std::pair<unsigned int, unsigned int> > libMesh::ReferenceCounter::Counts
protectedinherited

Data structure to log the information. The log is identified by the class name.

Definition at line 119 of file reference_counter.h.

typedef Elem* const* libMesh::Elem::NeighborPtrIter
inherited

Nested "classes" for use iterating over all neighbors of an element.

Definition at line 299 of file elem.h.

Useful iterator typedefs

Definition at line 1427 of file elem.h.

Member Enumeration Documentation

Enumeration of possible element refinement states.

Enumerator
COARSEN 
DO_NOTHING 
REFINE 
JUST_REFINED 
JUST_COARSENED 
INACTIVE 
COARSEN_INACTIVE 
INVALID_REFINEMENTSTATE 

Definition at line 1126 of file elem.h.

Constructor & Destructor Documentation

libMesh::InfQuad::InfQuad ( const unsigned int  nn,
Elem p,
Node **  nodelinkdata 
)
inlineexplicit

Constructor. Derived classes implement 'true' elements.

Definition at line 64 of file face_inf_quad.h.

References libmesh_nullptr, and libMesh::Elem::set_interior_parent().

66  :
67  Elem(nn, InfQuad::n_sides(), p, _elemlinks_data, nodelinkdata)
68  {
69  // Make sure the interior parent isn't undefined
70  if (LIBMESH_DIM > 2)
72  }
const class libmesh_nullptr_t libmesh_nullptr
void set_interior_parent(Elem *p)
Definition: elem.C:895
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1732
Elem * _elemlinks_data[4+(LIBMESH_DIM >2)]
virtual unsigned int n_sides() const libmesh_override
Definition: face_inf_quad.h:96

Member Function Documentation

virtual std::vector<std::vector<std::vector<std::vector<std::pair<unsigned char, unsigned char> > > > >& libMesh::Elem::_get_bracketing_node_cache ( ) const
inlineprotectedvirtualinherited

Elem subclasses which don't do their own bracketing node calculations will need to supply a static cache, since the default calculation is slow.

Definition at line 1580 of file elem.h.

Referenced by libMesh::Elem::parent_bracketing_nodes().

1581  {
1582  static std::vector<std::vector<std::vector<std::vector<std::pair<unsigned char, unsigned char>>>>> c;
1583  libmesh_error();
1584  return c;
1585  }
virtual std::vector<std::vector<std::vector<signed char> > >& libMesh::Elem::_get_parent_indices_cache ( ) const
inlineprotectedvirtualinherited

Elem subclasses which don't do their own child-to-parent node calculations will need to supply a static cache, since the default calculation is slow.

Definition at line 1594 of file elem.h.

References libMesh::Elem::nullify_neighbors().

Referenced by libMesh::Elem::as_parent_node().

1595  {
1596  static std::vector<std::vector<std::vector<signed char>>> c;
1597  libmesh_error();
1598  return c;
1599  }
bool libMesh::Elem::active ( ) const
inlineinherited
Returns
true if the element is active (i.e. has no active descendants) or AMR is disabled, false otherwise.
Note
It suffices to check the first child only.

Definition at line 2258 of file elem.h.

References libMesh::Elem::COARSEN_INACTIVE, libMesh::Elem::INACTIVE, and libMesh::Elem::refinement_flag().

Referenced by libMesh::MeshRefinement::_coarsen_elements(), libMesh::DofMap::_dof_indices(), libMesh::MeshRefinement::_refine_elements(), libMesh::Elem::active_family_tree(), libMesh::Elem::active_family_tree_by_neighbor(), libMesh::Elem::active_family_tree_by_side(), libMesh::Elem::active_family_tree_by_topological_neighbor(), libMesh::HPCoarsenTest::add_projection(), libMesh::Elem::ancestor(), libMesh::Patch::build_around_element(), libMesh::ParmetisPartitioner::build_graph(), libMesh::Elem::coarsen(), libMesh::MeshRefinement::coarsen_elements(), libMesh::FEGenericBase< OutputType >::compute_periodic_constraints(), libMesh::FEAbstract::compute_periodic_node_constraints(), libMesh::FEGenericBase< OutputType >::compute_proj_constraints(), libMesh::connect_families(), libMesh::UnstructuredMesh::contract(), libMesh::Elem::contract(), libMesh::DofMap::dof_indices(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::Elem::family_tree(), libMesh::Elem::family_tree_by_neighbor(), libMesh::Elem::family_tree_by_side(), libMesh::Elem::family_tree_by_subneighbor(), libMesh::Elem::find_interior_neighbors(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshTools::find_nodal_neighbors(), libMesh::Elem::find_point_neighbors(), libMesh::Elem::get_info(), libMesh::ErrorVector::is_active_elem(), libMesh::Elem::is_linear(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_flags(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_p_levels(), libMesh::MeshTools::libmesh_assert_valid_remote_elems(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::Elem::make_links_to_me_local(), libMesh::MeshRefinement::make_refinement_compatible(), libMesh::Elem::max_descendant_p_level(), libMesh::Elem::min_new_p_level_by_neighbor(), libMesh::Elem::min_p_level_by_neighbor(), libMesh::DofMap::old_dof_indices(), libMesh::PointLocatorTree::operator()(), libMesh::MetisPartitioner::partition_range(), libMesh::Elem::refine(), libMesh::MeshRefinement::refine_and_coarsen_elements(), libMesh::MeshRefinement::refine_elements(), libMesh::Elem::subactive(), libMesh::Parallel::sync_element_data_by_parent_id(), libMesh::MeshRefinement::test_level_one(), and libMesh::Parallel::Packing< Elem * >::unpack().

2259 {
2260 #ifdef LIBMESH_ENABLE_AMR
2261  if ((this->refinement_flag() == INACTIVE) ||
2262  (this->refinement_flag() == COARSEN_INACTIVE))
2263  return false;
2264  else
2265  return true;
2266 #else
2267  return true;
2268 #endif
2269 }
RefinementState refinement_flag() const
Definition: elem.h:2506
void libMesh::Elem::active_family_tree ( std::vector< const Elem * > &  active_family,
const bool  reset = true 
) const
inherited

Same as the family_tree() member, but only adds the active children. Can be thought of as removing all the inactive elements from the vector created by family_tree, but is implemented more efficiently.

Definition at line 1613 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::child_ref_range(), and libMesh::Elem::subactive().

Referenced by libMesh::MeshCommunication::delete_remote_elements(), libMesh::SiblingCoupling::operator()(), and libMesh::Partitioner::set_parent_processor_ids().

1615 {
1616  // The "family tree" doesn't include subactive elements
1617  libmesh_assert(!this->subactive());
1618 
1619  // Clear the vector if the flag reset tells us to.
1620  if (reset)
1621  active_family.clear();
1622 
1623  // Add this element to the family tree if it is active
1624  if (this->active())
1625  active_family.push_back(this);
1626 
1627  // Otherwise recurse into the element's children.
1628  // Do not clear the vector any more.
1629  else
1630  for (auto & c : this->child_ref_range())
1631  if (!c.is_remote())
1632  c.active_family_tree (active_family, false);
1633 }
bool subactive() const
Definition: elem.h:2276
bool active() const
Definition: elem.h:2258
SimpleRange< ChildRefIter > child_ref_range()
Definition: elem.h:1700
void libMesh::Elem::active_family_tree_by_neighbor ( std::vector< const Elem * > &  family,
const Elem neighbor,
const bool  reset = true 
) const
inherited

Same as the active_family_tree() member, but only adds elements which are next to neighbor.

Definition at line 1873 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::child_ref_range(), libMesh::Elem::has_neighbor(), libMesh::Elem::level(), libMesh::remote_elem, and libMesh::Elem::subactive().

Referenced by libMesh::Elem::find_edge_neighbors(), libMesh::Patch::find_face_neighbors(), libMesh::Elem::find_point_neighbors(), libMesh::GhostPointNeighbors::operator()(), and libMesh::DefaultCoupling::operator()().

1876 {
1877  // The "family tree" doesn't include subactive elements or
1878  // remote_elements
1879  libmesh_assert(!this->subactive());
1880  libmesh_assert(this != remote_elem);
1881 
1882  // Clear the vector if the flag reset tells us to.
1883  if (reset)
1884  family.clear();
1885 
1886  // This only makes sense if we're already a neighbor
1887 #ifndef NDEBUG
1888  if (this->level() >= neighbor_in->level())
1889  libmesh_assert (this->has_neighbor(neighbor_in));
1890 #endif
1891 
1892  // Add an active element to the family tree.
1893  if (this->active())
1894  family.push_back(this);
1895 
1896  // Or recurse into an ancestor element's children.
1897  // Do not clear the vector any more.
1898  else if (!this->active())
1899  for (auto & c : this->child_ref_range())
1900  if (&c != remote_elem && c.has_neighbor(neighbor_in))
1901  c.active_family_tree_by_neighbor (family, neighbor_in, false);
1902 }
bool subactive() const
Definition: elem.h:2276
bool active() const
Definition: elem.h:2258
SimpleRange< ChildRefIter > child_ref_range()
Definition: elem.h:1700
bool has_neighbor(const Elem *elem) const
Definition: elem.h:2011
unsigned int level() const
Definition: elem.h:2389
const RemoteElem * remote_elem
Definition: remote_elem.C:57
void libMesh::Elem::active_family_tree_by_side ( std::vector< const Elem * > &  family,
const unsigned int  side,
const bool  reset = true 
) const
inherited

Same as the active_family_tree() member, but only adds elements which are next to side.

Definition at line 1666 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::active_family_tree_by_side(), libMesh::Elem::child_ptr(), libMesh::Elem::is_child_on_side(), libMesh::Elem::is_remote(), libMesh::Elem::n_children(), libMesh::Elem::n_sides(), libMesh::remote_elem, and libMesh::Elem::subactive().

Referenced by libMesh::Elem::active_family_tree_by_side(), libMesh::Nemesis_IO_Helper::write_sidesets(), and libMesh::ExodusII_IO_Helper::write_sidesets().

1669 {
1670  // The "family tree" doesn't include subactive or remote elements
1671  libmesh_assert(!this->subactive());
1672  libmesh_assert(this != remote_elem);
1673 
1674  // Clear the vector if the flag reset tells us to.
1675  if (reset)
1676  family.clear();
1677 
1678  libmesh_assert_less (s, this->n_sides());
1679 
1680  // Add an active element to the family tree.
1681  if (this->active())
1682  family.push_back(this);
1683 
1684  // Or recurse into an ancestor element's children.
1685  // Do not clear the vector any more.
1686  else
1687  {
1688  const unsigned int nc = this->n_children();
1689  for (unsigned int c = 0; c != nc; c++)
1690  if (!this->child_ptr(c)->is_remote() && this->is_child_on_side(c, s))
1691  this->child_ptr(c)->active_family_tree_by_side (family, s, false);
1692  }
1693 }
bool subactive() const
Definition: elem.h:2276
bool active() const
Definition: elem.h:2258
virtual bool is_child_on_side(const unsigned int c, const unsigned int s) const =0
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2446
virtual unsigned int n_sides() const =0
virtual bool is_remote() const
Definition: elem.h:531
virtual unsigned int n_children() const =0
void active_family_tree_by_side(std::vector< const Elem * > &family, const unsigned int side, const bool reset=true) const
Definition: elem.C:1666
const RemoteElem * remote_elem
Definition: remote_elem.C:57
void libMesh::Elem::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
inherited

Same as the active_family_tree_by_neighbor() member, but the neighbor here may be a topological (e.g. periodic boundary condition) neighbor, not just a local neighbor.

Definition at line 1831 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::child_ref_range(), libMesh::Elem::has_topological_neighbor(), libMesh::Elem::level(), libMesh::remote_elem, and libMesh::Elem::subactive().

Referenced by libMesh::DefaultCoupling::operator()(), and libMesh::Elem::total_family_tree_by_subneighbor().

1837 {
1838  // The "family tree" doesn't include subactive elements or
1839  // remote_elements
1840  libmesh_assert(!this->subactive());
1841  libmesh_assert(this != remote_elem);
1842 
1843  // Clear the vector if the flag reset tells us to.
1844  if (reset)
1845  family.clear();
1846 
1847  // This only makes sense if we're already a topological neighbor
1848 #ifndef NDEBUG
1849  if (this->level() >= neighbor_in->level())
1850  libmesh_assert (this->has_topological_neighbor(neighbor_in,
1851  mesh,
1852  point_locator,
1853  pb));
1854 #endif
1855 
1856  // Add an active element to the family tree.
1857  if (this->active())
1858  family.push_back(this);
1859 
1860  // Or recurse into an ancestor element's children.
1861  // Do not clear the vector any more.
1862  else if (!this->active())
1863  for (auto & c : this->child_ref_range())
1864  if (&c != remote_elem &&
1865  c.has_topological_neighbor(neighbor_in, mesh, point_locator,
1866  pb))
1867  c.active_family_tree_by_topological_neighbor
1868  (family, neighbor_in, mesh, point_locator, pb, false);
1869 }
bool subactive() const
Definition: elem.h:2276
bool active() const
Definition: elem.h:2258
bool has_topological_neighbor(const Elem *elem, const MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb) const
Definition: elem.C:996
MeshBase & mesh
SimpleRange< ChildRefIter > child_ref_range()
Definition: elem.h:1700
unsigned int level() const
Definition: elem.h:2389
const RemoteElem * remote_elem
Definition: remote_elem.C:57
void libMesh::Elem::add_child ( Elem elem)
inherited

Adds a child pointer to the array of children of this element. If this is the first child to be added, this method allocates memory in the parent's _children array, otherwise, it just sets the pointer.

Definition at line 1497 of file elem.C.

References libMesh::Elem::_children, libmesh_nullptr, libMesh::Elem::n_children(), libMesh::Elem::parent(), libMesh::remote_elem, and libMesh::Elem::set_child().

Referenced by libMesh::UnstructuredMesh::all_first_order(), libMesh::UnstructuredMesh::copy_nodes_and_elements(), libMesh::CheckpointIO::read_remote_elem(), libMesh::XdrIO::read_serialized_connectivity(), and libMesh::Parallel::Packing< Elem * >::unpack().

1498 {
1499  const unsigned int nc = this->n_children();
1500 
1501  if (_children == libmesh_nullptr)
1502  {
1503  _children = new Elem *[nc];
1504 
1505  for (unsigned int c = 0; c != nc; c++)
1506  this->set_child(c, libmesh_nullptr);
1507  }
1508 
1509  for (unsigned int c = 0; c != nc; c++)
1510  {
1511  if (this->_children[c] == libmesh_nullptr || this->_children[c] == remote_elem)
1512  {
1513  libmesh_assert_equal_to (this, elem->parent());
1514  this->set_child(c, elem);
1515  return;
1516  }
1517  }
1518 
1519  libmesh_error_msg("Error: Tried to add a child to an element with full children array");
1520 }
const class libmesh_nullptr_t libmesh_nullptr
Elem ** _children
Definition: elem.h:1628
virtual unsigned int n_children() const =0
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1732
void set_child(unsigned int c, Elem *elem)
Definition: elem.h:2478
const RemoteElem * remote_elem
Definition: remote_elem.C:57
void libMesh::Elem::add_child ( Elem elem,
unsigned int  c 
)
inherited

Adds a new child pointer to the specified index in the array of children of this element. If this is the first child to be added, this method allocates memory in the parent's _children array, otherwise, it just sets the pointer.

Definition at line 1524 of file elem.C.

References libMesh::Elem::_children, libMesh::Elem::child_ptr(), libMesh::Elem::has_children(), libmesh_nullptr, libMesh::Elem::n_children(), libMesh::Elem::parent(), libMesh::remote_elem, and libMesh::Elem::set_child().

1525 {
1526  if (!this->has_children())
1527  {
1528  const unsigned int nc = this->n_children();
1529  _children = new Elem *[nc];
1530 
1531  for (unsigned int i = 0; i != nc; i++)
1532  this->set_child(i, libmesh_nullptr);
1533  }
1534 
1535  libmesh_assert (this->_children[c] == libmesh_nullptr || this->child_ptr(c) == remote_elem);
1536  libmesh_assert (elem == remote_elem || this == elem->parent());
1537 
1538  this->set_child(c, elem);
1539 }
bool has_children() const
Definition: elem.h:2296
const Elem * parent() const
Definition: elem.h:2347
const class libmesh_nullptr_t libmesh_nullptr
Elem ** _children
Definition: elem.h:1628
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2446
virtual unsigned int n_children() const =0
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1732
void set_child(unsigned int c, Elem *elem)
Definition: elem.h:2478
const RemoteElem * remote_elem
Definition: remote_elem.C:57
void libMesh::DofObject::add_system ( )
inherited

Adds an additional system to the DofObject

Definition at line 195 of file dof_object.C.

References libMesh::DofObject::_idx_buf, libMesh::DofObject::n_systems(), libMesh::DofObject::n_var_groups(), libMesh::DofObject::n_vars(), and libMesh::DofObject::set_n_systems().

Referenced by libMesh::DofObject::set_id().

196 {
197  // quick return?
198  if (this->n_systems() == 0)
199  {
200  this->set_n_systems(1);
201  return;
202  }
203 
204  DofObject::index_buffer_t::iterator it = _idx_buf.begin();
205 
206  std::advance(it, this->n_systems());
207 
208  // this inserts the current vector size at the position for the new system - creating the
209  // entry we need for the new system indicating there are 0 variables.
210  _idx_buf.insert(it, cast_int<dof_id_type>(_idx_buf.size()));
211 
212  // cache this value before we screw it up!
213  const unsigned int ns_orig = this->n_systems();
214 
215  // increment the number of systems and the offsets for each of
216  // the systems including the new one we just added.
217  for (unsigned int i=0; i<ns_orig+1; i++)
218  _idx_buf[i]++;
219 
220  libmesh_assert_equal_to (this->n_systems(), (ns_orig+1));
221  libmesh_assert_equal_to (this->n_vars(ns_orig), 0);
222  libmesh_assert_equal_to (this->n_var_groups(ns_orig), 0);
223 }
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:745
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:735
void set_n_systems(const unsigned int s)
Definition: dof_object.C:165
index_buffer_t _idx_buf
Definition: dof_object.h:485
unsigned int n_systems() const
Definition: dof_object.h:726
bool libMesh::Elem::ancestor ( ) const
inherited
Returns
true if the element is an ancestor (i.e. has an active child or ancestor child), false otherwise or when AMR is disabled.

Definition at line 1463 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::child_ref_range(), libMesh::Elem::has_children(), libMesh::remote_elem, and libMesh::Elem::subactive().

Referenced by libMesh::UnstructuredMesh::contract(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::Elem::get_info(), libMesh::Elem::is_linear(), libMesh::MeshRefinement::make_coarsening_compatible(), and libMesh::Elem::refine().

1464 {
1465 #ifdef LIBMESH_ENABLE_AMR
1466 
1467  // Use a fast, DistributedMesh-safe definition
1468  const bool is_ancestor =
1469  !this->active() && !this->subactive();
1470 
1471  // But check for inconsistencies if we have time
1472 #ifdef DEBUG
1473  if (!is_ancestor && this->has_children())
1474  {
1475  for (auto & c : this->child_ref_range())
1476  {
1477  if (&c != remote_elem)
1478  {
1479  libmesh_assert(!c.active());
1480  libmesh_assert(!c.ancestor());
1481  }
1482  }
1483  }
1484 #endif // DEBUG
1485 
1486  return is_ancestor;
1487 
1488 #else
1489  return false;
1490 #endif
1491 }
bool has_children() const
Definition: elem.h:2296
bool subactive() const
Definition: elem.h:2276
bool active() const
Definition: elem.h:2258
SimpleRange< ChildRefIter > child_ref_range()
Definition: elem.h:1700
const RemoteElem * remote_elem
Definition: remote_elem.C:57
unsigned int libMesh::Elem::as_parent_node ( unsigned int  c,
unsigned int  n 
) const
virtualinherited
Returns
The local node id on the parent which corresponds to node n of child c, or invalid_uint if no such parent node exists.

Definition at line 1969 of file elem.C.

References libMesh::Elem::_get_parent_indices_cache(), libMesh::Elem::child(), libMesh::Elem::embedding_matrix(), libMesh::Elem::embedding_matrix_version(), libMesh::invalid_uint, libMesh::Elem::n_children(), libMesh::Elem::n_nodes(), and libMesh::Elem::n_nodes_in_child().

Referenced by libMesh::MeshRefinement::add_node(), libMesh::MeshCommunication::make_p_levels_parallel_consistent(), libMesh::Elem::origin(), and libMesh::Elem::parent_bracketing_nodes().

1971 {
1972  const unsigned int nc = this->n_children();
1973  libmesh_assert_less(child, nc);
1974 
1975  // Cached return values, indexed first by embedding_matrix version,
1976  // then by child number, then by child node number.
1977  std::vector<std::vector<std::vector<signed char>>> &
1978  cached_parent_indices = this->_get_parent_indices_cache();
1979 
1980  unsigned int em_vers = this->embedding_matrix_version();
1981 
1982  // We may be updating the cache on one thread, and while that
1983  // happens we can't safely access the cache from other threads.
1984  Threads::spin_mutex::scoped_lock lock(parent_indices_mutex);
1985 
1986  if (em_vers >= cached_parent_indices.size())
1987  cached_parent_indices.resize(em_vers+1);
1988 
1989  if (child >= cached_parent_indices[em_vers].size())
1990  {
1991  const unsigned int nn = this->n_nodes();
1992 
1993  cached_parent_indices[em_vers].resize(nc);
1994 
1995  for (unsigned int c = 0; c != nc; ++c)
1996  {
1997  const unsigned int ncn = this->n_nodes_in_child(c);
1998  cached_parent_indices[em_vers][c].resize(ncn);
1999  for (unsigned int cn = 0; cn != ncn; ++cn)
2000  {
2001  for (unsigned int n = 0; n != nn; ++n)
2002  {
2003  const float em_val = this->embedding_matrix
2004  (c, cn, n);
2005  if (em_val == 1)
2006  {
2007  cached_parent_indices[em_vers][c][cn] = n;
2008  break;
2009  }
2010 
2011  if (em_val != 0)
2012  {
2013  cached_parent_indices[em_vers][c][cn] =
2014  -1;
2015  break;
2016  }
2017 
2018  // We should never see an all-zero embedding matrix
2019  // row
2020  libmesh_assert_not_equal_to (n+1, nn);
2021  }
2022  }
2023  }
2024  }
2025 
2026  const signed char cache_val =
2027  cached_parent_indices[em_vers][child][child_node];
2028  if (cache_val == -1)
2029  return libMesh::invalid_uint;
2030 
2031  return cached_parent_indices[em_vers][child][child_node];
2032 }
const unsigned int invalid_uint
Definition: libmesh.h:184
Threads::spin_mutex parent_indices_mutex
Definition: elem.C:81
Elem * child(const unsigned int i) const
Definition: elem.h:2466
virtual unsigned int n_nodes() const =0
virtual unsigned int n_nodes_in_child(unsigned int) const
Definition: elem.h:583
virtual std::vector< std::vector< std::vector< signed char > > > & _get_parent_indices_cache() const
Definition: elem.h:1594
virtual unsigned int n_children() const =0
virtual unsigned int embedding_matrix_version() const
Definition: elem.h:1537
virtual float embedding_matrix(const unsigned int child_num, const unsigned int child_node_num, const unsigned int parent_node_num) const =0
Elem::side_iterator libMesh::Elem::boundary_sides_begin ( )
inherited

Iterator accessor functions

Definition at line 2837 of file elem.C.

References libMesh::Elem::_first_side(), and libMesh::Elem::_last_side().

2838 {
2839  Predicates::BoundarySide<SideIter> bsp;
2840  return side_iterator(this->_first_side(), this->_last_side(), bsp);
2841 }
SideIter _last_side()
Definition: elem.h:2831
SideIter _first_side()
Definition: elem.h:2823
Elem::side_iterator libMesh::Elem::boundary_sides_end ( )
inherited

Definition at line 2846 of file elem.C.

References libMesh::Elem::_last_side().

2847 {
2848  Predicates::BoundarySide<SideIter> bsp;
2849  return side_iterator(this->_last_side(), this->_last_side(), bsp);
2850 }
SideIter _last_side()
Definition: elem.h:2831
const std::vector< std::pair< dof_id_type, dof_id_type > > libMesh::Elem::bracketing_nodes ( unsigned int  c,
unsigned int  n 
) const
virtualinherited
Returns
All the pairs of nodes (indexed by global node id) which should bracket node n of child c.

Definition at line 2242 of file elem.C.

References libMesh::Elem::build(), libMesh::Elem::child(), libMesh::Elem::child_ptr(), libMesh::Elem::default_order(), libMesh::FIRST, libMesh::HEX20, libMesh::DofObject::invalid_id, libMesh::Elem::n_nodes(), libMesh::Elem::n_nodes_in_child(), libMesh::Elem::node_id(), libMesh::Elem::parent_bracketing_nodes(), libMesh::Elem::second_order_equivalent_type(), and libMesh::Elem::type().

Referenced by libMesh::MeshRefinement::add_node(), libMesh::TopologyMap::fill(), and libMesh::Elem::origin().

2244 {
2245  std::vector<std::pair<dof_id_type, dof_id_type>> returnval;
2246 
2247  const std::vector<std::pair<unsigned char, unsigned char>> & pbc =
2248  this->parent_bracketing_nodes(child,child_node);
2249 
2250  for (std::size_t i = 0; i != pbc.size(); ++i)
2251  {
2252  const unsigned short n_n = this->n_nodes();
2253  if (pbc[i].first < n_n && pbc[i].second < n_n)
2254  returnval.push_back(std::make_pair(this->node_id(pbc[i].first),
2255  this->node_id(pbc[i].second)));
2256  else
2257  {
2258  // We must be on a non-full-order higher order element...
2259  libmesh_assert_not_equal_to(this->default_order(), FIRST);
2260  libmesh_assert_not_equal_to
2261  (second_order_equivalent_type (this->type(), true),
2262  this->type());
2263  libmesh_assert_equal_to
2264  (second_order_equivalent_type (this->type(), false),
2265  this->type());
2266 
2267  // And that's a shame, because this is a nasty search:
2268 
2269  // Build the full-order type
2270  ElemType full_type =
2271  second_order_equivalent_type(this->type(), /*full_ordered=*/ true);
2272  std::unique_ptr<Elem> full_elem = Elem::build(full_type);
2273 
2276 
2277  // Find the bracketing nodes by figuring out what
2278  // already-created children will have them.
2279 
2280  // This only doesn't break horribly because we add children
2281  // and nodes in straightforward + hierarchical orders...
2282  for (unsigned int c=0; c <= child; ++c)
2283  for (unsigned int n=0; n != this->n_nodes_in_child(c); ++n)
2284  {
2285  if (c == child && n == child_node)
2286  break;
2287 
2288  if (pbc[i].first == full_elem->as_parent_node(c,n))
2289  {
2290  // We should be consistent
2291  if (pt1 != DofObject::invalid_id)
2292  libmesh_assert_equal_to(pt1, this->child_ptr(c)->node_id(n));
2293 
2294  pt1 = this->child_ptr(c)->node_id(n);
2295  }
2296 
2297  if (pbc[i].second == full_elem->as_parent_node(c,n))
2298  {
2299  // We should be consistent
2300  if (pt2 != DofObject::invalid_id)
2301  libmesh_assert_equal_to(pt2, this->child_ptr(c)->node_id(n));
2302 
2303  pt2 = this->child_ptr(c)->node_id(n);
2304  }
2305  }
2306 
2307  // We should *usually* find all bracketing nodes by the time
2308  // we query them (again, because of the child & node add
2309  // order)
2310  //
2311  // The exception is if we're a HEX20, in which case we will
2312  // find pairs of vertex nodes and edge nodes bracketing the
2313  // new central node but we *won't* find the pairs of face
2314  // nodes which we would have had on a HEX27. In that case
2315  // we'll still have enough bracketing nodes for a
2316  // topological lookup, but we won't be able to make the
2317  // following assertions.
2318  if (this->type() != HEX20)
2319  {
2320  libmesh_assert_not_equal_to (pt1, DofObject::invalid_id);
2321  libmesh_assert_not_equal_to (pt2, DofObject::invalid_id);
2322  }
2323 
2324  if (pt1 != DofObject::invalid_id &&
2325  pt2 != DofObject::invalid_id)
2326  returnval.push_back(std::make_pair(pt1, pt2));
2327  }
2328  }
2329 
2330  return returnval;
2331 }
virtual ElemType type() const =0
Elem * child(const unsigned int i) const
Definition: elem.h:2466
virtual unsigned int n_nodes() const =0
virtual unsigned int n_nodes_in_child(unsigned int) const
Definition: elem.h:583
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2446
static const dof_id_type invalid_id
Definition: dof_object.h:324
virtual Order default_order() const =0
static ElemType second_order_equivalent_type(const ElemType et, const bool full_ordered=true)
Definition: elem.C:2672
virtual const std::vector< std::pair< unsigned char, unsigned char > > & parent_bracketing_nodes(unsigned int c, unsigned int n) const
Definition: elem.C:2037
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:1832
static std::unique_ptr< Elem > build(const ElemType type, Elem *p=libmesh_nullptr)
Definition: elem.C:239
uint8_t dof_id_type
Definition: id_types.h:64
std::unique_ptr< Elem > libMesh::Elem::build ( const ElemType  type,
Elem p = libmesh_nullptr 
)
staticinherited
Returns
An Elem of type type wrapped in a smart pointer.

Definition at line 239 of file elem.C.

References libMesh::EDGE2, libMesh::EDGE3, libMesh::EDGE4, libMesh::HEX20, libMesh::HEX27, libMesh::HEX8, libMesh::INFEDGE2, libMesh::INFHEX16, libMesh::INFHEX18, libMesh::INFHEX8, libMesh::INFPRISM12, libMesh::INFPRISM6, libMesh::INFQUAD4, libMesh::INFQUAD6, libMesh::NODEELEM, libMesh::PRISM15, libMesh::PRISM18, libMesh::PRISM6, libMesh::PYRAMID13, libMesh::PYRAMID14, libMesh::PYRAMID5, libMesh::QUAD4, libMesh::QUAD8, libMesh::QUAD9, libMesh::QUADSHELL4, libMesh::QUADSHELL8, libMesh::TET10, libMesh::TET4, libMesh::TRI3, libMesh::TRI3SUBDIVISION, libMesh::TRI6, and libMesh::TRISHELL3.

Referenced by libMesh::GMVIO::_read_one_cell(), libMesh::UnstructuredMesh::all_first_order(), libMesh::UnstructuredMesh::all_second_order(), libMesh::Elem::bracketing_nodes(), libMesh::Nemesis_IO_Helper::build_element_and_node_maps(), libMesh::MeshTools::Generation::build_sphere(), libMesh::UnstructuredMesh::copy_nodes_and_elements(), libMesh::UnstructuredMesh::create_submesh(), libMesh::MeshTools::Modification::flatten(), libMesh::Elem::origin(), libMesh::Elem::parent_bracketing_nodes(), libMesh::Nemesis_IO::read(), libMesh::ExodusII_IO::read(), libMesh::VTKIO::read(), libMesh::CheckpointIO::read_connectivity(), libMesh::AbaqusIO::read_elements(), libMesh::UCDIO::read_implementation(), libMesh::GmshIO::read_mesh(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::Elem::refine(), libMesh::Parallel::Packing< Elem * >::unpack(), and libMesh::GMVIO::write_ascii_old_impl().

241 {
242  switch (type)
243  {
244  // 0D elements
245  case NODEELEM:
246  return libmesh_make_unique<NodeElem>(p);
247 
248  // 1D elements
249  case EDGE2:
250  return libmesh_make_unique<Edge2>(p);
251  case EDGE3:
252  return libmesh_make_unique<Edge3>(p);
253  case EDGE4:
254  return libmesh_make_unique<Edge4>(p);
255 
256  // 2D elements
257  case TRI3:
258  return libmesh_make_unique<Tri3>(p);
259  case TRISHELL3:
260  return libmesh_make_unique<TriShell3>(p);
261  case TRI3SUBDIVISION:
262  return libmesh_make_unique<Tri3Subdivision>(p);
263  case TRI6:
264  return libmesh_make_unique<Tri6>(p);
265  case QUAD4:
266  return libmesh_make_unique<Quad4>(p);
267  case QUADSHELL4:
268  return libmesh_make_unique<QuadShell4>(p);
269  case QUAD8:
270  return libmesh_make_unique<Quad8>(p);
271  case QUADSHELL8:
272  return libmesh_make_unique<QuadShell8>(p);
273  case QUAD9:
274  return libmesh_make_unique<Quad9>(p);
275 
276  // 3D elements
277  case TET4:
278  return libmesh_make_unique<Tet4>(p);
279  case TET10:
280  return libmesh_make_unique<Tet10>(p);
281  case HEX8:
282  return libmesh_make_unique<Hex8>(p);
283  case HEX20:
284  return libmesh_make_unique<Hex20>(p);
285  case HEX27:
286  return libmesh_make_unique<Hex27>(p);
287  case PRISM6:
288  return libmesh_make_unique<Prism6>(p);
289  case PRISM15:
290  return libmesh_make_unique<Prism15>(p);
291  case PRISM18:
292  return libmesh_make_unique<Prism18>(p);
293  case PYRAMID5:
294  return libmesh_make_unique<Pyramid5>(p);
295  case PYRAMID13:
296  return libmesh_make_unique<Pyramid13>(p);
297  case PYRAMID14:
298  return libmesh_make_unique<Pyramid14>(p);
299 
300 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
301  // 1D infinite elements
302  case INFEDGE2:
303  return libmesh_make_unique<InfEdge2>(p);
304 
305  // 2D infinite elements
306  case INFQUAD4:
307  return libmesh_make_unique<InfQuad4>(p);
308  case INFQUAD6:
309  return libmesh_make_unique<InfQuad6>(p);
310 
311  // 3D infinite elements
312  case INFHEX8:
313  return libmesh_make_unique<InfHex8>(p);
314  case INFHEX16:
315  return libmesh_make_unique<InfHex16>(p);
316  case INFHEX18:
317  return libmesh_make_unique<InfHex18>(p);
318  case INFPRISM6:
319  return libmesh_make_unique<InfPrism6>(p);
320  case INFPRISM12:
321  return libmesh_make_unique<InfPrism12>(p);
322 #endif
323 
324  default:
325  libmesh_error_msg("ERROR: Undefined element type!");
326  }
327 }
virtual ElemType type() const =0
std::unique_ptr< Elem > libMesh::Elem::build_edge ( const unsigned int  i) const
inlineinherited

Creates an element coincident with edge i.

Deprecated:
This method will eventually be removed since it hands back a non-const pointer to an edge that could be used to indirectly modify this Elem. Please use the the const-correct build_edge_ptr() function instead.

Definition at line 2160 of file elem.h.

References libMesh::Elem::build_edge_ptr().

Referenced by libMesh::Elem::is_vertex_on_child().

2161 {
2162  // Call the const version of build_edge_ptr(), and const_cast the result.
2163  libmesh_deprecated();
2164  Elem * e = const_cast<Elem *>(this->build_edge_ptr(i).release());
2165  return std::unique_ptr<Elem>(e);
2166 }
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1732
virtual std::unique_ptr< Elem > build_edge_ptr(const unsigned int i)=0
virtual std::unique_ptr<Elem> libMesh::InfQuad::build_edge_ptr ( const unsigned int  i)
inlinevirtual

build_edge_ptr() and build_side_ptr() are identical in 2D.

Implements libMesh::Elem.

Definition at line 158 of file face_inf_quad.h.

References libMesh::Elem::build_side_ptr().

159  { return build_side_ptr(i); }
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int i, bool proxy=true)=0
std::unique_ptr< const Elem > libMesh::Elem::build_edge_ptr ( const unsigned int  i) const
inlineinherited

Definition at line 2146 of file elem.h.

References libMesh::Elem::build_edge_ptr().

2147 {
2148  // Call the non-const version of this function, return the result as
2149  // a std::unique_ptr<const Elem>.
2150  Elem * me = const_cast<Elem *>(this);
2151  const Elem * e = const_cast<const Elem *>(me->build_edge_ptr(i).release());
2152  return std::unique_ptr<const Elem>(e);
2153 }
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1732
std::unique_ptr< Elem > libMesh::Elem::build_side ( const unsigned int  i,
bool  proxy = true 
) const
inlineinherited
Returns
A proxy element coincident with side i.
Deprecated:
This method will eventually be removed since it hands back a non-const pointer to a side that could be used to indirectly modify this. Please use the the const-correct build_side_ptr() function instead.

Definition at line 2133 of file elem.h.

References libMesh::Elem::build_side_ptr().

Referenced by libMesh::Elem::is_vertex_on_child().

2134 {
2135  // Call the const version of build_side_ptr(), and const_cast the result.
2136  libmesh_deprecated();
2137  Elem * s = const_cast<Elem *>(this->build_side_ptr(i, proxy).release());
2138  return std::unique_ptr<Elem>(s);
2139 }
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int i, bool proxy=true)=0
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1732
virtual std::unique_ptr<Elem> libMesh::Elem::build_side_ptr ( const unsigned int  i,
bool  proxy = true 
)
pure virtualinherited
Returns
An element coincident with side i wrapped in a smart pointer.

The element returned is full-ordered, in contrast to the side method. For example, calling build_side_ptr(0) on a 20-noded hex will build a 8-noded quadrilateral coincident with face 0 and pass back the pointer. A std::unique_ptr<Elem> is returned to prevent a memory leak. This way the user need not remember to delete the object.

The second argument, which is true by default, specifies that a "proxy" element (of type Side) will be returned. This type of value is useful because it does not allocate additional memory, and is usually sufficient for FE calculation purposes. If you really need a full-ordered, non-proxy side object, call this function with proxy=false.

The const version of this function is non-virtual; it simply calls the virtual non-const version and const_casts the return type.

Implemented in libMesh::Pyramid14, libMesh::Prism18, libMesh::Hex27, libMesh::RemoteElem, libMesh::Quad9, libMesh::Prism15, libMesh::Pyramid13, libMesh::Edge, libMesh::Hex20, libMesh::InfHex16, libMesh::Tet10, libMesh::InfQuad6, libMesh::Quad8, libMesh::Tri6, libMesh::InfHex18, libMesh::Tet4, libMesh::InfPrism12, libMesh::NodeElem, libMesh::InfPrism6, libMesh::Hex8, libMesh::InfHex8, libMesh::Tri3, libMesh::InfQuad4, libMesh::Prism6, libMesh::Pyramid5, and libMesh::Quad4.

Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::BoundaryInfo::add_elements(), libMesh::MeshTools::Modification::all_tri(), libMesh::Face::build_edge_ptr(), build_edge_ptr(), libMesh::InfFE< Dim, T_radial, T_map >::Base::build_elem(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::BoundaryInfo::build_node_list_from_side_list(), libMesh::Elem::build_side(), libMesh::Elem::build_side_ptr(), libMesh::InfFE< Dim, T_radial, T_map >::compute_data(), libMesh::FEAbstract::compute_node_constraints(), libMesh::FEAbstract::compute_periodic_node_constraints(), libMesh::MeshCommunication::gather_neighboring_elements(), libMesh::BoundaryInfo::get_side_and_node_maps(), libMesh::Elem::is_vertex_on_child(), libMesh::Cell::loose_bounding_box(), libMesh::PeriodicBoundaries::neighbor(), libMesh::PostscriptIO::plot_quadratic_elem(), libMesh::FE< Dim, T >::reinit(), libMesh::InfFE< Dim, T_radial, T_map >::reinit(), libMesh::FEXYZ< Dim >::reinit(), libMesh::InfFE< Dim, T_radial, T_map >::shape(), libMesh::MeshTools::Modification::smooth(), libMesh::ReplicatedMesh::stitching_helper(), libMesh::FroIO::write(), and libMesh::GmshIO::write_mesh().

std::unique_ptr< const Elem > libMesh::Elem::build_side_ptr ( const unsigned int  i,
bool  proxy = true 
) const
inlineinherited

Definition at line 2119 of file elem.h.

References libMesh::Elem::build_side_ptr().

2120 {
2121  // Call the non-const version of this function, return the result as
2122  // a std::unique_ptr<const Elem>.
2123  Elem * me = const_cast<Elem *>(this);
2124  const Elem * s = const_cast<const Elem *>(me->build_side_ptr(i, proxy).release());
2125  return std::unique_ptr<const Elem>(s);
2126 }
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1732
Point libMesh::Elem::centroid ( ) const
virtualinherited
Returns
The centroid of the element. The centroid is computed as the average of all the element vertices.

This method is virtual since some derived elements might want to use shortcuts to compute their centroid.

Definition at line 338 of file elem.C.

References libMesh::TypeVector< T >::add(), and libMesh::Elem::n_vertices().

Referenced by libMesh::CentroidPartitioner::compute_centroids(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::Elem::is_vertex_on_child(), libMesh::SFCPartitioner::partition_range(), libMesh::LocationMap< T >::point_of(), libMesh::FE< Dim, T >::shape(), libMesh::FE< Dim, T >::shape_deriv(), and libMesh::FE< Dim, T >::shape_second_deriv().

339 {
340  Point cp;
341 
342  for (unsigned int n=0; n<this->n_vertices(); n++)
343  cp.add (this->point(n));
344 
345  return (cp /= static_cast<Real>(this->n_vertices()));
346 }
virtual unsigned int n_vertices() const =0
Elem * libMesh::Elem::child ( const unsigned int  i) const
inlineinherited
Returns
A non-constant pointer to the $ i^{th} $ child for this element.
Deprecated:
Use the more accurately-named and const correct child_ptr() function instead.

Definition at line 2466 of file elem.h.

References libMesh::Elem::child_ptr().

Referenced by libMesh::Elem::as_parent_node(), libMesh::Elem::bracketing_nodes(), libMesh::Elem::find_interior_neighbors(), libMesh::Elem::make_links_to_me_remote(), and libMesh::Elem::parent_bracketing_nodes().

2467 {
2468  // Support the deprecated interface by calling the new,
2469  // const-correct interface and casting the result to an Elem *.
2470  libmesh_deprecated();
2471  return const_cast<Elem *>(this->child_ptr(i));
2472 }
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2446
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1732
Elem * libMesh::Elem::child_neighbor ( Elem elem)
inlineinherited
Returns
If elem is a neighbor of a child of this element, a pointer to that child, otherwise NULL.

Definition at line 2023 of file elem.h.

References libmesh_nullptr, and libMesh::Elem::neighbor_ptr_range().

2024 {
2025  for (auto n : elem->neighbor_ptr_range())
2026  if (n && n->parent() == this)
2027  return n;
2028 
2029  return libmesh_nullptr;
2030 }
const class libmesh_nullptr_t libmesh_nullptr
const Elem * libMesh::Elem::child_neighbor ( const Elem elem) const
inlineinherited
Returns
If elem is a neighbor of a child of this element, a pointer to that child, otherwise NULL.

Definition at line 2035 of file elem.h.

References libmesh_nullptr, and libMesh::Elem::neighbor_ptr_range().

2036 {
2037  for (auto n : elem->neighbor_ptr_range())
2038  if (n && n->parent() == this)
2039  return n;
2040 
2041  return libmesh_nullptr;
2042 }
const class libmesh_nullptr_t libmesh_nullptr
Elem * libMesh::Elem::child_ptr ( unsigned int  i)
inlineinherited
Returns
A non-constant pointer to the $ i^{th} $ child for this element. Do not call if this element has no children, i.e. is active.

Definition at line 2455 of file elem.h.

References libMesh::Elem::_children.

2456 {
2457  libmesh_assert(_children);
2458  libmesh_assert(_children[i]);
2459 
2460  return _children[i];
2461 }
Elem ** _children
Definition: elem.h:1628
SimpleRange< Elem::ChildRefIter > libMesh::Elem::child_ref_range ( )
inlineinherited

Returns a range with all children of a parent element, usable in range-based for loops. The exact type of the return value here may be subject to change in future libMesh releases, but the iterators will always dereference to produce a reference to a child element.

Definition at line 1700 of file elem.h.

References libMesh::Elem::_children, and libMesh::Elem::n_children().

Referenced by libMesh::Elem::active_family_tree(), libMesh::Elem::active_family_tree_by_neighbor(), libMesh::Elem::active_family_tree_by_topological_neighbor(), libMesh::HPCoarsenTest::add_projection(), libMesh::Elem::ancestor(), libMesh::OldSolutionBase< Output, point_output >::check_old_context(), libMesh::Elem::coarsen(), libMesh::FEGenericBase< OutputType >::coarsened_dof_values(), libMesh::connect_children(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::ExactErrorEstimator::estimate_error(), libMesh::Elem::family_tree(), libMesh::Elem::family_tree_by_neighbor(), libMesh::Elem::family_tree_by_subneighbor(), libMesh::Elem::find_interior_neighbors(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshRefinement::flag_elements_by_nelem_target(), libMesh::Elem::has_ancestor_children(), libMesh::MeshTools::libmesh_assert_topology_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_valid_remote_elems(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::Elem::make_links_to_me_remote(), libMesh::MeshRefinement::make_refinement_compatible(), libMesh::Elem::max_descendant_p_level(), libMesh::Elem::min_new_p_level_by_neighbor(), libMesh::Elem::min_p_level_by_neighbor(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::operator()(), libMesh::BuildProjectionList::operator()(), libMesh::Elem::set_p_level(), libMesh::Partitioner::set_parent_processor_ids(), libMesh::Elem::total_family_tree(), libMesh::Elem::total_family_tree_by_neighbor(), libMesh::Elem::total_family_tree_by_subneighbor(), and libMesh::XdrIO::write_serialized_connectivity().

1701 {
1702  libmesh_assert(_children);
1703  return {_children, _children + this->n_children()};
1704 }
Elem ** _children
Definition: elem.h:1628
virtual unsigned int n_children() const =0
SimpleRange< Elem::ConstChildRefIter > libMesh::Elem::child_ref_range ( ) const
inlineinherited

Definition at line 1708 of file elem.h.

References libMesh::Elem::_children, and libMesh::Elem::n_children().

1709 {
1710  libmesh_assert(_children);
1711  return {_children, _children + this->n_children()};
1712 }
Elem ** _children
Definition: elem.h:1628
virtual unsigned int n_children() const =0
void libMesh::DofObject::clear_dofs ( )
inlineinherited

Clear the DofMap data structures and return to a pristine state.

Definition at line 598 of file dof_object.h.

References libMesh::DofObject::_idx_buf, and libMesh::DofObject::n_systems().

Referenced by libMesh::DofObject::set_n_systems(), and libMesh::DofObject::~DofObject().

599 {
600  // vector swap trick to force deallocation
601  index_buffer_t().swap(_idx_buf);
602 
603  libmesh_assert_equal_to (this->n_systems(), 0);
604  libmesh_assert (_idx_buf.empty());
605 }
std::vector< index_t > index_buffer_t
Definition: dof_object.h:484
index_buffer_t _idx_buf
Definition: dof_object.h:485
unsigned int n_systems() const
Definition: dof_object.h:726
void libMesh::DofObject::clear_old_dof_object ( )
inherited

Sets the old_dof_object to libmesh_nullptr

Definition at line 142 of file dof_object.C.

References libmesh_nullptr, and libMesh::DofObject::old_dof_object.

Referenced by libMesh::DofObject::operator=(), libMesh::DofObject::set_old_dof_object(), libMesh::DofObject::unpack_indexing(), and libMesh::DofObject::~DofObject().

143 {
144  delete this->old_dof_object;
146 }
const class libmesh_nullptr_t libmesh_nullptr
DofObject * old_dof_object
Definition: dof_object.h:79
bool libMesh::Elem::close_to_point ( const Point p,
Real  tol 
) const
virtualinherited
Returns
true if this element is "close" to the point p, where "close" is determined by the tolerance tol.

Definition at line 2362 of file elem.C.

References libMesh::Elem::point_test().

Referenced by libMesh::Elem::qual_bounds().

2363 {
2364  // This test uses the user's passed-in tolerance for the
2365  // bounding box test as well, thereby allowing the routine to
2366  // find points which are not only "in" the element, but also
2367  // "nearby" to within some tolerance.
2368  return this->point_test(p, tol, tol);
2369 }
bool point_test(const Point &p, Real box_tol, Real map_tol) const
Definition: elem.C:2374
void libMesh::Elem::coarsen ( )
inherited

Coarsen the element. This function is non-virtual since it is the same for all element types.

Definition at line 106 of file elem_refinement.C.

References libMesh::Elem::active(), libMesh::TypeVector< T >::add_scaled(), libMesh::Elem::child_ptr(), libMesh::Elem::child_ref_range(), libMesh::Elem::COARSEN, libMesh::Elem::COARSEN_INACTIVE, libMesh::Elem::embedding_matrix(), libMesh::Elem::INACTIVE, libMesh::Elem::JUST_COARSENED, libMesh::Elem::n_children(), libMesh::Elem::n_nodes(), libMesh::Elem::point(), libMesh::Elem::refinement_flag(), libMesh::remote_elem, libMesh::Elem::set_p_level(), and libMesh::Elem::set_refinement_flag().

Referenced by libMesh::MeshRefinement::_coarsen_elements().

107 {
108  libmesh_assert_equal_to (this->refinement_flag(), Elem::COARSEN_INACTIVE);
109  libmesh_assert (!this->active());
110 
111  // We no longer delete children until MeshRefinement::contract()
112  // delete [] _children;
113  // _children = libmesh_nullptr;
114 
115  unsigned int parent_p_level = 0;
116 
117  // re-compute hanging node nodal locations
118  for (unsigned int c = 0, nc = this->n_children(); c != nc; ++c)
119  {
120  Elem * mychild = this->child_ptr(c);
121  if (mychild == remote_elem)
122  continue;
123  for (unsigned int nc=0; nc != mychild->n_nodes(); nc++)
124  {
125  Point new_pos;
126  bool calculated_new_pos = false;
127 
128  for (unsigned int n=0; n<this->n_nodes(); n++)
129  {
130  // The value from the embedding matrix
131  const float em_val = this->embedding_matrix(c,nc,n);
132 
133  // The node location is somewhere between existing vertices
134  if ((em_val != 0.) && (em_val != 1.))
135  {
136  new_pos.add_scaled (this->point(n), em_val);
137  calculated_new_pos = true;
138  }
139  }
140 
141  if (calculated_new_pos)
142  {
143  //Move the existing node back into it's original location
144  for (unsigned int i=0; i<LIBMESH_DIM; i++)
145  {
146  Point & child_node = mychild->point(nc);
147  child_node(i)=new_pos(i);
148  }
149  }
150  }
151  }
152 
153  for (auto & mychild : this->child_ref_range())
154  {
155  if (&mychild == remote_elem)
156  continue;
157  libmesh_assert_equal_to (mychild.refinement_flag(), Elem::COARSEN);
158  mychild.set_refinement_flag(Elem::INACTIVE);
159  if (mychild.p_level() > parent_p_level)
160  parent_p_level = mychild.p_level();
161  }
162 
164  this->set_p_level(parent_p_level);
165 
166  libmesh_assert (this->active());
167 }
void set_p_level(const unsigned int p)
Definition: elem.h:2560
bool active() const
Definition: elem.h:2258
void set_refinement_flag(const RefinementState rflag)
Definition: elem.h:2514
SimpleRange< ChildRefIter > child_ref_range()
Definition: elem.h:1700
virtual unsigned int n_nodes() const =0
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2446
virtual unsigned int n_children() const =0
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1732
const Point & point(const unsigned int i) const
Definition: elem.h:1810
RefinementState refinement_flag() const
Definition: elem.h:2506
virtual float embedding_matrix(const unsigned int child_num, const unsigned int child_node_num, const unsigned int parent_node_num) const =0
const RemoteElem * remote_elem
Definition: remote_elem.C:57
dof_id_type libMesh::Elem::compute_key ( dof_id_type  n0,
dof_id_type  n1 
)
inlinestaticprotectedinherited
Returns
A hash key computed from two node ids.

Definition at line 2630 of file elem.h.

References libMesh::Utility::hashword2(), and swap().

2632 {
2633  // Order the two so that n0 < n1
2634  if (n0 > n1) std::swap (n0, n1);
2635 
2636  return Utility::hashword2(n0, n1);
2637 }
void swap(Iterator &lhs, Iterator &rhs)
uint32_t hashword2(const uint32_t &first, const uint32_t &second, uint32_t initval=0)
Definition: hashword.h:210
dof_id_type libMesh::Elem::compute_key ( dof_id_type  n0,
dof_id_type  n1,
dof_id_type  n2 
)
inlinestaticprotectedinherited
Returns
A hash key computed from three node ids.

Definition at line 2642 of file elem.h.

References libMesh::Utility::hashword(), and swap().

2645 {
2646  // Order the numbers such that n0 < n1 < n2.
2647  // We'll do it in 3 steps like this:
2648  //
2649  // n0 n1 n2
2650  // min(n0,n1) max(n0,n1) n2
2651  // min(n0,n1) min(n2,max(n0,n1) max(n2,max(n0,n1)
2652  // |\ /| |
2653  // | \ / | |
2654  // | / | |
2655  // | / \| |
2656  // gb min= min max gb max
2657 
2658  // Step 1
2659  if (n0 > n1) std::swap (n0, n1);
2660 
2661  // Step 2
2662  if (n1 > n2) std::swap (n1, n2);
2663 
2664  // Step 3
2665  if (n0 > n1) std::swap (n0, n1);
2666 
2667  libmesh_assert ((n0 < n1) && (n1 < n2));
2668 
2669  dof_id_type array[3] = {n0, n1, n2};
2670  return Utility::hashword(array, 3);
2671 }
uint32_t hashword(const uint32_t *k, size_t length, uint32_t initval=0)
Definition: hashword.h:153
void swap(Iterator &lhs, Iterator &rhs)
uint8_t dof_id_type
Definition: id_types.h:64
dof_id_type libMesh::Elem::compute_key ( dof_id_type  n0,
dof_id_type  n1,
dof_id_type  n2,
dof_id_type  n3 
)
inlinestaticprotectedinherited
Returns
A hash key computed from four node ids.

Definition at line 2676 of file elem.h.

References libMesh::Utility::hashword(), and swap().

2680 {
2681  // Sort first
2682  // Step 1
2683  if (n0 > n1) std::swap (n0, n1);
2684 
2685  // Step 2
2686  if (n2 > n3) std::swap (n2, n3);
2687 
2688  // Step 3
2689  if (n0 > n2) std::swap (n0, n2);
2690 
2691  // Step 4
2692  if (n1 > n3) std::swap (n1, n3);
2693 
2694  // Finally sort step 5
2695  if (n1 > n2) std::swap (n1, n2);
2696 
2697  libmesh_assert ((n0 < n1) && (n1 < n2) && (n2 < n3));
2698 
2699  dof_id_type array[4] = {n0, n1, n2, n3};
2700  return Utility::hashword(array, 4);
2701 }
uint32_t hashword(const uint32_t *k, size_t length, uint32_t initval=0)
Definition: hashword.h:153
void swap(Iterator &lhs, Iterator &rhs)
uint8_t dof_id_type
Definition: id_types.h:64
bool libMesh::Elem::contains_edge_of ( const Elem e) const
inherited
Returns
true if an edge of e is contained in this element. (Internally, this is done by checking whether at least two vertices of e are contained in this element).

Definition at line 476 of file elem.C.

References libMesh::Elem::contains_point(), libMesh::Elem::n_vertices(), and libMesh::Elem::point().

Referenced by libMesh::Elem::find_edge_neighbors().

477 {
478  unsigned int num_contained_edges = 0;
479 
480  // Our vertices are the first numbered nodes
481  for (unsigned int n = 0; n != e->n_vertices(); ++n)
482  {
483  if (this->contains_point(e->point(n)))
484  {
485  num_contained_edges++;
486  if (num_contained_edges>=2)
487  {
488  return true;
489  }
490  }
491  }
492  return false;
493 }
virtual bool contains_point(const Point &p, Real tol=TOLERANCE) const
Definition: elem.C:2337
bool libMesh::Elem::contains_point ( const Point p,
Real  tol = TOLERANCE 
) const
virtualinherited
Returns
true if the point p is contained in this element, false otherwise.

For linear elements, performs an initial tight bounding box check (as an optimization step) and (if that passes) then uses the user-defined tolerance "tol" in a call to inverse_map() to actually test if the point is in the element. For quadratic elements, the bounding box optimization is skipped, and only the inverse_map() steps are performed.

Note
This routine should not be used to determine if a point is merely "nearby" an element to within some tolerance. For that, use Elem::close_to_point() instead.

Reimplemented in libMesh::Tet4, libMesh::InfHex, libMesh::Tri3, libMesh::InfPrism, and libMesh::InfQuad4.

Definition at line 2337 of file elem.C.

References libMesh::err, libMesh::Elem::point_test(), and libMesh::TOLERANCE.

Referenced by libMesh::Elem::contains_edge_of(), libMesh::Elem::contains_vertex_of(), libMesh::Elem::find_edge_neighbors(), libMesh::Elem::find_interior_neighbors(), libMesh::Elem::find_point_neighbors(), libMesh::PointLocatorTree::operator()(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), and libMesh::Elem::qual_bounds().

2338 {
2339  // We currently allow the user to enlarge the bounding box by
2340  // providing a tol > TOLERANCE (so this routine is identical to
2341  // Elem::close_to_point()), but print a warning so that the
2342  // user can eventually switch his code over to calling close_to_point()
2343  // instead, which is intended to be used for this purpose.
2344  if (tol > TOLERANCE)
2345  {
2346  libmesh_do_once(libMesh::err
2347  << "WARNING: Resizing bounding box to match user-specified tolerance!\n"
2348  << "In the future, calls to Elem::contains_point() with tol > TOLERANCE\n"
2349  << "will be more optimized, but should not be used\n"
2350  << "to search for points 'close to' elements!\n"
2351  << "Instead, use Elem::close_to_point() for this purpose.\n"
2352  << std::endl;);
2353  return this->point_test(p, tol, tol);
2354  }
2355  else
2356  return this->point_test(p, TOLERANCE, tol);
2357 }
static const Real TOLERANCE
bool point_test(const Point &p, Real box_tol, Real map_tol) const
Definition: elem.C:2374
OStreamProxy err(std::cerr)
bool libMesh::Elem::contains_vertex_of ( const Elem e) const
inherited
Returns
true if a vertex of e is contained in this element.

Definition at line 465 of file elem.C.

References libMesh::Elem::contains_point(), libMesh::Elem::n_vertices(), and libMesh::Elem::point().

Referenced by libMesh::Elem::find_interior_neighbors(), and libMesh::Elem::find_point_neighbors().

466 {
467  // Our vertices are the first numbered nodes
468  for (unsigned int n = 0; n != e->n_vertices(); ++n)
469  if (this->contains_point(e->point(n)))
470  return true;
471  return false;
472 }
virtual bool contains_point(const Point &p, Real tol=TOLERANCE) const
Definition: elem.C:2337
void libMesh::Elem::contract ( )
inherited

Contract an active element, i.e. remove pointers to any subactive children. This should only be called via MeshRefinement::contract, which will also remove subactive children from the mesh.

Definition at line 171 of file elem_refinement.C.

References libMesh::Elem::_children, libMesh::Elem::active(), libMesh::Elem::DO_NOTHING, libMesh::Elem::JUST_COARSENED, libmesh_nullptr, libMesh::Elem::refinement_flag(), and libMesh::Elem::set_refinement_flag().

Referenced by libMesh::UnstructuredMesh::contract().

172 {
173  // Subactive elements get deleted entirely, not contracted
174  libmesh_assert (this->active());
175 
176  // Active contracted elements no longer can have children
177  delete [] _children;
179 
180  if (this->refinement_flag() == Elem::JUST_COARSENED)
182 }
bool active() const
Definition: elem.h:2258
const class libmesh_nullptr_t libmesh_nullptr
void set_refinement_flag(const RefinementState rflag)
Definition: elem.h:2514
Elem ** _children
Definition: elem.h:1628
RefinementState refinement_flag() const
Definition: elem.h:2506
void libMesh::DofObject::debug_buffer ( ) const
inherited

Print our buffer for debugging.

Definition at line 550 of file dof_object.C.

References libMesh::DofObject::_idx_buf, and libMesh::out.

551 {
552  libMesh::out << " [ ";
553  for (std::size_t i=0; i<_idx_buf.size(); i++)
554  libMesh::out << _idx_buf[i] << " ";
555  libMesh::out << "]\n";
556 }
index_buffer_t _idx_buf
Definition: dof_object.h:485
OStreamProxy out(std::cout)
virtual Order libMesh::Elem::default_order ( ) const
pure virtualinherited
virtual unsigned int libMesh::InfQuad::dim ( ) const
inlinevirtual
Returns
2, the dimensionality of the object.

Implements libMesh::Elem.

Definition at line 89 of file face_inf_quad.h.

Referenced by libMesh::InfQuad4::contains_point().

89 { return 2; }
void libMesh::ReferenceCounter::disable_print_counter_info ( )
staticinherited
void libMesh::ReferenceCounter::disable_print_counter_info ( )
staticinherited
dof_id_type libMesh::DofObject::dof_number ( const unsigned int  s,
const unsigned int  var,
const unsigned int  comp 
) const
inlineinherited
Returns
The global degree of freedom number for variable var, component comp for system s associated with this DofObject

When partitioning and DoF numbering have been performed by libMesh, every current DoF on this DofObject will belong to its processor.

Definition at line 810 of file dof_object.h.

References libMesh::DofObject::_idx_buf, libMesh::DofObject::invalid_id, libMesh::DofObject::n_comp(), libMesh::DofObject::n_comp_group(), libMesh::DofObject::n_systems(), libMesh::DofObject::n_vars(), libMesh::DofObject::start_idx(), libMesh::DofObject::system_var_to_vg_var(), and libMesh::DofObject::var_to_vg().

Referenced by libMesh::DofMap::_dof_indices(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::FEGenericBase< OutputType >::compute_periodic_constraints(), libMesh::DofMap::constrain_p_dofs(), libMesh::ExodusII_IO::copy_elemental_solution(), libMesh::ExodusII_IO::copy_nodal_solution(), libMesh::DofMap::distribute_dofs(), libMesh::DofMap::dof_indices(), libMesh::DofObject::DofObject(), libMesh::OldSolutionValue< Output, point_output >::eval_at_node(), libMesh::OldSolutionCoefs< Output, point_output >::eval_at_node(), libMesh::Node::get_info(), libMesh::Elem::get_info(), libMesh::DofMap::local_variable_indices(), libMesh::DofMap::old_dof_indices(), libMesh::BuildProjectionList::operator()(), libMesh::DofObject::operator=(), libMesh::DofObject::print_dof_info(), libMesh::HPCoarsenTest::select_refinement(), libMesh::DofObject::set_dof_number(), libMesh::DofObject::set_id(), and libMesh::DofMap::set_nonlocal_dof_objects().

813 {
814  libmesh_assert_less (s, this->n_systems());
815  libmesh_assert_less (var, this->n_vars(s));
816  libmesh_assert_less (comp, this->n_comp(s,var));
817 
818  const unsigned int
819  vg = this->var_to_vg(s,var),
820  start_idx_sys = this->start_idx(s);
821 
822  libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());
823 
824  const dof_id_type
825  base_idx = _idx_buf[start_idx_sys + 2*vg + 1];
826 
827  // if the first component is invalid, they
828  // are all invalid
829  if (base_idx == invalid_id)
830  return invalid_id;
831 
832  // otherwise the index is the first component
833  // index augmented by the component number
834  else
835  {
836  const unsigned int
837  ncg = this->n_comp_group(s,vg),
838  vig = this->system_var_to_vg_var(s,vg,var);
839 
840  // std::cout << "base_idx, var, vg, vig, ncg, comp="
841  // << base_idx << " "
842  // << var << " "
843  // << vg << " "
844  // << vig << " "
845  // << ncg << " "
846  // << comp << '\n';
847 
848  return cast_int<dof_id_type>(base_idx + vig*ncg + comp);
849  }
850 }
unsigned int n_comp_group(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:793
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:745
unsigned int system_var_to_vg_var(const unsigned int s, const unsigned int vg, const unsigned int var) const
Definition: dof_object.h:964
static const dof_id_type invalid_id
Definition: dof_object.h:324
unsigned int start_idx(const unsigned int s) const
Definition: dof_object.h:878
unsigned int var_to_vg(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:946
index_buffer_t _idx_buf
Definition: dof_object.h:485
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:780
unsigned int n_systems() const
Definition: dof_object.h:726
uint8_t dof_id_type
Definition: id_types.h:64
IntRange< unsigned short > libMesh::Elem::edge_index_range ( ) const
inlineinherited
virtual unsigned int libMesh::Elem::embedding_matrix_version ( ) const
inlinevirtualinherited
Returns
A "version number" that identifies which embedding matrix is in use.

Some element types may use a different embedding matrix depending on their geometric characteristics.

Reimplemented in libMesh::Tet.

Definition at line 1537 of file elem.h.

References libMesh::Elem::compute_key().

Referenced by libMesh::Elem::as_parent_node(), and libMesh::Elem::parent_bracketing_nodes().

1537 { return 0; }
void libMesh::ReferenceCounter::enable_print_counter_info ( )
staticinherited

Methods to enable/disable the reference counter output from print_info()

Definition at line 101 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter.

Referenced by libMesh::ReferenceCounter::n_objects().

102 {
103  _enable_print_counter = true;
104  return;
105 }
void libMesh::ReferenceCounter::enable_print_counter_info ( )
staticinherited

Methods to enable/disable the reference counter output from print_info()

Definition at line 101 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter.

Referenced by libMesh::ReferenceCounter::n_objects().

102 {
103  _enable_print_counter = true;
104  return;
105 }
void libMesh::Elem::family_tree ( std::vector< const Elem * > &  family,
const bool  reset = true 
) const
inherited

Fills the vector family with the children of this element, recursively. Calling this method on a twice-refined element will give you the element itself, its direct children, and their children, etc... When the optional parameter reset is true, the vector will be cleared before the element and its descendants are added.

The family tree only includes ancestor and active elements. To include subactive elements as well, use total_family_tree().

Definition at line 1570 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::child_ref_range(), and libMesh::Elem::subactive().

Referenced by libMesh::MeshCommunication::gather_neighboring_elements().

1572 {
1573  // The "family tree" doesn't include subactive elements
1574  libmesh_assert(!this->subactive());
1575 
1576  // Clear the vector if the flag reset tells us to.
1577  if (reset)
1578  family.clear();
1579 
1580  // Add this element to the family tree.
1581  family.push_back(this);
1582 
1583  // Recurse into the elements children, if it has them.
1584  // Do not clear the vector any more.
1585  if (!this->active())
1586  for (auto & c : this->child_ref_range())
1587  if (!c.is_remote())
1588  c.family_tree (family, false);
1589 }
bool subactive() const
Definition: elem.h:2276
bool active() const
Definition: elem.h:2258
SimpleRange< ChildRefIter > child_ref_range()
Definition: elem.h:1700
void libMesh::Elem::family_tree_by_neighbor ( std::vector< const Elem * > &  family,
const Elem neighbor,
const bool  reset = true 
) const
inherited

Same as the family_tree() member, but only adds elements which are next to neighbor.

Definition at line 1697 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::child_ref_range(), libMesh::Elem::has_neighbor(), libMesh::remote_elem, and libMesh::Elem::subactive().

1700 {
1701  // The "family tree" doesn't include subactive elements
1702  libmesh_assert(!this->subactive());
1703 
1704  // Clear the vector if the flag reset tells us to.
1705  if (reset)
1706  family.clear();
1707 
1708  // This only makes sense if we're already a neighbor
1709  libmesh_assert (this->has_neighbor(neighbor_in));
1710 
1711  // Add this element to the family tree.
1712  family.push_back(this);
1713 
1714  // Recurse into the elements children, if it's not active.
1715  // Do not clear the vector any more.
1716  if (!this->active())
1717  for (auto & c : this->child_ref_range())
1718  if (&c != remote_elem && c.has_neighbor(neighbor_in))
1719  c.family_tree_by_neighbor (family, neighbor_in, false);
1720 }
bool subactive() const
Definition: elem.h:2276
bool active() const
Definition: elem.h:2258
SimpleRange< ChildRefIter > child_ref_range()
Definition: elem.h:1700
bool has_neighbor(const Elem *elem) const
Definition: elem.h:2011
const RemoteElem * remote_elem
Definition: remote_elem.C:57
void libMesh::Elem::family_tree_by_side ( std::vector< const Elem * > &  family,
const unsigned int  side,
const bool  reset = true 
) const
inherited

Same as the family_tree() member, but only adds elements which are next to side.

Definition at line 1637 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::child_ptr(), libMesh::Elem::family_tree_by_side(), libMesh::Elem::is_child_on_side(), libMesh::Elem::is_remote(), libMesh::Elem::n_children(), libMesh::Elem::n_sides(), and libMesh::Elem::subactive().

Referenced by libMesh::Elem::family_tree_by_side(), and libMesh::Elem::make_links_to_me_local().

1640 {
1641  // The "family tree" doesn't include subactive elements
1642  libmesh_assert(!this->subactive());
1643 
1644  // Clear the vector if the flag reset tells us to.
1645  if (reset)
1646  family.clear();
1647 
1648  libmesh_assert_less (s, this->n_sides());
1649 
1650  // Add this element to the family tree.
1651  family.push_back(this);
1652 
1653  // Recurse into the elements children, if it has them.
1654  // Do not clear the vector any more.
1655  if (!this->active())
1656  {
1657  const unsigned int nc = this->n_children();
1658  for (unsigned int c = 0; c != nc; c++)
1659  if (!this->child_ptr(c)->is_remote() && this->is_child_on_side(c, s))
1660  this->child_ptr(c)->family_tree_by_side (family, s, false);
1661  }
1662 }
void family_tree_by_side(std::vector< const Elem * > &family, const unsigned int side, const bool reset=true) const
Definition: elem.C:1637
bool subactive() const
Definition: elem.h:2276
bool active() const
Definition: elem.h:2258
virtual bool is_child_on_side(const unsigned int c, const unsigned int s) const =0
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2446
virtual unsigned int n_sides() const =0
virtual bool is_remote() const
Definition: elem.h:531
virtual unsigned int n_children() const =0
void libMesh::Elem::family_tree_by_subneighbor ( std::vector< const Elem * > &  family,
const Elem neighbor,
const Elem subneighbor,
const bool  reset = true 
) const
inherited

Same as the family_tree() member, but only adds elements which are next to subneighbor. Only applicable when this->has_neighbor(neighbor) and neighbor->is_ancestor(subneighbor)

Definition at line 1748 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::child_ref_range(), libMesh::Elem::has_neighbor(), libMesh::Elem::is_ancestor_of(), libMesh::remote_elem, and libMesh::Elem::subactive().

1752 {
1753  // The "family tree" doesn't include subactive elements
1754  libmesh_assert(!this->subactive());
1755 
1756  // Clear the vector if the flag reset tells us to.
1757  if (reset)
1758  family.clear();
1759 
1760  // To simplify this function we need an existing neighbor
1761  libmesh_assert (neighbor_in);
1762  libmesh_assert_not_equal_to (neighbor_in, remote_elem);
1763  libmesh_assert (this->has_neighbor(neighbor_in));
1764 
1765  // This only makes sense if subneighbor descends from neighbor
1766  libmesh_assert (subneighbor);
1767  libmesh_assert_not_equal_to (subneighbor, remote_elem);
1768  libmesh_assert (neighbor_in->is_ancestor_of(subneighbor));
1769 
1770  // Add this element to the family tree if applicable.
1771  if (neighbor_in == subneighbor)
1772  family.push_back(this);
1773 
1774  // Recurse into the elements children, if it's not active.
1775  // Do not clear the vector any more.
1776  if (!this->active())
1777  for (auto & c : this->child_ref_range())
1778  if (&c != remote_elem)
1779  for (auto child_neigh : c.neighbor_ptr_range())
1780  if (child_neigh &&
1781  (child_neigh == neighbor_in ||
1782  (child_neigh->parent() == neighbor_in &&
1783  child_neigh->is_ancestor_of(subneighbor))))
1784  c.family_tree_by_subneighbor (family, child_neigh,
1785  subneighbor, false);
1786 }
bool subactive() const
Definition: elem.h:2276
bool active() const
Definition: elem.h:2258
SimpleRange< ChildRefIter > child_ref_range()
Definition: elem.h:1700
bool has_neighbor(const Elem *elem) const
Definition: elem.h:2011
const RemoteElem * remote_elem
Definition: remote_elem.C:57
void libMesh::Elem::find_edge_neighbors ( const Point p1,
const Point p2,
std::set< const Elem * > &  neighbor_set 
) const
inherited

This function finds all active elements in the same manifold as this element which touch the current active element along the whole edge defined by the two points p1 and p2.

Definition at line 662 of file elem.C.

References libMesh::Elem::contains_point(), end, and libMesh::Elem::find_point_neighbors().

Referenced by libMesh::MeshRefinement::enforce_mismatch_limit_prior_to_refinement().

665 {
666  // Simple but perhaps suboptimal code: find elements containing the
667  // first point, then winnow this set down by removing elements which
668  // don't also contain the second point
669 
670  libmesh_assert(this->contains_point(p2));
671  this->find_point_neighbors(p1, neighbor_set);
672 
673  std::set<const Elem *>::iterator it = neighbor_set.begin();
674  const std::set<const Elem *>::iterator end = neighbor_set.end();
675 
676  while (it != end)
677  {
678  std::set<const Elem *>::iterator current = it++;
679 
680  const Elem * elem = *current;
681  // This won't invalidate iterator it, because it is already
682  // pointing to the next element
683  if (!elem->contains_point(p2))
684  neighbor_set.erase(current);
685  }
686 }
IterBase * end
void find_point_neighbors(const Point &p, std::set< const Elem * > &neighbor_set) const
Definition: elem.C:497
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1732
virtual bool contains_point(const Point &p, Real tol=TOLERANCE) const
Definition: elem.C:2337
void libMesh::Elem::find_edge_neighbors ( std::set< const Elem * > &  neighbor_set) const
inherited

This function finds all active elements in the same manifold as this element which touch the current active element along any edge (more precisely, at at least two points).

In this case, elements are included even if they do not touch a whole edge of this element.

Definition at line 690 of file elem.C.

References libMesh::Elem::active_family_tree_by_neighbor(), libMesh::Elem::contains_edge_of(), end, libMesh::Elem::neighbor_ptr_range(), and libMesh::remote_elem.

691 {
692  neighbor_set.clear();
693  neighbor_set.insert(this);
694 
695  std::set<const Elem *> untested_set, next_untested_set;
696  untested_set.insert(this);
697 
698  while (!untested_set.empty())
699  {
700  // Loop over all the elements in the patch that haven't already
701  // been tested
702  std::set<const Elem *>::const_iterator it = untested_set.begin();
703  const std::set<const Elem *>::const_iterator end = untested_set.end();
704 
705  for (; it != end; ++it)
706  {
707  const Elem * elem = *it;
708 
709  for (auto current_neighbor : elem->neighbor_ptr_range())
710  {
711  if (current_neighbor &&
712  current_neighbor != remote_elem) // we have a real neighbor on this side
713  {
714  if (current_neighbor->active()) // ... if it is active
715  {
716  if (this->contains_edge_of(current_neighbor) // ... and touches us
717  || current_neighbor->contains_edge_of(this))
718  {
719  // Make sure we'll test it
720  if (!neighbor_set.count(current_neighbor))
721  next_untested_set.insert (current_neighbor);
722 
723  // And add it
724  neighbor_set.insert (current_neighbor);
725  }
726  }
727 #ifdef LIBMESH_ENABLE_AMR
728  else // ... the neighbor is *not* active,
729  { // ... so add *all* neighboring
730  // active children
731  std::vector<const Elem *> active_neighbor_children;
732 
733  current_neighbor->active_family_tree_by_neighbor
734  (active_neighbor_children, elem);
735 
736  std::vector<const Elem *>::const_iterator
737  child_it = active_neighbor_children.begin();
738  const std::vector<const Elem *>::const_iterator
739  child_end = active_neighbor_children.end();
740  for (; child_it != child_end; ++child_it)
741  {
742  const Elem * current_child = *child_it;
743  if (this->contains_edge_of(*child_it) ||
744  (*child_it)->contains_edge_of(this))
745  {
746  // Make sure we'll test it
747  if (!neighbor_set.count(current_child))
748  next_untested_set.insert (current_child);
749 
750  neighbor_set.insert (current_child);
751  }
752  }
753  }
754 #endif // #ifdef LIBMESH_ENABLE_AMR
755  }
756  }
757  }
758  untested_set.swap(next_untested_set);
759  next_untested_set.clear();
760  }
761 }
IterBase * end
bool contains_edge_of(const Elem *e) const
Definition: elem.C:476
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1732
const RemoteElem * remote_elem
Definition: remote_elem.C:57
void libMesh::Elem::find_interior_neighbors ( std::set< const Elem * > &  neighbor_set) const
inherited

This function finds all active elements (not including this one) in the parent manifold of this element whose intersection with this element has non-zero measure.

Definition at line 764 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::child(), libMesh::Elem::child_ref_range(), libMesh::Elem::contains_point(), libMesh::Elem::contains_vertex_of(), libMesh::Elem::dim(), end, libMesh::Elem::find_point_neighbors(), libMesh::Elem::interior_parent(), libMesh::Elem::level(), libMesh::Elem::node_ref_range(), and libMesh::Elem::subactive().

Referenced by libMesh::MetisPartitioner::partition_range().

765 {
766  neighbor_set.clear();
767 
768  if ((this->dim() >= LIBMESH_DIM) ||
769  !this->interior_parent())
770  return;
771 
772  const Elem * ip = this->interior_parent();
773  libmesh_assert (ip->contains_vertex_of(this) ||
774  this->contains_vertex_of(ip));
775 
776  libmesh_assert (!ip->subactive());
777 
778 #ifdef LIBMESH_ENABLE_AMR
779  while (!ip->active()) // only possible with AMR, be careful because
780  { // ip->child_ptr(c) is only good with AMR.
781  for (auto & child : ip->child_ref_range())
782  {
783  if (child.contains_vertex_of(this) ||
784  this->contains_vertex_of(&child))
785  {
786  ip = &child;
787  break;
788  }
789  }
790  }
791 #endif
792 
793  this->find_point_neighbors(neighbor_set, ip);
794 
795  // Now we have all point neighbors from the interior manifold, but
796  // we need to weed out any neighbors that *only* intersect us at one
797  // point (or at one edge, if we're a 1-D element in 3D).
798  //
799  // The refinement hierarchy helps us here: if the interior element
800  // has a lower or equal refinement level then we can discard it iff
801  // it doesn't contain all our vertices. If it has a higher
802  // refinement level then we can discard it iff we don't contain at
803  // least dim()+1 of its vertices
804  std::set<const Elem *>::iterator it = neighbor_set.begin();
805  const std::set<const Elem *>::iterator end = neighbor_set.end();
806 
807  while (it != end)
808  {
809  std::set<const Elem *>::iterator current = it++;
810  const Elem * elem = *current;
811 
812  // This won't invalidate iterator it, because it is already
813  // pointing to the next element
814  if (elem->level() > this->level())
815  {
816  unsigned int vertices_contained = 0;
817  for (auto & n : elem->node_ref_range())
818  if (this->contains_point(n))
819  vertices_contained++;
820 
821  if (vertices_contained <= this->dim())
822  {
823  neighbor_set.erase(current);
824  continue;
825  }
826  }
827  else
828  {
829  for (auto & n : this->node_ref_range())
830  {
831  if (!elem->contains_point(n))
832  {
833  neighbor_set.erase(current);
834  break;
835  }
836  }
837  }
838  }
839 }
const Elem * interior_parent() const
Definition: elem.C:843
IterBase * end
Elem * child(const unsigned int i) const
Definition: elem.h:2466
void find_point_neighbors(const Point &p, std::set< const Elem * > &neighbor_set) const
Definition: elem.C:497
bool contains_vertex_of(const Elem *e) const
Definition: elem.C:465
SimpleRange< ChildRefIter > child_ref_range()
Definition: elem.h:1700
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1732
SimpleRange< NodeRefIter > node_ref_range()
Definition: elem.h:2048
virtual unsigned int dim() const =0
unsigned int level() const
Definition: elem.h:2389
virtual bool contains_point(const Point &p, Real tol=TOLERANCE) const
Definition: elem.C:2337
void libMesh::Elem::find_point_neighbors ( const Point p,
std::set< const Elem * > &  neighbor_set 
) const
inherited

This function finds all active elements (including this one) which are in the same manifold as this element and which touch the current active element at the specified point, which should be a point in the current element.

Elements which are not "in the same manifold" (e.g. the interior_parent of a boundary element) will not be found with this method.

Elements which overlap the specified point but which are only connected to the current element via elements which do not overlap that point (e.g. in a folded or tangled mesh) are not considered to "touch" the current element and will not be found with this method.

Definition at line 497 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::active_family_tree_by_neighbor(), libMesh::Elem::contains_point(), end, libMesh::Elem::neighbor_ptr_range(), and libMesh::remote_elem.

Referenced by libMesh::MeshRefinement::enforce_mismatch_limit_prior_to_refinement(), libMesh::Elem::find_edge_neighbors(), libMesh::MeshFunction::find_element(), libMesh::MeshFunction::find_elements(), libMesh::Elem::find_interior_neighbors(), libMesh::Patch::find_point_neighbors(), libMesh::Elem::find_point_neighbors(), libMesh::Elem::is_semilocal(), and libMesh::PointNeighborCoupling::operator()().

499 {
500  libmesh_assert(this->contains_point(p));
501  libmesh_assert(this->active());
502 
503  neighbor_set.clear();
504  neighbor_set.insert(this);
505 
506  std::set<const Elem *> untested_set, next_untested_set;
507  untested_set.insert(this);
508 
509  while (!untested_set.empty())
510  {
511  // Loop over all the elements in the patch that haven't already
512  // been tested
513  std::set<const Elem *>::const_iterator it = untested_set.begin();
514  const std::set<const Elem *>::const_iterator end = untested_set.end();
515 
516  for (; it != end; ++it)
517  {
518  const Elem * elem = *it;
519 
520  for (auto current_neighbor : elem->neighbor_ptr_range())
521  {
522  if (current_neighbor &&
523  current_neighbor != remote_elem) // we have a real neighbor on this side
524  {
525  if (current_neighbor->active()) // ... if it is active
526  {
527  if (current_neighbor->contains_point(p)) // ... and touches p
528  {
529  // Make sure we'll test it
530  if (!neighbor_set.count(current_neighbor))
531  next_untested_set.insert (current_neighbor);
532 
533  // And add it
534  neighbor_set.insert (current_neighbor);
535  }
536  }
537 #ifdef LIBMESH_ENABLE_AMR
538  else // ... the neighbor is *not* active,
539  { // ... so add *all* neighboring
540  // active children that touch p
541  std::vector<const Elem *> active_neighbor_children;
542 
543  current_neighbor->active_family_tree_by_neighbor
544  (active_neighbor_children, elem);
545 
546  std::vector<const Elem *>::const_iterator
547  child_it = active_neighbor_children.begin();
548  const std::vector<const Elem *>::const_iterator
549  child_end = active_neighbor_children.end();
550  for (; child_it != child_end; ++child_it)
551  {
552  const Elem * current_child = *child_it;
553  if (current_child->contains_point(p))
554  {
555  // Make sure we'll test it
556  if (!neighbor_set.count(current_child))
557  next_untested_set.insert (current_child);
558 
559  neighbor_set.insert (current_child);
560  }
561  }
562  }
563 #endif // #ifdef LIBMESH_ENABLE_AMR
564  }
565  }
566  }
567  untested_set.swap(next_untested_set);
568  next_untested_set.clear();
569  }
570 }
bool active() const
Definition: elem.h:2258
IterBase * end
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1732
virtual bool contains_point(const Point &p, Real tol=TOLERANCE) const
Definition: elem.C:2337
const RemoteElem * remote_elem
Definition: remote_elem.C:57
void libMesh::Elem::find_point_neighbors ( std::set< const Elem * > &  neighbor_set) const
inherited

This function finds all active elements (including this one) in the same manifold as this element which touch this active element at any point.

Definition at line 574 of file elem.C.

References libMesh::Elem::find_point_neighbors().

575 {
576  this->find_point_neighbors(neighbor_set, this);
577 }
void find_point_neighbors(const Point &p, std::set< const Elem * > &neighbor_set) const
Definition: elem.C:497
void libMesh::Elem::find_point_neighbors ( std::set< const Elem * > &  neighbor_set,
const Elem start_elem 
) const
inherited

This function finds all active elements (including this one) in the same manifold as start_elem (which must be active and must touch this element) which touch this element at any point.

Definition at line 581 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::active_family_tree_by_neighbor(), libMesh::Elem::contains_vertex_of(), end, libMesh::Elem::neighbor_ptr_range(), and libMesh::remote_elem.

583 {
584  libmesh_assert(start_elem);
585  libmesh_assert(start_elem->active());
586  libmesh_assert(start_elem->contains_vertex_of(this) ||
587  this->contains_vertex_of(start_elem));
588 
589  neighbor_set.clear();
590  neighbor_set.insert(start_elem);
591 
592  std::set<const Elem *> untested_set, next_untested_set;
593  untested_set.insert(start_elem);
594 
595  while (!untested_set.empty())
596  {
597  // Loop over all the elements in the patch that haven't already
598  // been tested
599  std::set<const Elem *>::const_iterator it = untested_set.begin();
600  const std::set<const Elem *>::const_iterator end = untested_set.end();
601 
602  for (; it != end; ++it)
603  {
604  const Elem * elem = *it;
605 
606  for (auto current_neighbor : elem->neighbor_ptr_range())
607  {
608  if (current_neighbor &&
609  current_neighbor != remote_elem) // we have a real neighbor on this side
610  {
611  if (current_neighbor->active()) // ... if it is active
612  {
613  if (this->contains_vertex_of(current_neighbor) // ... and touches us
614  || current_neighbor->contains_vertex_of(this))
615  {
616  // Make sure we'll test it
617  if (!neighbor_set.count(current_neighbor))
618  next_untested_set.insert (current_neighbor);
619 
620  // And add it
621  neighbor_set.insert (current_neighbor);
622  }
623  }
624 #ifdef LIBMESH_ENABLE_AMR
625  else // ... the neighbor is *not* active,
626  { // ... so add *all* neighboring
627  // active children
628  std::vector<const Elem *> active_neighbor_children;
629 
630  current_neighbor->active_family_tree_by_neighbor
631  (active_neighbor_children, elem);
632 
633  std::vector<const Elem *>::const_iterator
634  child_it = active_neighbor_children.begin();
635  const std::vector<const Elem *>::const_iterator
636  child_end = active_neighbor_children.end();
637  for (; child_it != child_end; ++child_it)
638  {
639  const Elem * current_child = *child_it;
640  if (this->contains_vertex_of(current_child) ||
641  (current_child)->contains_vertex_of(this))
642  {
643  // Make sure we'll test it
644  if (!neighbor_set.count(current_child))
645  next_untested_set.insert (current_child);
646 
647  neighbor_set.insert (current_child);
648  }
649  }
650  }
651 #endif // #ifdef LIBMESH_ENABLE_AMR
652  }
653  }
654  }
655  untested_set.swap(next_untested_set);
656  next_untested_set.clear();
657  }
658 }
IterBase * end
bool contains_vertex_of(const Elem *e) const
Definition: elem.C:465
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1732
const RemoteElem * remote_elem
Definition: remote_elem.C:57
ElemType libMesh::Elem::first_order_equivalent_type ( const ElemType  et)
staticinherited
Returns
The element type of the associated first-order element, or INVALID_ELEM for first-order or other elements that cannot be converted into lower order equivalents.

For example, when this is a TET10, then TET4 is returned.

Definition at line 2613 of file elem.C.

References libMesh::EDGE2, libMesh::EDGE3, libMesh::EDGE4, libMesh::HEX20, libMesh::HEX27, libMesh::HEX8, libMesh::INFHEX16, libMesh::INFHEX18, libMesh::INFHEX8, libMesh::INFPRISM12, libMesh::INFPRISM6, libMesh::INFQUAD4, libMesh::INFQUAD6, libMesh::INVALID_ELEM, libMesh::PRISM15, libMesh::PRISM18, libMesh::PRISM6, libMesh::PYRAMID13, libMesh::PYRAMID14, libMesh::PYRAMID5, libMesh::QUAD4, libMesh::QUAD8, libMesh::QUAD9, libMesh::QUADSHELL4, libMesh::QUADSHELL8, libMesh::TET10, libMesh::TET4, libMesh::TRI3, libMesh::TRI6, and libMesh::TRISHELL3.

Referenced by libMesh::UnstructuredMesh::all_first_order(), libMesh::Elem::is_linear(), and libMesh::GMVIO::write_ascii_old_impl().

2614 {
2615  switch (et)
2616  {
2617  case EDGE2:
2618  case EDGE3:
2619  case EDGE4:
2620  return EDGE2;
2621  case TRI3:
2622  case TRI6:
2623  return TRI3;
2624  case TRISHELL3:
2625  return TRISHELL3;
2626  case QUAD4:
2627  case QUAD8:
2628  case QUAD9:
2629  return QUAD4;
2630  case QUADSHELL4:
2631  case QUADSHELL8:
2632  return QUADSHELL4;
2633  case TET4:
2634  case TET10:
2635  return TET4;
2636  case HEX8:
2637  case HEX27:
2638  case HEX20:
2639  return HEX8;
2640  case PRISM6:
2641  case PRISM15:
2642  case PRISM18:
2643  return PRISM6;
2644  case PYRAMID5:
2645  case PYRAMID13:
2646  case PYRAMID14:
2647  return PYRAMID5;
2648 
2649 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
2650 
2651  case INFQUAD4:
2652  case INFQUAD6:
2653  return INFQUAD4;
2654  case INFHEX8:
2655  case INFHEX16:
2656  case INFHEX18:
2657  return INFHEX8;
2658  case INFPRISM6:
2659  case INFPRISM12:
2660  return INFPRISM6;
2661 
2662 #endif
2663 
2664  default:
2665  // unknown element
2666  return INVALID_ELEM;
2667  }
2668 }
std::string libMesh::ReferenceCounter::get_info ( )
staticinherited

Gets a string containing the reference information.

Definition at line 47 of file reference_counter.C.

References libMesh::ReferenceCounter::_counts, and libMesh::Quality::name().

Referenced by libMesh::ReferenceCounter::print_info().

48 {
49 #if defined(LIBMESH_ENABLE_REFERENCE_COUNTING) && defined(DEBUG)
50 
51  std::ostringstream oss;
52 
53  oss << '\n'
54  << " ---------------------------------------------------------------------------- \n"
55  << "| Reference count information |\n"
56  << " ---------------------------------------------------------------------------- \n";
57 
58  for (Counts::iterator it = _counts.begin();
59  it != _counts.end(); ++it)
60  {
61  const std::string name(it->first);
62  const unsigned int creations = it->second.first;
63  const unsigned int destructions = it->second.second;
64 
65  oss << "| " << name << " reference count information:\n"
66  << "| Creations: " << creations << '\n'
67  << "| Destructions: " << destructions << '\n';
68  }
69 
70  oss << " ---------------------------------------------------------------------------- \n";
71 
72  return oss.str();
73 
74 #else
75 
76  return "";
77 
78 #endif
79 }
std::string name(const ElemQuality q)
Definition: elem_quality.C:39
std::string libMesh::ReferenceCounter::get_info ( )
staticinherited

Gets a string containing the reference information.

Definition at line 47 of file reference_counter.C.

References libMesh::ReferenceCounter::_counts, and libMesh::Quality::name().

Referenced by libMesh::ReferenceCounter::print_info().

48 {
49 #if defined(LIBMESH_ENABLE_REFERENCE_COUNTING) && defined(DEBUG)
50 
51  std::ostringstream oss;
52 
53  oss << '\n'
54  << " ---------------------------------------------------------------------------- \n"
55  << "| Reference count information |\n"
56  << " ---------------------------------------------------------------------------- \n";
57 
58  for (Counts::iterator it = _counts.begin();
59  it != _counts.end(); ++it)
60  {
61  const std::string name(it->first);
62  const unsigned int creations = it->second.first;
63  const unsigned int destructions = it->second.second;
64 
65  oss << "| " << name << " reference count information:\n"
66  << "| Creations: " << creations << '\n'
67  << "| Destructions: " << destructions << '\n';
68  }
69 
70  oss << " ---------------------------------------------------------------------------- \n";
71 
72  return oss.str();
73 
74 #else
75 
76  return "";
77 
78 #endif
79 }
std::string name(const ElemQuality q)
Definition: elem_quality.C:39
std::string libMesh::Elem::get_info ( ) const
inherited

Prints relevant information about the element to a string.

Definition at line 2484 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::ancestor(), libMesh::Elem::dim(), libMesh::DofObject::dof_number(), libMesh::Utility::enum_to_string(), libMesh::Elem::has_children(), libMesh::Elem::hmax(), libMesh::Elem::hmin(), libMesh::DofObject::id(), libMesh::Elem::infinite(), libMesh::Elem::level(), libMesh::DofObject::n_comp(), libMesh::Elem::n_nodes(), libMesh::Elem::n_sides(), libMesh::DofObject::n_systems(), libMesh::DofObject::n_vars(), libMesh::Elem::neighbor_ptr(), libMesh::Elem::node_ref(), libMesh::Elem::origin(), libMesh::Elem::p_level(), libMesh::Elem::p_refinement_flag(), libMesh::Elem::parent(), libMesh::DofObject::processor_id(), libMesh::Elem::refinement_flag(), libMesh::Elem::subactive(), libMesh::Elem::type(), libMesh::DofObject::unique_id(), libMesh::DofObject::valid_id(), libMesh::DofObject::valid_unique_id(), and libMesh::Elem::volume().

Referenced by libMesh::Elem::is_linear(), and libMesh::Elem::print_info().

2485 {
2486  std::ostringstream oss;
2487 
2488  oss << " Elem Information" << '\n'
2489  << " id()=";
2490 
2491  if (this->valid_id())
2492  oss << this->id();
2493  else
2494  oss << "invalid";
2495 
2496 #ifdef LIBMESH_ENABLE_UNIQUE_ID
2497  oss << ", unique_id()=";
2498  if (this->valid_unique_id())
2499  oss << this->unique_id();
2500  else
2501  oss << "invalid";
2502 #endif
2503 
2504  oss << ", processor_id()=" << this->processor_id() << '\n';
2505 
2506  oss << " type()=" << Utility::enum_to_string(this->type()) << '\n'
2507  << " dim()=" << this->dim() << '\n'
2508  << " n_nodes()=" << this->n_nodes() << '\n';
2509 
2510  for (unsigned int n=0; n != this->n_nodes(); ++n)
2511  oss << " " << n << this->node_ref(n);
2512 
2513  oss << " n_sides()=" << this->n_sides() << '\n';
2514 
2515  for (unsigned int s=0; s != this->n_sides(); ++s)
2516  {
2517  oss << " neighbor(" << s << ")=";
2518  if (this->neighbor_ptr(s))
2519  oss << this->neighbor_ptr(s)->id() << '\n';
2520  else
2521  oss << "NULL\n";
2522  }
2523 
2524  oss << " hmin()=" << this->hmin()
2525  << ", hmax()=" << this->hmax() << '\n'
2526  << " volume()=" << this->volume() << '\n'
2527  << " active()=" << this->active()
2528  << ", ancestor()=" << this->ancestor()
2529  << ", subactive()=" << this->subactive()
2530  << ", has_children()=" << this->has_children() << '\n'
2531  << " parent()=";
2532  if (this->parent())
2533  oss << this->parent()->id() << '\n';
2534  else
2535  oss << "NULL\n";
2536  oss << " level()=" << this->level()
2537  << ", p_level()=" << this->p_level() << '\n'
2538 #ifdef LIBMESH_ENABLE_AMR
2539  << " refinement_flag()=" << Utility::enum_to_string(this->refinement_flag()) << '\n'
2540  << " p_refinement_flag()=" << Utility::enum_to_string(this->p_refinement_flag()) << '\n'
2541 #endif
2542 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
2543  << " infinite()=" << this->infinite() << '\n';
2544  if (this->infinite())
2545  oss << " origin()=" << this->origin() << '\n'
2546 #endif
2547  ;
2548 
2549  oss << " DoFs=";
2550  for (unsigned int s=0; s != this->n_systems(); ++s)
2551  for (unsigned int v=0; v != this->n_vars(s); ++v)
2552  for (unsigned int c=0; c != this->n_comp(s,v); ++c)
2553  oss << '(' << s << '/' << v << '/' << this->dof_number(s,v,c) << ") ";
2554 
2555 
2556  return oss.str();
2557 }
bool ancestor() const
Definition: elem.C:1463
bool has_children() const
Definition: elem.h:2296
bool valid_id() const
Definition: dof_object.h:674
bool subactive() const
Definition: elem.h:2276
bool active() const
Definition: elem.h:2258
virtual ElemType type() const =0
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:745
unsigned int p_level() const
Definition: elem.h:2423
const Elem * parent() const
Definition: elem.h:2347
virtual Real hmin() const
Definition: elem.C:350
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
Definition: dof_object.h:810
virtual Real volume() const
Definition: elem.C:2855
bool valid_unique_id() const
Definition: dof_object.h:682
virtual bool infinite() const =0
virtual unsigned int n_nodes() const =0
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:1968
const Node & node_ref(const unsigned int i) const
Definition: elem.h:1897
RefinementState p_refinement_flag() const
Definition: elem.h:2522
virtual unsigned int n_sides() const =0
virtual Point origin() const
Definition: elem.h:1481
std::string enum_to_string(const T e)
virtual Real hmax() const
Definition: elem.C:367
virtual unsigned int dim() const =0
unsigned int level() const
Definition: elem.h:2389
RefinementState refinement_flag() const
Definition: elem.h:2506
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:780
dof_id_type id() const
Definition: dof_object.h:632
unsigned int n_systems() const
Definition: dof_object.h:726
unique_id_type unique_id() const
Definition: dof_object.h:649
processor_id_type processor_id() const
Definition: dof_object.h:694
Node * libMesh::Elem::get_node ( const unsigned int  i) const
inlineinherited
Returns
The pointer to local Node i.
Deprecated:
Use the less ambiguously named node_ptr() instead.

Definition at line 1914 of file elem.h.

References libMesh::Elem::node_ptr().

1915 {
1916  // This const function has incorrectly returned a non-const pointer
1917  // for years. Now that it is reimplemented in terms of the new
1918  // interface which does return a const pointer, we need to use a
1919  // const_cast to mimic the old (incorrect) behavior. This function
1920  // is now deprecated and eventually will be removed entirely,
1921  // obviating the need for this ugly cast.
1922  libmesh_deprecated();
1923  return const_cast<Node *>(this->node_ptr(i));
1924 }
const Node * node_ptr(const unsigned int i) const
Definition: elem.h:1875
unsigned int libMesh::Elem::get_node_index ( const Node node_ptr) const
inlineinherited
Returns
The local index for the Node pointer node_ptr, or invalid_id if node_ptr is not a local node.

Definition at line 1930 of file elem.h.

References libMesh::Elem::_nodes, libMesh::invalid_uint, and libMesh::Elem::n_nodes().

Referenced by libMesh::ElemCutter::find_intersection_points().

1931 {
1932  for (unsigned int n=0; n != this->n_nodes(); ++n)
1933  if (this->_nodes[n] == node_ptr)
1934  return n;
1935 
1936  return libMesh::invalid_uint;
1937 }
Node ** _nodes
Definition: elem.h:1616
const unsigned int invalid_uint
Definition: libmesh.h:184
virtual unsigned int n_nodes() const =0
const Node * node_ptr(const unsigned int i) const
Definition: elem.h:1875
const Node *const * libMesh::Elem::get_nodes ( ) const
inlineinherited
Returns
A pointer to an array of local node pointers.

Definition at line 1867 of file elem.h.

References libMesh::Elem::_nodes.

Referenced by libMesh::DofMap::dof_indices(), and libMesh::DofMap::old_dof_indices().

1868 {
1869  return _nodes;
1870 }
Node ** _nodes
Definition: elem.h:1616
void libMesh::Elem::hack_p_level ( const unsigned int  p)
inlineinherited

Sets the value of the p-refinement level for the element without altering the p-level of its ancestors

Definition at line 2607 of file elem.h.

References libMesh::Elem::_p_level, libMesh::Elem::JUST_REFINED, and libMesh::Elem::p_refinement_flag().

Referenced by libMesh::CheckpointIO::read_connectivity(), libMesh::XdrIO::read_serialized_connectivity(), and libMesh::Parallel::Packing< Elem * >::unpack().

2608 {
2609  if (p == 0)
2610  libmesh_assert_not_equal_to
2612 
2613  _p_level = cast_int<unsigned char>(p);
2614 }
unsigned char _p_level
Definition: elem.h:1657
RefinementState p_refinement_flag() const
Definition: elem.h:2522
virtual bool libMesh::Elem::has_affine_map ( ) const
inlinevirtualinherited
Returns
true if the element map is definitely affine (i.e. the same at every quadrature point) within numerical tolerances.

Reimplemented in libMesh::NodeElem, libMesh::Pyramid14, libMesh::Prism15, libMesh::Prism18, libMesh::Pyramid13, libMesh::Hex20, libMesh::Hex27, libMesh::Tet10, libMesh::Tet4, libMesh::Hex8, libMesh::Edge4, libMesh::Edge3, libMesh::Quad8, libMesh::Quad9, libMesh::Tri3, libMesh::Tri6, libMesh::Prism6, libMesh::Pyramid5, libMesh::Quad4, libMesh::Edge2, and libMesh::Tri3Subdivision.

Definition at line 916 of file elem.h.

Referenced by libMesh::FEMap::compute_map().

916 { return false; }
bool libMesh::Elem::has_ancestor_children ( ) const
inlineinherited
Returns
true if the element has any descendants other than its immediate children, false otherwise, or if AMR is disabled.

Definition at line 2310 of file elem.h.

References libMesh::Elem::_children, libMesh::Elem::child_ref_range(), and libmesh_nullptr.

Referenced by libMesh::Elem::is_linear().

2311 {
2312 #ifdef LIBMESH_ENABLE_AMR
2313  if (_children == libmesh_nullptr)
2314  return false;
2315  else
2316  for (auto & c : child_ref_range())
2317  if (c.has_children())
2318  return true;
2319 #endif
2320  return false;
2321 }
const class libmesh_nullptr_t libmesh_nullptr
SimpleRange< ChildRefIter > child_ref_range()
Definition: elem.h:1700
Elem ** _children
Definition: elem.h:1628
bool libMesh::Elem::has_children ( ) const
inlineinherited
Returns
true if the element has any children (active or not), false otherwise, or if AMR is disabled.

Definition at line 2296 of file elem.h.

References libMesh::Elem::_children, and libmesh_nullptr.

Referenced by libMesh::Elem::add_child(), libMesh::UnstructuredMesh::all_first_order(), libMesh::Elem::ancestor(), libMesh::connect_children(), libMesh::connect_families(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshRefinement::flag_elements_by_nelem_target(), libMesh::Elem::get_info(), libMesh::Elem::is_linear(), libMesh::MeshTools::libmesh_assert_topology_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_valid_remote_elems(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::Elem::make_links_to_me_local(), libMesh::Elem::make_links_to_me_remote(), libMesh::MeshRefinement::make_refinement_compatible(), libMesh::FEMSystem::mesh_position_set(), libMesh::Parallel::Packing< const Elem * >::pack(), libMesh::Elem::remove_links_to_me(), libMesh::Elem::replace_child(), libMesh::Elem::set_child(), libMesh::Elem::subactive(), libMesh::Parallel::sync_element_data_by_parent_id(), libMesh::Elem::total_family_tree(), libMesh::Elem::total_family_tree_by_neighbor(), libMesh::Elem::total_family_tree_by_subneighbor(), libMesh::Parallel::Packing< Elem * >::unpack(), libMesh::Elem::which_child_am_i(), and libMesh::CheckpointIO::write_remote_elem().

2297 {
2298 #ifdef LIBMESH_ENABLE_AMR
2299  if (_children == libmesh_nullptr)
2300  return false;
2301  else
2302  return true;
2303 #else
2304  return false;
2305 #endif
2306 }
const class libmesh_nullptr_t libmesh_nullptr
Elem ** _children
Definition: elem.h:1628
bool libMesh::DofObject::has_dofs ( const unsigned int  s = libMesh::invalid_uint) const
inlineinherited
Returns
true if any system has variables which have been assigned, false otherwise.

Definition at line 855 of file dof_object.h.

References libMesh::invalid_uint, libMesh::DofObject::n_systems(), and libMesh::DofObject::n_vars().

Referenced by libMesh::DofMap::old_dof_indices(), libMesh::DofMap::reinit(), and libMesh::DofObject::set_id().

856 {
857  if (sys == libMesh::invalid_uint)
858  {
859  for (unsigned int s=0; s<this->n_systems(); s++)
860  if (this->n_vars(s))
861  return true;
862  }
863 
864  else
865  {
866  libmesh_assert_less (sys, this->n_systems());
867 
868  if (this->n_vars(sys))
869  return true;
870  }
871 
872  return false;
873 }
const unsigned int invalid_uint
Definition: libmesh.h:184
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:745
unsigned int n_systems() const
Definition: dof_object.h:726
bool libMesh::Elem::has_neighbor ( const Elem elem) const
inlineinherited
bool libMesh::Elem::has_topological_neighbor ( const Elem elem,
const MeshBase mesh,
const PointLocatorBase point_locator,
const PeriodicBoundaries pb 
) const
inherited
Returns
true if the element elem in question is a neighbor or topological neighbor of this element, false otherwise.

Definition at line 996 of file elem.C.

References libMesh::Elem::has_neighbor(), libMesh::Elem::side_index_range(), and libMesh::Elem::topological_neighbor().

Referenced by libMesh::Elem::active_family_tree_by_topological_neighbor(), and libMesh::MeshRefinement::has_topological_neighbor().

1000 {
1001  // First see if this is a normal "interior" neighbor
1002  if (has_neighbor(elem))
1003  return true;
1004 
1005  for (auto n : this->side_index_range())
1006  if (this->topological_neighbor(n, mesh, point_locator, pb))
1007  return true;
1008 
1009  return false;
1010 }
IntRange< unsigned short > side_index_range() const
Definition: elem.h:2084
MeshBase & mesh
const Elem * topological_neighbor(const unsigned int i, const MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb) const
Definition: elem.C:959
bool has_neighbor(const Elem *elem) const
Definition: elem.h:2011
Real libMesh::Elem::hmax ( ) const
virtualinherited
Returns
The maximum vertex separation for the element.

Definition at line 367 of file elem.C.

References std::max(), libMesh::Elem::n_vertices(), libMesh::TypeVector< T >::norm_sq(), libMesh::Elem::point(), and libMesh::Real.

Referenced by libMesh::DiscontinuityMeasure::boundary_side_integration(), libMesh::KellyErrorEstimator::boundary_side_integration(), libMesh::OldSolutionBase< Output, point_output >::check_old_context(), libMesh::Elem::get_info(), libMesh::LaplacianErrorEstimator::internal_side_integration(), libMesh::DiscontinuityMeasure::internal_side_integration(), libMesh::KellyErrorEstimator::internal_side_integration(), libMesh::Elem::is_vertex_on_child(), libMesh::PointLocatorBase::locate_node(), and libMesh::Elem::point_test().

368 {
369  Real h_max=0;
370 
371  for (unsigned int n_outer=0; n_outer<this->n_vertices(); n_outer++)
372  for (unsigned int n_inner=n_outer+1; n_inner<this->n_vertices(); n_inner++)
373  {
374  const Point diff = (this->point(n_outer) - this->point(n_inner));
375 
376  h_max = std::max(h_max, diff.norm_sq());
377  }
378 
379  return std::sqrt(h_max);
380 }
long double max(long double a, double b)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Point & point(const unsigned int i) const
Definition: elem.h:1810
virtual unsigned int n_vertices() const =0
Real libMesh::Elem::hmin ( ) const
virtualinherited
Returns
The minimum vertex separation for the element.

Definition at line 350 of file elem.C.

References std::max(), std::min(), libMesh::Elem::n_vertices(), libMesh::TypeVector< T >::norm_sq(), libMesh::Elem::point(), and libMesh::Real.

Referenced by libMesh::FEGenericBase< OutputType >::compute_periodic_constraints(), libMesh::MeshTools::Modification::distort(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::Elem::get_info(), libMesh::Elem::is_vertex_on_child(), libMesh::FEMSystem::numerical_jacobian(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::operator()(), and libMesh::ReplicatedMesh::stitching_helper().

351 {
353 
354  for (unsigned int n_outer=0; n_outer<this->n_vertices(); n_outer++)
355  for (unsigned int n_inner=n_outer+1; n_inner<this->n_vertices(); n_inner++)
356  {
357  const Point diff = (this->point(n_outer) - this->point(n_inner));
358 
359  h_min = std::min(h_min, diff.norm_sq());
360  }
361 
362  return std::sqrt(h_min);
363 }
long double max(long double a, double b)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Point & point(const unsigned int i) const
Definition: elem.h:1810
virtual unsigned int n_vertices() const =0
long double min(long double a, double b)
dof_id_type libMesh::DofObject::id ( ) const
inlineinherited
Returns
The id for this DofObject

Definition at line 632 of file dof_object.h.

References libMesh::DofObject::_id, and libMesh::DofObject::valid_id().

Referenced by libMesh::UniformRefinementEstimator::_estimate_error(), libMesh::BoundaryInfo::_find_id_maps(), libMesh::MeshTools::Subdivision::add_boundary_ghosts(), libMesh::ReplicatedMesh::add_elem(), libMesh::DistributedMesh::add_elem(), libMesh::BoundaryInfo::add_elements(), libMesh::TopologyMap::add_node(), libMesh::ReplicatedMesh::add_node(), libMesh::DistributedMesh::add_node(), libMesh::DistributedMesh::add_point(), libMesh::UnstructuredMesh::all_first_order(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::Node::build(), libMesh::ParmetisPartitioner::build_graph(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::FEGenericBase< OutputType >::compute_periodic_constraints(), libMesh::FEMap::compute_single_point_map(), libMesh::MeshTools::correct_node_proc_ids(), libMesh::MeshRefinement::create_parent_error_vector(), libMesh::UnstructuredMesh::create_submesh(), libMesh::ReplicatedMesh::delete_elem(), libMesh::DistributedMesh::delete_elem(), libMesh::ReplicatedMesh::delete_node(), libMesh::DistributedMesh::delete_node(), libMesh::MeshBase::detect_interior_parents(), libMesh::UNVIO::elements_out(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::AdjointRefinementEstimator::estimate_error(), libMesh::ExactErrorEstimator::estimate_error(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshTools::find_nodal_neighbors(), libMesh::MeshRefinement::flag_elements_by_elem_fraction(), libMesh::MeshRefinement::flag_elements_by_error_fraction(), libMesh::MeshRefinement::flag_elements_by_error_tolerance(), libMesh::MeshTools::Modification::flatten(), libMesh::Node::get_info(), libMesh::Elem::get_info(), libMesh::DofMap::get_local_constraints(), libMesh::ParmetisPartitioner::initialize(), libMesh::TreeNode< N >::insert(), libMesh::ReplicatedMesh::insert_elem(), libMesh::DistributedMesh::insert_elem(), libMesh::ReplicatedMesh::insert_node(), libMesh::FE< Dim, T >::inverse_map(), libMesh::MeshTools::libmesh_assert_valid_amr_elem_ids(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::Tri3Subdivision::local_node_number(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::Elem::node_id(), libMesh::VTKIO::nodes_to_vtk(), libMesh::CompareElemIdsByLevel::operator()(), libMesh::WeightedPatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::PatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::BoundaryInfo::operator=(), libMesh::Parallel::Packing< const Node * >::pack(), libMesh::Parallel::Packing< const Elem * >::pack(), libMesh::MetisPartitioner::partition_range(), libMesh::SFCPartitioner::partition_range(), libMesh::DofObject::print_dof_info(), libMesh::DistributedMesh::query_elem_ptr(), libMesh::DistributedMesh::query_node_ptr(), libMesh::Nemesis_IO::read(), libMesh::ExodusII_IO::read(), libMesh::AbaqusIO::read_elements(), libMesh::DistributedMesh::renumber_elem(), libMesh::DistributedMesh::renumber_node(), libMesh::DistributedMesh::renumber_nodes_and_elements(), libMesh::DofMap::scatter_constraints(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::Partitioner::set_parent_processor_ids(), libMesh::MeshTools::Modification::smooth(), libMesh::ReplicatedMesh::stitching_helper(), libMesh::BoundaryInfo::sync(), libMesh::Parallel::sync_dofobject_data_by_id(), libMesh::Parallel::sync_element_data_by_parent_id(), libMesh::Parallel::sync_node_data_by_element_id(), libMesh::TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole(), libMesh::MeshRefinement::uniformly_coarsen(), libMesh::Parallel::Packing< Elem * >::unpack(), libMesh::CheckpointIO::write_connectivity(), libMesh::ExodusII_IO_Helper::write_nodal_coordinates(), libMesh::CheckpointIO::write_nodes(), libMesh::CheckpointIO::write_remote_elem(), and libMesh::XdrIO::write_serialized_connectivity().

633 {
634  libmesh_assert (this->valid_id());
635  return _id;
636 }
bool valid_id() const
Definition: dof_object.h:674
dof_id_type _id
Definition: dof_object.h:419
void libMesh::ReferenceCounter::increment_constructor_count ( const std::string &  name)
inlineprotectedinherited

Increments the construction counter. Should be called in the constructor of any derived class that will be reference counted.

Definition at line 185 of file reference_counter.h.

References libMesh::ReferenceCounter::_counts, libMesh::Quality::name(), and libMesh::Threads::spin_mtx.

Referenced by libMesh::ReferenceCounter::n_objects(), and libMesh::ReferenceCountedObject< RBParametrized >::ReferenceCountedObject().

186 {
187  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
188  std::pair<unsigned int, unsigned int> & p = _counts[name];
189 
190  p.first++;
191 }
std::string name(const ElemQuality q)
Definition: elem_quality.C:39
spin_mutex spin_mtx
Definition: threads.C:29
void libMesh::ReferenceCounter::increment_constructor_count ( const std::string &  name)
inlineprotectedinherited

Increments the construction counter. Should be called in the constructor of any derived class that will be reference counted.

Definition at line 185 of file reference_counter.h.

References libMesh::ReferenceCounter::_counts, libMesh::Quality::name(), and libMesh::Threads::spin_mtx.

Referenced by libMesh::ReferenceCounter::n_objects(), and libMesh::ReferenceCountedObject< RBParametrized >::ReferenceCountedObject().

186 {
187  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
188  std::pair<unsigned int, unsigned int> & p = _counts[name];
189 
190  p.first++;
191 }
std::string name(const ElemQuality q)
Definition: elem_quality.C:39
spin_mutex spin_mtx
Definition: threads.C:29
void libMesh::ReferenceCounter::increment_destructor_count ( const std::string &  name)
inlineprotectedinherited

Increments the destruction counter. Should be called in the destructor of any derived class that will be reference counted.

Definition at line 198 of file reference_counter.h.

References libMesh::ReferenceCounter::_counts, libMesh::Quality::name(), and libMesh::Threads::spin_mtx.

Referenced by libMesh::ReferenceCounter::n_objects(), and libMesh::ReferenceCountedObject< RBParametrized >::~ReferenceCountedObject().

199 {
200  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
201  std::pair<unsigned int, unsigned int> & p = _counts[name];
202 
203  p.second++;
204 }
std::string name(const ElemQuality q)
Definition: elem_quality.C:39
spin_mutex spin_mtx
Definition: threads.C:29
void libMesh::ReferenceCounter::increment_destructor_count ( const std::string &  name)
inlineprotectedinherited

Increments the destruction counter. Should be called in the destructor of any derived class that will be reference counted.

Definition at line 198 of file reference_counter.h.

References libMesh::ReferenceCounter::_counts, libMesh::Quality::name(), and libMesh::Threads::spin_mtx.

Referenced by libMesh::ReferenceCounter::n_objects(), and libMesh::ReferenceCountedObject< RBParametrized >::~ReferenceCountedObject().

199 {
200  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
201  std::pair<unsigned int, unsigned int> & p = _counts[name];
202 
203  p.second++;
204 }
std::string name(const ElemQuality q)
Definition: elem_quality.C:39
spin_mutex spin_mtx
Definition: threads.C:29
virtual bool libMesh::InfQuad::infinite ( ) const
inlinevirtual
Returns
true. All classes derived from InfQuad are infinite elements.

Implements libMesh::Elem.

Definition at line 185 of file face_inf_quad.h.

185 { return true; }
const Elem * libMesh::Elem::interior_parent ( ) const
inherited
Returns
The higher-dimensional Elem for which this Elem is a face.

In some cases it is desirable to extract the boundary (or a subset thereof) of a D-dimensional mesh as a (D-1)-dimensional manifold. In this case we may want to know the 'parent' element from which the manifold elements were extracted. We can easily do that for the level-0 manifold elements by storing the D-dimensional parent. This method provides access to that element.

This method is not safe to call if this->dim() == LIBMESH_DIM; in such cases no data storage for an interior parent pointer has been allocated.

Definition at line 843 of file elem.C.

References libMesh::Elem::_elemlinks, libMesh::Elem::dim(), libMesh::Elem::level(), libMesh::Elem::n_sides(), and libMesh::remote_elem.

Referenced by libMesh::MeshBase::detect_interior_parents(), libMesh::Elem::find_interior_neighbors(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::BoundaryInfo::get_side_and_node_maps(), libMesh::Elem::is_linear(), libMesh::MeshTools::libmesh_assert_valid_amr_interior_parents(), libMesh::GhostPointNeighbors::operator()(), libMesh::Parallel::Packing< const Elem * >::pack(), libMesh::MetisPartitioner::partition_range(), and libMesh::Parallel::Packing< Elem * >::unpack().

844 {
845  // interior parents make no sense for full-dimensional elements.
846  libmesh_assert_less (this->dim(), LIBMESH_DIM);
847 
848  // they USED TO BE only good for level-0 elements, but we now
849  // support keeping interior_parent() valid on refined boundary
850  // elements.
851  // if (this->level() != 0)
852  // return this->parent()->interior_parent();
853 
854  // We store the interior_parent pointer after both the parent
855  // neighbor and neighbor pointers
856  Elem * interior_p = _elemlinks[1+this->n_sides()];
857 
858  // If we have an interior_parent, we USED TO assume it was a
859  // one-higher-dimensional interior element, but we now allow e.g.
860  // edge elements to have a 3D interior_parent with no
861  // intermediate 2D element.
862  // libmesh_assert (!interior_p ||
863  // interior_p->dim() == (this->dim()+1));
864  libmesh_assert (!interior_p ||
865  (interior_p == remote_elem) ||
866  (interior_p->dim() > this->dim()));
867 
868  // We require consistency between AMR of interior and of boundary
869  // elements
870  if (interior_p && (interior_p != remote_elem))
871  libmesh_assert_less_equal (interior_p->level(), this->level());
872 
873  return interior_p;
874 }
Elem ** _elemlinks
Definition: elem.h:1622
virtual unsigned int n_sides() const =0
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1732
virtual unsigned int dim() const =0
unsigned int level() const
Definition: elem.h:2389
const RemoteElem * remote_elem
Definition: remote_elem.C:57
Elem * libMesh::Elem::interior_parent ( )
inherited

Definition at line 878 of file elem.C.

References libMesh::Elem::_elemlinks, libMesh::Elem::dim(), libMesh::Elem::level(), libMesh::Elem::n_sides(), and libMesh::remote_elem.

879 {
880  // See the const version for comments
881  libmesh_assert_less (this->dim(), LIBMESH_DIM);
882  Elem * interior_p = _elemlinks[1+this->n_sides()];
883 
884  libmesh_assert (!interior_p ||
885  (interior_p == remote_elem) ||
886  (interior_p->dim() > this->dim()));
887  if (interior_p && (interior_p != remote_elem))
888  libmesh_assert_less_equal (interior_p->level(), this->level());
889 
890  return interior_p;
891 }
Elem ** _elemlinks
Definition: elem.h:1622
virtual unsigned int n_sides() const =0
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1732
virtual unsigned int dim() const =0
unsigned int level() const
Definition: elem.h:2389
const RemoteElem * remote_elem
Definition: remote_elem.C:57
void libMesh::DofObject::invalidate ( )
inlineinherited

Invalidates all the indices for this DofObject

Definition at line 588 of file dof_object.h.

References libMesh::DofObject::invalidate_dofs(), libMesh::DofObject::invalidate_id(), and libMesh::DofObject::invalidate_processor_id().

Referenced by libMesh::DofObject::DofObject().

589 {
590  this->invalidate_dofs ();
591  this->invalidate_id ();
592  this->invalidate_processor_id ();
593 }
void invalidate_processor_id()
Definition: dof_object.h:580
void invalidate_dofs(const unsigned int sys_num=libMesh::invalid_uint)
Definition: dof_object.h:552
void libMesh::DofObject::invalidate_dofs ( const unsigned int  sys_num = libMesh::invalid_uint)
inlineinherited

Sets all degree of freedom numbers to invalid_id

Definition at line 552 of file dof_object.h.

References libMesh::DofObject::invalid_id, libMesh::DofObject::n_comp_group(), libMesh::DofObject::n_systems(), libMesh::DofObject::n_var_groups(), and libMesh::DofObject::set_vg_dof_base().

Referenced by libMesh::DofObject::invalidate().

553 {
554  // If the user does not specify the system number...
555  if (sys_num >= this->n_systems())
556  {
557  for (unsigned int s=0; s<this->n_systems(); s++)
558  for (unsigned int vg=0; vg<this->n_var_groups(s); vg++)
559  if (this->n_comp_group(s,vg))
560  this->set_vg_dof_base(s,vg,invalid_id);
561  }
562  // ...otherwise invalidate the dofs for all systems
563  else
564  for (unsigned int vg=0; vg<this->n_var_groups(sys_num); vg++)
565  if (this->n_comp_group(sys_num,vg))
566  this->set_vg_dof_base(sys_num,vg,invalid_id);
567 }
unsigned int n_comp_group(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:793
void set_vg_dof_base(const unsigned int s, const unsigned int vg, const dof_id_type db)
Definition: dof_object.h:902
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:735
static const dof_id_type invalid_id
Definition: dof_object.h:324
unsigned int n_systems() const
Definition: dof_object.h:726
void libMesh::DofObject::invalidate_id ( )
inlineinherited

Sets the id to invalid_id

Definition at line 572 of file dof_object.h.

References libMesh::DofObject::invalid_id, and libMesh::DofObject::set_id().

Referenced by libMesh::DofObject::invalidate().

573 {
574  this->set_id (invalid_id);
575 }
dof_id_type & set_id()
Definition: dof_object.h:641
static const dof_id_type invalid_id
Definition: dof_object.h:324
void libMesh::DofObject::invalidate_processor_id ( )
inlineinherited

Sets the processor id to invalid_processor_id

Definition at line 580 of file dof_object.h.

References libMesh::DofObject::invalid_processor_id, and libMesh::DofObject::processor_id().

Referenced by libMesh::DofObject::invalidate(), and libMesh::Partitioner::set_parent_processor_ids().

581 {
583 }
static const processor_id_type invalid_processor_id
Definition: dof_object.h:335
processor_id_type processor_id() const
Definition: dof_object.h:694
bool libMesh::Elem::is_ancestor_of ( const Elem descendant) const
inlineinherited
Returns
true if descendant is a child of this, or a child of a child of this, etc., false otherwise or if AMR is disabled.

Definition at line 2326 of file elem.h.

References libMesh::Elem::parent().

Referenced by libMesh::Elem::family_tree_by_subneighbor(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::Elem::is_linear(), libMesh::Elem::make_links_to_me_local(), and libMesh::Elem::total_family_tree_by_subneighbor().

2331 {
2332 #ifdef LIBMESH_ENABLE_AMR
2333  const Elem * e = descendant;
2334  while (e)
2335  {
2336  if (this == e)
2337  return true;
2338  e = e->parent();
2339  }
2340 #endif
2341  return false;
2342 }
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1732
bool libMesh::Elem::is_child_on_edge ( const unsigned int  c,
const unsigned int  e 
) const
virtualinherited
Returns
true if the specified child is on the specified edge.

Definition at line 1554 of file elem.C.

References libMesh::Elem::build_edge_ptr(), libMesh::Elem::n_children(), and libMesh::Elem::n_edges().

Referenced by libMesh::FEGenericBase< OutputType >::coarsened_dof_values(), libMesh::BoundaryInfo::edge_boundary_ids(), and libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::operator()().

1556 {
1557  libmesh_assert_less (c, this->n_children());
1558  libmesh_assert_less (e, this->n_edges());
1559 
1560  std::unique_ptr<const Elem> my_edge = this->build_edge_ptr(e);
1561  std::unique_ptr<const Elem> child_edge = this->build_edge_ptr(e);
1562 
1563  // We're assuming that an overlapping child edge has the same
1564  // number and orientation as its parent
1565  return (child_edge->node_id(0) == my_edge->node_id(0) ||
1566  child_edge->node_id(1) == my_edge->node_id(1));
1567 }
virtual unsigned int n_edges() const =0
virtual unsigned int n_children() const =0
virtual std::unique_ptr< Elem > build_edge_ptr(const unsigned int i)=0
bool libMesh::InfQuad::is_child_on_side ( const unsigned int  c,
const unsigned int  s 
) const
virtual
Returns
true if the specified child is on the specified side.

Implements libMesh::Elem.

Definition at line 111 of file face_inf_quad.C.

References n_children(), and n_sides().

Referenced by is_mid_infinite_edge_node().

113 {
114  libmesh_assert_less (c, this->n_children());
115  libmesh_assert_less (s, this->n_sides());
116 
117  return (s == 0 || s == c+1);
118 }
virtual unsigned int n_children() const libmesh_override
virtual unsigned int n_sides() const libmesh_override
Definition: face_inf_quad.h:96
virtual bool libMesh::InfQuad::is_edge_on_side ( const unsigned int  e,
const unsigned int  s 
) const
inlinevirtual

is_edge_on_side is trivial in 2D.

Implements libMesh::Elem.

Definition at line 164 of file face_inf_quad.h.

References qual_bounds(), quality(), and libMesh::Real.

166  { return (e == s); }
virtual bool libMesh::InfQuad::is_mid_infinite_edge_node ( const unsigned int  i) const
inlinevirtual
Returns
true if the specified (local) node number is a "mid-edge" node on an infinite element edge.

Reimplemented from libMesh::Elem.

Definition at line 123 of file face_inf_quad.h.

References is_child_on_side(), libMesh::Elem::key(), libMesh::Elem::side(), side_ptr(), and which_node_am_i().

124  { return (i > 2 && i < 4); }
virtual bool libMesh::Elem::is_node_on_side ( const unsigned int  n,
const unsigned int  s 
) const
pure virtualinherited
virtual bool libMesh::Elem::is_remote ( ) const
inlinevirtualinherited
Returns
true if this element is remote, false otherwise.

A remote element (see RemoteElem) is a syntactic convenience – it is a placeholder for an element which exists on some other processor. Local elements are required to have valid neighbors, and these ghost elements may have remote neighbors for data structure consistency. The use of remote elements helps ensure that any element we may access has a NULL neighbor only if it lies on the physical boundary of the domain.

Reimplemented in libMesh::RemoteElem.

Definition at line 531 of file elem.h.

References libMesh::Elem::connectivity(), libMesh::Elem::dim(), libMesh::out, libMesh::Elem::type(), and libMesh::Elem::write_connectivity().

Referenced by libMesh::Elem::active_family_tree_by_side(), libMesh::Elem::family_tree_by_side(), and libMesh::Elem::make_links_to_me_local().

532  { return false; }
bool libMesh::Elem::is_semilocal ( const processor_id_type  my_pid) const
inherited
Returns
true if this element is semilocal to the calling processor, which must specify its rank.

Definition at line 444 of file elem.C.

References end, libMesh::Elem::find_point_neighbors(), and libMesh::DofObject::processor_id().

Referenced by libMesh::Patch::add_semilocal_face_neighbors(), and libMesh::Patch::add_semilocal_point_neighbors().

445 {
446  std::set<const Elem *> point_neighbors;
447 
448  this->find_point_neighbors(point_neighbors);
449 
450  std::set<const Elem *>::const_iterator it = point_neighbors.begin();
451  const std::set<const Elem *>::const_iterator end = point_neighbors.end();
452 
453  for (; it != end; ++it)
454  {
455  const Elem * elem = *it;
456  if (elem->processor_id() == my_pid)
457  return true;
458  }
459 
460  return false;
461 }
IterBase * end
void find_point_neighbors(const Point &p, std::set< const Elem * > &neighbor_set) const
Definition: elem.C:497
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1732
virtual unsigned int libMesh::Elem::is_vertex_on_child ( unsigned  int,
unsigned int  n 
) const
inlinevirtualinherited
bool libMesh::Elem::is_vertex_on_parent ( unsigned int  c,
unsigned int  n 
) const
virtualinherited
Returns
true if this element has a vertex at the specified (child-local) node number n of the specified child c.

Definition at line 2908 of file elem.C.

References libMesh::Elem::child_ptr(), libMesh::libmesh_ignore(), libMesh::Elem::n_vertices(), and libMesh::Elem::node_ptr().

Referenced by libMesh::Elem::is_vertex_on_child(), and libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::operator()().

2910 {
2911 #ifdef LIBMESH_ENABLE_AMR
2912 
2913  unsigned int my_n_vertices = this->n_vertices();
2914  for (unsigned int n_parent = 0; n_parent != my_n_vertices;
2915  ++n_parent)
2916  if (this->node_ptr(n_parent) == this->child_ptr(c)->node_ptr(n))
2917  return true;
2918  return false;
2919 
2920 #else
2921 
2922  // No AMR?
2923  libmesh_ignore(c);
2924  libmesh_ignore(n);
2925  libmesh_error_msg("ERROR: AMR disabled, how did we get here?");
2926  return true;
2927 
2928 #endif
2929 }
const Node * node_ptr(const unsigned int i) const
Definition: elem.h:1875
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2446
void libmesh_ignore(const T &)
virtual unsigned int n_vertices() const =0
dof_id_type libMesh::InfQuad::key ( const unsigned int  s) const
virtual
Returns
An id associated with the s side of this element. The id is not necessarily unique, but should be close. This is particularly useful in the MeshBase::find_neighbors() routine.

Implements libMesh::Elem.

Reimplemented in libMesh::InfQuad6.

Definition at line 53 of file face_inf_quad.C.

References libMesh::Elem::compute_key(), n_sides(), libMesh::Elem::node_id(), and libMesh::InfQuad4::side_nodes_map.

54 {
55  libmesh_assert_less (s, this->n_sides());
56 
57  // The order of the node ids does not matter, they are sorted by the
58  // compute_key() function.
59  return this->compute_key(this->node_id(InfQuad4::side_nodes_map[s][0]),
60  this->node_id(InfQuad4::side_nodes_map[s][1]));
61 }
static const unsigned int side_nodes_map[3][2]
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:1832
static dof_id_type compute_key(dof_id_type n0)
Definition: elem.h:2622
virtual unsigned int n_sides() const libmesh_override
Definition: face_inf_quad.h:96
dof_id_type libMesh::Elem::key ( ) const
virtualinherited
Returns
An id associated with the global node ids of this element. The id is not necessarily unique, but should be close. Uses the same hash as the key(s) function, so for example if "tri3" is side 0 of "tet4", then tri3->key()==tet4->key(0).

Reimplemented in libMesh::Tet4, libMesh::Edge3, libMesh::Edge4, libMesh::Edge2, libMesh::Quad, libMesh::Quad9, and libMesh::Tri.

Definition at line 395 of file elem.C.

References libMesh::Utility::hashword(), libMesh::Elem::n_nodes(), and libMesh::Elem::node_id().

Referenced by libMesh::InfHex18::default_order(), libMesh::InfQuad6::default_order(), libMesh::Tri6::default_order(), libMesh::Quad8::default_order(), libMesh::Quad9::default_order(), libMesh::Hex27::default_order(), libMesh::Prism18::default_order(), libMesh::Pyramid14::default_order(), libMesh::Edge2::infinite(), libMesh::Edge4::infinite(), libMesh::Edge3::infinite(), libMesh::Edge::is_edge_on_side(), libMesh::InfPrism::is_mid_infinite_edge_node(), is_mid_infinite_edge_node(), libMesh::InfQuad6::key(), libMesh::Prism18::key(), libMesh::Pyramid14::key(), libMesh::InfHex18::key(), libMesh::Hex::n_children(), libMesh::Tet::n_children(), libMesh::Prism::n_children(), libMesh::NodeElem::n_children(), libMesh::Pyramid::n_children(), libMesh::Quad::n_children(), libMesh::Tri::n_children(), libMesh::InfHex::n_children(), and libMesh::RemoteElem::set_node().

396 {
397  const unsigned short n_n = this->n_nodes();
398 
399  std::vector<dof_id_type> node_ids(n_n);
400 
401  for (unsigned short n=0; n != n_n; ++n)
402  node_ids[n] = this->node_id(n);
403 
404  // Always sort, so that different local node numberings hash to the
405  // same value.
406  std::sort (node_ids.begin(), node_ids.end());
407 
408  return Utility::hashword(node_ids);
409 }
virtual unsigned int n_nodes() const =0
uint32_t hashword(const uint32_t *k, size_t length, uint32_t initval=0)
Definition: hashword.h:153
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:1832
Real libMesh::Elem::length ( const unsigned int  n1,
const unsigned int  n2 
) const
inherited
Returns
The distance between nodes n1 and n2.

Useful for computing the lengths of the sides of elements.

Definition at line 384 of file elem.C.

References libMesh::Elem::n_vertices(), and libMesh::Elem::point().

Referenced by libMesh::Elem::is_linear(), libMesh::Hex::quality(), libMesh::InfHex::quality(), and libMesh::Quad::quality().

386 {
387  libmesh_assert_less ( n1, this->n_vertices() );
388  libmesh_assert_less ( n2, this->n_vertices() );
389 
390  return (this->point(n1) - this->point(n2)).norm();
391 }
const Point & point(const unsigned int i) const
Definition: elem.h:1810
virtual unsigned int n_vertices() const =0
unsigned int libMesh::Elem::level ( ) const
inlineinherited
Returns
The refinement level of the current element.

If the element's parent is NULL then by convention it is at level 0, otherwise it is simply at one level greater than its parent.

Definition at line 2389 of file elem.h.

References libMesh::Elem::dim(), libMesh::Elem::level(), libmesh_nullptr, and libMesh::Elem::parent().

Referenced by libMesh::MeshRefinement::_coarsen_elements(), libMesh::Elem::active_family_tree_by_neighbor(), libMesh::Elem::active_family_tree_by_topological_neighbor(), libMesh::BoundaryInfo::add_edge(), libMesh::BoundaryInfo::add_shellface(), libMesh::BoundaryInfo::add_side(), libMesh::UnstructuredMesh::all_second_order(), libMesh::BoundaryInfo::boundary_ids(), libMesh::FEAbstract::compute_node_constraints(), libMesh::FEGenericBase< OutputType >::compute_periodic_constraints(), libMesh::FEAbstract::compute_periodic_node_constraints(), libMesh::FEGenericBase< OutputType >::compute_proj_constraints(), libMesh::BoundaryInfo::edge_boundary_ids(), libMesh::MeshRefinement::enforce_mismatch_limit_prior_to_refinement(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::MeshTools::find_hanging_nodes_and_parents(), libMesh::Elem::find_interior_neighbors(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshRefinement::flag_elements_by_nelem_target(), libMesh::Elem::get_info(), libMesh::Elem::interior_parent(), libMesh::Elem::is_linear(), libMesh::Elem::level(), libMesh::MeshTools::libmesh_assert_valid_amr_interior_parents(), libMesh::MeshRefinement::limit_overrefined_boundary(), libMesh::MeshRefinement::limit_underrefined_boundary(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::Elem::make_links_to_me_local(), libMesh::Elem::make_links_to_me_remote(), libMesh::MeshRefinement::make_refinement_compatible(), libMesh::Elem::nullify_neighbors(), libMesh::CompareElemIdsByLevel::operator()(), libMesh::Parallel::Packing< const Elem * >::pack(), libMesh::Parallel::Packing< const Elem * >::packable_size(), libMesh::BoundaryInfo::remove_edge(), libMesh::Elem::remove_links_to_me(), libMesh::BoundaryInfo::remove_shellface(), libMesh::BoundaryInfo::remove_side(), libMesh::BoundaryInfo::shellface_boundary_ids(), libMesh::BoundaryInfo::side_with_boundary_id(), libMesh::ReplicatedMesh::stitching_helper(), libMesh::MeshRefinement::test_level_one(), libMesh::Elem::top_parent(), libMesh::Elem::topological_neighbor(), libMesh::Parallel::Packing< Elem * >::unpack(), and libMesh::Elem::which_neighbor_am_i().

2390 {
2391 #ifdef LIBMESH_ENABLE_AMR
2392 
2393  // if I don't have a parent I was
2394  // created directly from file
2395  // or by the user, so I am a
2396  // level-0 element
2397  if (this->parent() == libmesh_nullptr)
2398  return 0;
2399 
2400  // if the parent and this element are of different
2401  // dimensionality we are at the same level as
2402  // the parent (e.g. we are the 2D side of a
2403  // 3D element)
2404  if (this->dim() != this->parent()->dim())
2405  return this->parent()->level();
2406 
2407  // otherwise we are at a level one
2408  // higher than our parent
2409  return (this->parent()->level() + 1);
2410 
2411 #else
2412 
2413  // Without AMR all elements are
2414  // at level 0.
2415  return 0;
2416 
2417 #endif
2418 }
const Elem * parent() const
Definition: elem.h:2347
const class libmesh_nullptr_t libmesh_nullptr
virtual unsigned int dim() const =0
unsigned int level() const
Definition: elem.h:2389
void libMesh::Elem::libmesh_assert_valid_neighbors ( ) const
inherited

Checks for consistent neighbor links on this element.

Definition at line 1029 of file elem.C.

References libMesh::Elem::dim(), libMesh::Elem::n_neighbors(), libMesh::Elem::neighbor_ptr(), libMesh::Elem::parent(), libMesh::remote_elem, libMesh::Elem::side_index_range(), libMesh::Elem::subactive(), and libMesh::Elem::which_neighbor_am_i().

1030 {
1031  for (auto n : this->side_index_range())
1032  {
1033  const Elem * neigh = this->neighbor_ptr(n);
1034 
1035  // Any element might have a remote neighbor; checking
1036  // to make sure that's not inaccurate is tough.
1037  if (neigh == remote_elem)
1038  continue;
1039 
1040  if (neigh)
1041  {
1042  // Only subactive elements have subactive neighbors
1043  libmesh_assert (this->subactive() || !neigh->subactive());
1044 
1045  const Elem * elem = this;
1046 
1047  // If we're subactive but our neighbor isn't, its
1048  // return neighbor link will be to our first active
1049  // ancestor OR to our inactive ancestor of the same
1050  // level as neigh,
1051  if (this->subactive() && !neigh->subactive())
1052  {
1053  for (elem = this; !elem->active();
1054  elem = elem->parent())
1055  libmesh_assert(elem);
1056  }
1057  else
1058  {
1059  unsigned int rev = neigh->which_neighbor_am_i(elem);
1060  libmesh_assert_less (rev, neigh->n_neighbors());
1061 
1062  if (this->subactive() && !neigh->subactive())
1063  {
1064  while (neigh->neighbor_ptr(rev) != elem)
1065  {
1066  libmesh_assert(elem->parent());
1067  elem = elem->parent();
1068  }
1069  }
1070  else
1071  {
1072  const Elem * nn = neigh->neighbor_ptr(rev);
1073  libmesh_assert(nn);
1074 
1075  for (; elem != nn; elem = elem->parent())
1076  libmesh_assert(elem);
1077  }
1078  }
1079  }
1080  // If we don't have a neighbor and we're not subactive, our
1081  // ancestors shouldn't have any neighbors in this same
1082  // direction.
1083  else if (!this->subactive())
1084  {
1085  const Elem * my_parent = this->parent();
1086  if (my_parent &&
1087  // A parent with a different dimension isn't really one of
1088  // our ancestors, it means we're on a boundary mesh and this
1089  // is an interior mesh element for which we're on a side.
1090  // Nothing to test for in that case.
1091  (my_parent->dim() == this->dim()))
1092  libmesh_assert (!my_parent->neighbor_ptr(n));
1093  }
1094  }
1095 }
bool subactive() const
Definition: elem.h:2276
IntRange< unsigned short > side_index_range() const
Definition: elem.h:2084
const Elem * parent() const
Definition: elem.h:2347
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:1968
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1732
virtual unsigned int dim() const =0
const RemoteElem * remote_elem
Definition: remote_elem.C:57
void libMesh::Elem::libmesh_assert_valid_node_pointers ( ) const
inherited

Checks for a valid id and pointers to nodes with valid ids on this element.

Definition at line 1017 of file elem.C.

References libMesh::Elem::n_nodes(), libMesh::Elem::node_ptr(), and libMesh::DofObject::valid_id().

1018 {
1019  libmesh_assert(this->valid_id());
1020  for (unsigned int n=0; n != this->n_nodes(); ++n)
1021  {
1022  libmesh_assert(this->node_ptr(n));
1023  libmesh_assert(this->node_ptr(n)->valid_id());
1024  }
1025 }
bool valid_id() const
Definition: dof_object.h:674
virtual unsigned int n_nodes() const =0
const Node * node_ptr(const unsigned int i) const
Definition: elem.h:1875
unsigned int libMesh::Elem::local_node ( const dof_id_type  i) const
inlineinherited
Returns
The local id number of global Node id i, or invalid_uint if Node id i is not local.

Definition at line 1855 of file elem.h.

References libMesh::invalid_uint, libMesh::Elem::n_nodes(), and libMesh::Elem::node_id().

Referenced by libMesh::MeshTools::find_nodal_neighbors(), and libMesh::ReplicatedMesh::stitching_helper().

1856 {
1857  for (unsigned int n=0; n != this->n_nodes(); ++n)
1858  if (this->node_id(n) == i)
1859  return n;
1860 
1861  return libMesh::invalid_uint;
1862 }
const unsigned int invalid_uint
Definition: libmesh.h:184
virtual unsigned int n_nodes() const =0
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:1832
BoundingBox libMesh::Elem::loose_bounding_box ( ) const
virtualinherited
Returns
A bounding box (not necessarily the minimal bounding box) containing the geometric element.

The base class implementation determines a bounding box for the element nodes, which should be sufficient for first order finite elements. Higher order geometric elements will need to override with an implementation which takes curved elements into account.

Reimplemented in libMesh::Quad9, libMesh::Quad8, libMesh::Tri6, libMesh::Edge3, libMesh::Edge4, and libMesh::Cell.

Definition at line 2886 of file elem.C.

References libMesh::Elem::n_nodes(), and libMesh::Elem::point().

Referenced by libMesh::TreeNode< N >::insert(), and libMesh::Elem::is_vertex_on_child().

2887 {
2888  Point pmin = this->point(0);
2889  Point pmax = pmin;
2890 
2891  unsigned int n_points = this->n_nodes();
2892  for (unsigned int p=0; p != n_points; ++p)
2893  for (unsigned d=0; d<LIBMESH_DIM; ++d)
2894  {
2895  const Point & pt = this->point(p);
2896  if (pmin(d) > pt(d))
2897  pmin(d) = pt(d);
2898 
2899  if (pmax(d) < pt(d))
2900  pmax(d) = pt(d);
2901  }
2902 
2903  return BoundingBox(pmin, pmax);
2904 }
virtual unsigned int n_nodes() const =0
const Point & point(const unsigned int i) const
Definition: elem.h:1810
void libMesh::Elem::make_links_to_me_local ( unsigned int  n)
inherited

Resets the appropriate neighbor pointers of our nth neighbor (and its descendants, if appropriate) to point to this Elem instead of to the global remote_elem. Used by the library when a formerly remote element is being added to the local processor.

Definition at line 1101 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::family_tree_by_side(), libMesh::Elem::has_children(), libMesh::Elem::is_ancestor_of(), libMesh::Elem::is_remote(), libMesh::Elem::JUST_REFINED, libMesh::Elem::level(), libmesh_nullptr, libMesh::Elem::n_sides(), libMesh::Elem::neighbor_ptr(), libMesh::Elem::parent(), libMesh::Elem::refinement_flag(), libMesh::remote_elem, libMesh::Elem::set_neighbor(), libMesh::Elem::side_ptr(), and libMesh::Elem::subactive().

Referenced by libMesh::Parallel::Packing< Elem * >::unpack().

1102 {
1103  Elem * neigh = this->neighbor_ptr(n);
1104 
1105  // Don't bother calling this function unless it's necessary
1106  libmesh_assert(neigh);
1107  libmesh_assert(!neigh->is_remote());
1108 
1109  // We never have neighbors more refined than us
1110  libmesh_assert_less_equal (neigh->level(), this->level());
1111 
1112  // We never have subactive neighbors of non subactive elements
1113  libmesh_assert(!neigh->subactive() || this->subactive());
1114 
1115  // If we have a neighbor less refined than us then it must not
1116  // have any more refined descendants we could have pointed to
1117  // instead.
1118  libmesh_assert((neigh->level() == this->level()) ||
1119  (neigh->active() && !this->subactive()) ||
1120  (!neigh->has_children() && this->subactive()));
1121 
1122  // If neigh is at our level, then its family might have
1123  // remote_elem neighbor links which need to point to us
1124  // instead, but if not, then we're done.
1125  if (neigh->level() != this->level())
1126  return;
1127 
1128  // What side of neigh are we on? We can't use the usual Elem
1129  // method because we're in the middle of restoring topology
1130  const std::unique_ptr<Elem> my_side = this->side_ptr(n);
1131  unsigned int nn = 0;
1132  for (; nn != neigh->n_sides(); ++nn)
1133  {
1134  const std::unique_ptr<Elem> neigh_side = neigh->side_ptr(nn);
1135  if (*my_side == *neigh_side)
1136  break;
1137  }
1138 
1139  // we had better be on *some* side of neigh
1140  libmesh_assert_less (nn, neigh->n_sides());
1141 
1142  // Find any elements that ought to point to elem
1143  std::vector<const Elem *> neigh_family;
1144 #ifdef LIBMESH_ENABLE_AMR
1145  if (this->active())
1146  neigh->family_tree_by_side(neigh_family, nn);
1147  else if (neigh->subactive())
1148 #endif
1149  neigh_family.push_back(neigh);
1150 
1151  // And point them to elem
1152  for (std::size_t i = 0; i != neigh_family.size(); ++i)
1153  {
1154  Elem * neigh_family_member = const_cast<Elem *>(neigh_family[i]);
1155 
1156  // Only subactive elements point to other subactive elements
1157  if (this->subactive() && !neigh_family_member->subactive())
1158  continue;
1159 
1160  // Ideally, the neighbor link ought to either be correct
1161  // already or ought to be to remote_elem.
1162  //
1163  // However, if we're redistributing a newly created elem,
1164  // after an AMR step but before find_neighbors has fixed up
1165  // neighbor links, we might have an out of date neighbor
1166  // link to elem's parent instead.
1167 #ifdef LIBMESH_ENABLE_AMR
1168  libmesh_assert((neigh_family_member->neighbor_ptr(nn) &&
1169  (neigh_family_member->neighbor_ptr(nn)->active() ||
1170  neigh_family_member->neighbor_ptr(nn)->is_ancestor_of(this))) ||
1171  (neigh_family_member->neighbor_ptr(nn) == remote_elem) ||
1172  ((this->refinement_flag() == JUST_REFINED) &&
1173  (this->parent() != libmesh_nullptr) &&
1174  (neigh_family_member->neighbor_ptr(nn) == this->parent())));
1175 #else
1176  libmesh_assert((neigh_family_member->neighbor_ptr(nn) == this) ||
1177  (neigh_family_member->neighbor_ptr(nn) == remote_elem));
1178 #endif
1179 
1180  neigh_family_member->set_neighbor(nn, this);
1181  }
1182 }
bool subactive() const
Definition: elem.h:2276
bool active() const
Definition: elem.h:2258
const Elem * parent() const
Definition: elem.h:2347
const class libmesh_nullptr_t libmesh_nullptr
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:1968
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1732
virtual std::unique_ptr< Elem > side_ptr(unsigned int i)=0
unsigned int level() const
Definition: elem.h:2389
RefinementState refinement_flag() const
Definition: elem.h:2506
const RemoteElem * remote_elem
Definition: remote_elem.C:57
void libMesh::Elem::make_links_to_me_remote ( )
inherited

Resets this element's neighbors' appropriate neighbor pointers and its parent's and children's appropriate pointers to point to the global remote_elem instead of this. Used by the library before an element becomes remote on the local processor.

Definition at line 1185 of file elem.C.

References libMesh::Elem::child(), libMesh::Elem::child_ptr(), libMesh::Elem::child_ref_range(), libMesh::Elem::dim(), libMesh::Elem::has_children(), libMesh::Elem::level(), libMesh::Elem::n_neighbors(), libMesh::Elem::neighbor_ptr(), libMesh::Elem::neighbor_ptr_range(), libMesh::Elem::parent(), libMesh::remote_elem, libMesh::Elem::set_child(), libMesh::Elem::set_neighbor(), libMesh::Elem::subactive(), libMesh::Elem::which_child_am_i(), and libMesh::Elem::which_neighbor_am_i().

Referenced by libMesh::MeshCommunication::delete_remote_elements().

1186 {
1187  libmesh_assert_not_equal_to (this, remote_elem);
1188 
1189  // We need to have handled any children first
1190 #if defined(LIBMESH_ENABLE_AMR) && defined(DEBUG)
1191  if (this->has_children())
1192  for (auto & child : this->child_ref_range())
1193  libmesh_assert_equal_to (&child, remote_elem);
1194 #endif
1195 
1196  // Remotify any neighbor links
1197  for (auto neigh : this->neighbor_ptr_range())
1198  {
1199  if (neigh && neigh != remote_elem)
1200  {
1201  // My neighbor should never be more refined than me; my real
1202  // neighbor would have been its parent in that case.
1203  libmesh_assert_greater_equal (this->level(), neigh->level());
1204 
1205  if (this->level() == neigh->level() &&
1206  neigh->has_neighbor(this))
1207  {
1208 #ifdef LIBMESH_ENABLE_AMR
1209  // My neighbor may have descendants which also consider me a
1210  // neighbor
1211  std::vector<const Elem *> family;
1212  neigh->total_family_tree_by_neighbor (family, this);
1213 
1214  // FIXME - There's a lot of ugly const_casts here; we
1215  // may want to make remote_elem non-const and create
1216  // non-const versions of the family_tree methods
1217  for (std::size_t i=0; i != family.size(); ++i)
1218  {
1219  Elem * n = const_cast<Elem *>(family[i]);
1220  libmesh_assert (n);
1221  if (n == remote_elem)
1222  continue;
1223  unsigned int my_s = n->which_neighbor_am_i(this);
1224  libmesh_assert_less (my_s, n->n_neighbors());
1225  libmesh_assert_equal_to (n->neighbor_ptr(my_s), this);
1226  n->set_neighbor(my_s, const_cast<RemoteElem *>(remote_elem));
1227  }
1228 #else
1229  unsigned int my_s = neigh->which_neighbor_am_i(this);
1230  libmesh_assert_less (my_s, neigh->n_neighbors());
1231  libmesh_assert_equal_to (neigh->neighbor_ptr(my_s), this);
1232  neigh->set_neighbor(my_s, const_cast<RemoteElem *>(remote_elem));
1233 #endif
1234  }
1235 #ifdef LIBMESH_ENABLE_AMR
1236  // Even if my neighbor doesn't link back to me, it might
1237  // have subactive descendants which do
1238  else if (neigh->has_children())
1239  {
1240  // If my neighbor at the same level doesn't have me as a
1241  // neighbor, I must be subactive
1242  libmesh_assert(this->level() > neigh->level() ||
1243  this->subactive());
1244 
1245  // My neighbor must have some ancestor of mine as a
1246  // neighbor
1247  Elem * my_ancestor = this->parent();
1248  libmesh_assert(my_ancestor);
1249  while (!neigh->has_neighbor(my_ancestor))
1250  {
1251  my_ancestor = my_ancestor->parent();
1252  libmesh_assert(my_ancestor);
1253  }
1254 
1255  // My neighbor may have descendants which consider me a
1256  // neighbor
1257  std::vector<const Elem *> family;
1258  neigh->total_family_tree_by_subneighbor (family, my_ancestor, this);
1259 
1260  // FIXME - There's a lot of ugly const_casts here; we
1261  // may want to make remote_elem non-const and create
1262  // non-const versions of the family_tree methods
1263  for (std::size_t i=0; i != family.size(); ++i)
1264  {
1265  Elem * n = const_cast<Elem *>(family[i]);
1266  libmesh_assert (n);
1267  if (n == remote_elem)
1268  continue;
1269  unsigned int my_s = n->which_neighbor_am_i(this);
1270  libmesh_assert_less (my_s, n->n_neighbors());
1271  libmesh_assert_equal_to (n->neighbor_ptr(my_s), this);
1272  n->set_neighbor(my_s, const_cast<RemoteElem *>(remote_elem));
1273  }
1274  }
1275 #endif
1276  }
1277  }
1278 
1279 #ifdef LIBMESH_ENABLE_AMR
1280  // Remotify parent's child link
1281  Elem * my_parent = this->parent();
1282  if (my_parent &&
1283  // As long as it's not already remote
1284  my_parent != remote_elem &&
1285  // And it's a real parent, not an interior parent
1286  this->dim() == my_parent->dim())
1287  {
1288  unsigned int me = my_parent->which_child_am_i(this);
1289  libmesh_assert_equal_to (my_parent->child_ptr(me), this);
1290  my_parent->set_child(me, const_cast<RemoteElem *>(remote_elem));
1291  }
1292 #endif
1293 }
bool has_children() const
Definition: elem.h:2296
bool subactive() const
Definition: elem.h:2276
const Elem * parent() const
Definition: elem.h:2347
Elem * child(const unsigned int i) const
Definition: elem.h:2466
SimpleRange< ChildRefIter > child_ref_range()
Definition: elem.h:1700
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1732
virtual unsigned int dim() const =0
unsigned int level() const
Definition: elem.h:2389
SimpleRange< NeighborPtrIter > neighbor_ptr_range()
Definition: elem.h:2856
const RemoteElem * remote_elem
Definition: remote_elem.C:57
virtual Point libMesh::InfQuad::master_point ( const unsigned int  i) const
inlinevirtual
Returns
The Point associated with local Node i, in master element rather than physical coordinates.

Implements libMesh::Elem.

Definition at line 78 of file face_inf_quad.h.

References _master_points, and libMesh::Elem::n_nodes().

79  {
80  libmesh_assert_less(i, this->n_nodes());
81  return Point(_master_points[i][0],
82  _master_points[i][1],
83  _master_points[i][2]);
84  }
static const Real _master_points[6][3]
virtual unsigned int n_nodes() const =0
unsigned int libMesh::Elem::max_descendant_p_level ( ) const
inlineinherited
Returns
The maximum value of the p-refinement levels of an ancestor element's descendants.

Definition at line 2542 of file elem.h.

References libMesh::Elem::_p_level, libMesh::Elem::active(), libMesh::Elem::child_ref_range(), std::max(), libMesh::Elem::p_level(), and libMesh::Elem::subactive().

Referenced by libMesh::FEGenericBase< OutputType >::coarsened_dof_values().

2543 {
2544  // This is undefined for subactive elements,
2545  // which have no active descendants
2546  libmesh_assert (!this->subactive());
2547  if (this->active())
2548  return this->p_level();
2549 
2550  unsigned int max_p_level = _p_level;
2551  for (auto & c : child_ref_range())
2552  max_p_level = std::max(max_p_level,
2553  c.max_descendant_p_level());
2554  return max_p_level;
2555 }
bool subactive() const
Definition: elem.h:2276
bool active() const
Definition: elem.h:2258
unsigned char _p_level
Definition: elem.h:1657
unsigned int p_level() const
Definition: elem.h:2423
long double max(long double a, double b)
SimpleRange< ChildRefIter > child_ref_range()
Definition: elem.h:1700
unsigned int libMesh::Elem::min_new_p_level_by_neighbor ( const Elem neighbor,
unsigned int  current_min 
) const
inherited
Returns
The minimum new p-refinement level (i.e. after refinement and coarsening is done) of elements which are descended from this element and which share a side with the active neighbor.

Definition at line 1935 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::child_ref_range(), libMesh::Elem::COARSEN, libMesh::Elem::has_neighbor(), std::min(), libMesh::Elem::p_level(), libMesh::Elem::p_refinement_flag(), libMesh::Elem::REFINE, libMesh::remote_elem, and libMesh::Elem::subactive().

1937 {
1938  libmesh_assert(!this->subactive());
1939  libmesh_assert(neighbor_in->active());
1940 
1941  // If we're an active element this is simple
1942  if (this->active())
1943  {
1944  unsigned int new_p_level = this->p_level();
1945  if (this->p_refinement_flag() == Elem::REFINE)
1946  new_p_level += 1;
1947  if (this->p_refinement_flag() == Elem::COARSEN)
1948  {
1949  libmesh_assert_greater (new_p_level, 0);
1950  new_p_level -= 1;
1951  }
1952  return std::min(current_min, new_p_level);
1953  }
1954 
1955  libmesh_assert(has_neighbor(neighbor_in));
1956 
1957  unsigned int min_p_level = current_min;
1958 
1959  for (auto & c : this->child_ref_range())
1960  if (&c != remote_elem && c.has_neighbor(neighbor_in))
1961  min_p_level =
1962  c.min_new_p_level_by_neighbor(neighbor_in, min_p_level);
1963 
1964  return min_p_level;
1965 }
bool subactive() const
Definition: elem.h:2276
bool active() const
Definition: elem.h:2258
unsigned int p_level() const
Definition: elem.h:2423
SimpleRange< ChildRefIter > child_ref_range()
Definition: elem.h:1700
RefinementState p_refinement_flag() const
Definition: elem.h:2522
bool has_neighbor(const Elem *elem) const
Definition: elem.h:2011
long double min(long double a, double b)
const RemoteElem * remote_elem
Definition: remote_elem.C:57
unsigned int libMesh::Elem::min_p_level_by_neighbor ( const Elem neighbor,
unsigned int  current_min 
) const
inherited
Returns
The minimum p-refinement level of elements which are descended from this element, and which share a side with the active neighbor.

Definition at line 1906 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::child_ref_range(), libMesh::Elem::has_neighbor(), std::min(), libMesh::Elem::p_level(), libMesh::remote_elem, and libMesh::Elem::subactive().

Referenced by libMesh::FEGenericBase< OutputType >::compute_periodic_constraints(), and libMesh::FEGenericBase< OutputType >::compute_proj_constraints().

1908 {
1909  libmesh_assert(!this->subactive());
1910  libmesh_assert(neighbor_in->active());
1911 
1912  // If we're an active element this is simple
1913  if (this->active())
1914  return std::min(current_min, this->p_level());
1915 
1916  libmesh_assert(has_neighbor(neighbor_in));
1917 
1918  // The p_level() of an ancestor element is already the minimum
1919  // p_level() of its children - so if that's high enough, we don't
1920  // need to examine any children.
1921  if (current_min <= this->p_level())
1922  return current_min;
1923 
1924  unsigned int min_p_level = current_min;
1925 
1926  for (auto & c : this->child_ref_range())
1927  if (&c != remote_elem && c.has_neighbor(neighbor_in))
1928  min_p_level =
1929  c.min_p_level_by_neighbor(neighbor_in, min_p_level);
1930 
1931  return min_p_level;
1932 }
bool subactive() const
Definition: elem.h:2276
bool active() const
Definition: elem.h:2258
unsigned int p_level() const
Definition: elem.h:2423
SimpleRange< ChildRefIter > child_ref_range()
Definition: elem.h:1700
bool has_neighbor(const Elem *elem) const
Definition: elem.h:2011
long double min(long double a, double b)
const RemoteElem * remote_elem
Definition: remote_elem.C:57
virtual unsigned int libMesh::InfQuad::n_children ( ) const
inlinevirtual
Returns
2.

Implements libMesh::Elem.

Definition at line 117 of file face_inf_quad.h.

Referenced by is_child_on_side().

117 { return 2; }
unsigned int libMesh::DofObject::n_comp ( const unsigned int  s,
const unsigned int  var 
) const
inlineinherited
Returns
The number of components for variable var of system s associated with this DofObject. For example, the HIERARCHIC shape functions may have multiple DoFs associated with one node. Another example is the MONOMIALs, where only the elements hold the DoFs. For the different spatial directions, and orders, see FE.

Definition at line 780 of file dof_object.h.

References libMesh::DofObject::n_comp_group(), libMesh::DofObject::n_systems(), libMesh::DofObject::n_vars(), and libMesh::DofObject::var_to_vg().

Referenced by libMesh::DofMap::_dof_indices(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::FEGenericBase< OutputType >::compute_periodic_constraints(), libMesh::DofMap::constrain_p_dofs(), libMesh::ExodusII_IO::copy_elemental_solution(), libMesh::ExodusII_IO::copy_nodal_solution(), libMesh::DofMap::distribute_dofs(), libMesh::DofMap::dof_indices(), libMesh::DofObject::dof_number(), libMesh::DofObject::DofObject(), libMesh::OldSolutionValue< Output, point_output >::eval_at_node(), libMesh::OldSolutionCoefs< Output, point_output >::eval_at_node(), libMesh::Node::get_info(), libMesh::Elem::get_info(), libMesh::DofMap::local_variable_indices(), libMesh::DofObject::n_dofs(), libMesh::DofMap::old_dof_indices(), libMesh::BuildProjectionList::operator()(), libMesh::DofObject::operator=(), libMesh::DofObject::print_dof_info(), libMesh::DofObject::set_dof_number(), libMesh::DofObject::set_id(), libMesh::DofObject::set_n_vars_per_group(), and libMesh::DofMap::set_nonlocal_dof_objects().

782 {
783  libmesh_assert_less (s, this->n_systems());
784  libmesh_assert_less (var, this->n_vars(s));
785 
786  return this->n_comp_group(s,this->var_to_vg(s,var));
787 }
unsigned int n_comp_group(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:793
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:745
unsigned int var_to_vg(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:946
unsigned int n_systems() const
Definition: dof_object.h:726
unsigned int libMesh::DofObject::n_comp_group ( const unsigned int  s,
const unsigned int  vg 
) const
inlineinherited
Returns
The number of components for VariableGroup vg of system s associated with this DofObject. For example, the HIERARCHIC shape functions may have multiple DoFs associated with one node. Another example is the MONOMIALs, where only the elements hold the DoFs. For the different spatial directions, and orders, see FE.

Definition at line 793 of file dof_object.h.

References libMesh::DofObject::_idx_buf, libMesh::DofObject::n_systems(), libMesh::DofObject::n_var_groups(), libMesh::DofObject::ncv_magic, and libMesh::DofObject::start_idx().

Referenced by libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::DofObject::dof_number(), libMesh::DofObject::invalidate_dofs(), libMesh::DofObject::n_comp(), libMesh::DofMap::reinit(), libMesh::DofObject::set_dof_number(), libMesh::DofObject::set_id(), libMesh::DofObject::set_n_comp_group(), libMesh::DofObject::set_n_vars_per_group(), and libMesh::DofMap::set_nonlocal_dof_objects().

795 {
796  libmesh_assert_less (s, this->n_systems());
797  libmesh_assert_less (vg, this->n_var_groups(s));
798 
799  const unsigned int
800  start_idx_sys = this->start_idx(s);
801 
802  libmesh_assert_less ((start_idx_sys + 2*vg), _idx_buf.size());
803 
804  return (_idx_buf[start_idx_sys + 2*vg] % ncv_magic);
805 }
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:735
unsigned int start_idx(const unsigned int s) const
Definition: dof_object.h:878
index_buffer_t _idx_buf
Definition: dof_object.h:485
unsigned int n_systems() const
Definition: dof_object.h:726
static const index_t ncv_magic
Definition: dof_object.h:496
unsigned int libMesh::DofObject::n_dofs ( const unsigned int  s,
const unsigned int  var = libMesh::invalid_uint 
) const
inlineinherited
Returns
The number of degrees of freedom associated with system s for this object. Optionally only counts degrees of freedom for variable number var

Definition at line 610 of file dof_object.h.

References libMesh::invalid_uint, libMesh::DofObject::n_comp(), libMesh::DofObject::n_systems(), and libMesh::DofObject::n_vars().

612 {
613  libmesh_assert_less (s, this->n_systems());
614 
615  unsigned int num = 0;
616 
617  // Count all variables
618  if (var == libMesh::invalid_uint)
619  for (unsigned int v=0; v<this->n_vars(s); v++)
620  num += this->n_comp(s,v);
621 
622  // Only count specified variable
623  else
624  num = this->n_comp(s,var);
625 
626  return num;
627 }
const unsigned int invalid_uint
Definition: libmesh.h:184
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:745
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:780
unsigned int n_systems() const
Definition: dof_object.h:726
virtual unsigned int libMesh::InfQuad::n_edges ( ) const
inlinevirtual
Returns
3. All infinite quads have 1 edge in the base, and 2 perpendicular to the base.

Implements libMesh::Elem.

Definition at line 107 of file face_inf_quad.h.

107 { return 3; }
virtual unsigned int libMesh::InfQuad::n_faces ( ) const
inlinevirtual
Returns
0. All 2D elements have no faces, just edges.

Implements libMesh::Elem.

Definition at line 112 of file face_inf_quad.h.

112 { return 0; }
unsigned int libMesh::Elem::n_neighbors ( ) const
inlineinherited
virtual unsigned int libMesh::Elem::n_nodes ( ) const
pure virtualinherited
Returns
The number of nodes this element contains.

Implemented in libMesh::RemoteElem, libMesh::Prism15, libMesh::Prism18, libMesh::Hex20, libMesh::Hex27, libMesh::InfHex16, libMesh::InfHex18, libMesh::Pyramid14, libMesh::Pyramid13, libMesh::Tri, libMesh::Quad, libMesh::Tet10, libMesh::InfPrism12, libMesh::InfPrism6, libMesh::Pyramid, libMesh::NodeElem, libMesh::Hex8, libMesh::Tet4, libMesh::InfHex8, libMesh::Edge4, libMesh::Edge3, libMesh::Prism, libMesh::Quad8, libMesh::Quad9, libMesh::Tri6, libMesh::InfQuad6, libMesh::InfQuad4, and libMesh::Edge.

Referenced by libMesh::FEMContext::_do_elem_position_set(), libMesh::BoundaryInfo::add_elements(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::Elem::as_parent_node(), libMesh::TetGenMeshInterface::assign_nodes_to_elem(), libMesh::Elem::bracketing_nodes(), libMesh::Nemesis_IO_Helper::build_element_and_node_maps(), libMesh::Elem::coarsen(), libMesh::FEGenericBase< OutputType >::coarsened_dof_values(), libMesh::FEMap::compute_affine_map(), libMesh::FEMap::compute_map(), libMesh::FEGenericBase< OutputType >::compute_periodic_constraints(), libMesh::FEGenericBase< OutputType >::compute_proj_constraints(), libMesh::DofMap::constrain_p_dofs(), libMesh::DofMap::dof_indices(), libMesh::FE< Dim, T >::dofs_on_edge(), libMesh::FE< Dim, T >::dofs_on_side(), libMesh::FEMContext::elem_position_get(), libMesh::MeshTools::find_nodal_neighbors(), libMesh::Elem::get_info(), libMesh::Elem::get_node_index(), libMesh::Elem::key(), libMesh::MeshTools::libmesh_assert_valid_boundary_ids(), libMesh::Elem::libmesh_assert_valid_node_pointers(), libMesh::Elem::local_node(), libMesh::PointLocatorBase::locate_node(), libMesh::Elem::loose_bounding_box(), libMesh::Tet::master_point(), libMesh::Hex::master_point(), libMesh::InfPrism::master_point(), libMesh::InfHex::master_point(), master_point(), libMesh::Elem::n_nodes_in_child(), libMesh::Elem::node_id(), libMesh::Elem::node_index_range(), libMesh::Elem::node_ptr(), libMesh::Elem::node_ref_range(), libMesh::DofMap::old_dof_indices(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::operator()(), libMesh::BoundaryProjectSolution::operator()(), libMesh::Elem::operator==(), libMesh::Hex::opposite_node(), libMesh::Parallel::Packing< const Elem * >::pack(), libMesh::XdrIO::pack_element(), libMesh::Parallel::Packing< const Elem * >::packable_size(), libMesh::Elem::parent_bracketing_nodes(), libMesh::MetisPartitioner::partition_range(), libMesh::Elem::point(), libMesh::TetGenMeshInterface::pointset_convexhull(), libMesh::VTKIO::read(), libMesh::CheckpointIO::read_connectivity(), libMesh::UCDIO::read_implementation(), libMesh::GmshIO::read_mesh(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::Elem::refine(), libMesh::FE< Dim, T >::reinit(), libMesh::DistributedMesh::renumber_nodes_and_elements(), libMesh::Elem::set_node(), libMesh::Partitioner::set_node_processor_ids(), libMesh::FE< Dim, T >::shape(), libMesh::FE< Dim, T >::shape_deriv(), libMesh::FE< Dim, T >::shape_second_deriv(), libMesh::FE< Dim, T >::side_map(), libMesh::Partitioner::single_partition_range(), libMesh::MeshTools::Modification::smooth(), libMesh::Parallel::sync_node_data_by_element_id(), libMesh::TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole(), libMesh::TetGenMeshInterface::triangulate_pointset(), libMesh::Parallel::Packing< Elem * >::unpack(), libMesh::Elem::which_side_am_i(), libMesh::CheckpointIO::write_connectivity(), libMesh::Nemesis_IO_Helper::write_elements(), and libMesh::ExodusII_IO_Helper::write_elements().

virtual unsigned int libMesh::Elem::n_nodes_in_child ( unsigned  int) const
inlinevirtualinherited
Returns
The number of nodes the given child of this element contains. Except in odd cases like pyramid refinement this will be the same as the number of nodes in the parent element.

Definition at line 583 of file elem.h.

References libMesh::Elem::n_nodes().

Referenced by libMesh::Elem::as_parent_node(), libMesh::Elem::bracketing_nodes(), and libMesh::Elem::parent_bracketing_nodes().

584  { return this->n_nodes(); }
virtual unsigned int n_nodes() const =0
static unsigned int libMesh::ReferenceCounter::n_objects ( )
inlinestaticinherited
static unsigned int libMesh::ReferenceCounter::n_objects ( )
inlinestaticinherited
unsigned int libMesh::Elem::n_second_order_adjacent_vertices ( const unsigned int  n) const
virtualinherited
Returns
The number of adjacent vertices that uniquely define the location of the $ n^{th} $ second-order node, or 0 for linear elements.

This method is useful when converting linear elements to quadratic elements.

Note
n has to be greater than or equal to this->n_vertices().

Reimplemented in libMesh::InfHex18, libMesh::Pyramid14, libMesh::Hex27, libMesh::Prism18, libMesh::InfHex16, libMesh::Pyramid13, libMesh::Hex20, libMesh::Prism15, libMesh::Tet10, libMesh::Quad9, libMesh::InfPrism12, libMesh::InfQuad6, libMesh::Quad8, libMesh::Tri6, libMesh::Edge4, and libMesh::Edge3.

Definition at line 2587 of file elem.C.

Referenced by libMesh::Elem::is_linear(), and libMesh::MeshTools::Modification::smooth().

2588 {
2589  // for linear elements, always return 0
2590  return 0;
2591 }
virtual unsigned int libMesh::InfQuad::n_sides ( ) const
inlinevirtual
Returns
3. Infinite faces have one side less than their conventional counterparts, since one side is supposed to be located at infinity.

Implements libMesh::Elem.

Definition at line 96 of file face_inf_quad.h.

Referenced by is_child_on_side(), libMesh::InfQuad4::is_node_on_side(), libMesh::InfQuad6::is_node_on_side(), libMesh::InfQuad6::key(), key(), side_ptr(), libMesh::InfQuad6::which_node_am_i(), and which_node_am_i().

96 { return 3; }
virtual unsigned int libMesh::Elem::n_sub_elem ( ) const
pure virtualinherited
unsigned int libMesh::DofObject::n_var_groups ( const unsigned int  s) const
inlineinherited