libMesh::InfHex8 Class Reference

A 3D infinite hexahedral element with 8 nodes. More...

#include <cell_inf_hex8.h>

Inheritance diagram for libMesh::InfHex8:

Public Types

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

Public Member Functions

 InfHex8 (Elem *p=libmesh_nullptr)
 
virtual unsigned int n_nodes () const libmesh_override
 
virtual ElemType type () const libmesh_override
 
virtual unsigned int n_sub_elem () const libmesh_override
 
virtual bool is_vertex (const unsigned int i) const libmesh_override
 
virtual bool is_edge (const unsigned int i) const libmesh_override
 
virtual bool is_face (const unsigned int i) const libmesh_override
 
virtual bool is_node_on_side (const unsigned int n, const unsigned int s) const libmesh_override
 
virtual bool is_node_on_edge (const unsigned int n, const unsigned int e) const libmesh_override
 
virtual Order default_order () const libmesh_override
 
virtual UniquePtr< Elembuild_side_ptr (const unsigned int i, bool proxy) libmesh_override
 
virtual UniquePtr< Elembuild_edge_ptr (const unsigned int i) libmesh_override
 
virtual void connectivity (const unsigned int sc, const IOPackage iop, std::vector< dof_id_type > &conn) const libmesh_override
 
unsigned int vtk_element_type (const unsigned int) const
 
virtual bool contains_point (const Point &p, Real tol=TOLERANCE) const libmesh_override
 
virtual Point master_point (const unsigned int i) const libmesh_override
 
virtual unsigned int n_sides () const libmesh_override
 
virtual unsigned int n_vertices () const libmesh_override
 
virtual bool is_mid_infinite_edge_node (const unsigned int i) 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_child_on_side (const unsigned int c, const unsigned int s) const libmesh_override
 
virtual bool is_edge_on_side (const unsigned int e, const unsigned int s) const libmesh_override
 
virtual dof_id_type key (const unsigned int s) const libmesh_override
 
virtual dof_id_type key () const
 
virtual unsigned int which_node_am_i (unsigned int side, unsigned int side_node) const libmesh_override
 
virtual UniquePtr< Elemside_ptr (const unsigned int i) libmesh_override
 
UniquePtr< const Elemside_ptr (unsigned int i) const
 
virtual Real quality (const ElemQuality q) const libmesh_override
 
virtual std::pair< Real, Realqual_bounds (const ElemQuality q) const libmesh_override
 
virtual unsigned int dim () 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)
 
subdomain_id_type subdomain_id () const
 
subdomain_id_typesubdomain_id ()
 
const Elemreference_elem () 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
 
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
 
void write_connectivity (std::ostream &out, const IOPackage iop) const
 
virtual unsigned int n_nodes_in_child (unsigned int) const
 
virtual unsigned int n_neighbors () const
 
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 unsigned int opposite_side (const unsigned int s) const
 
virtual unsigned int opposite_node (const unsigned int n, const unsigned int s) const
 
UniquePtr< Elemside (const unsigned int i) const
 
UniquePtr< const Elembuild_side_ptr (const unsigned int i, bool proxy=true) const
 
UniquePtr< Elembuild_side (const unsigned int i, bool proxy=true) const
 
UniquePtr< const Elembuild_edge_ptr (const unsigned int i) const
 
UniquePtr< Elembuild_edge (const unsigned int i) const
 
virtual Point centroid () const
 
virtual Real hmin () const
 
virtual Real hmax () const
 
virtual Real volume () const
 
virtual BoundingBox loose_bounding_box () 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 Elemchild_ptr (unsigned int i) const
 
Elemchild_ptr (unsigned int i)
 
Elemchild (const unsigned int i) 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 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 UniquePtr< 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 unsigned int side_nodes_map [5][4]
 
static const unsigned int edge_nodes_map [8][2]
 
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 float embedding_matrix (const unsigned int i, const unsigned int j, const unsigned int k) const libmesh_override
 
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

Node_nodelinks_data [8]
 
 LIBMESH_ENABLE_TOPOLOGY_CACHES
 
Elem_elemlinks_data [6+(LIBMESH_DIM >3)]
 
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 float _embedding_matrix [4][8][8]
 
static const unsigned short int _second_order_adjacent_vertices [8][2]
 
static const unsigned short int _second_order_vertex_child_number [18]
 
static const unsigned short int _second_order_vertex_child_index [18]
 
static const Real _master_points [18][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

A 3D infinite hexahedral element with 8 nodes.

The InfHex8 is an infinite element in 3D composed of 8 nodes. It is numbered like this:

*   INFHEX8: 7        6                             z^  / y
*            o        o    closer to infinity        | /
*            :        |                              |/
*            :        |                              +----> x
*       4    :   5    |
*        o   :    o   |
*        |   o....|...o 2
*        |  .3    |  /
*        | .      | /
*        |.       |/       base face
*        o--------o
*        0        1
* 
Author
Daniel Dreyer
Date
2002

Definition at line 55 of file cell_inf_hex8.h.

Member Typedef Documentation

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.

Useful iterator typedefs

Definition at line 1333 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 1057 of file elem.h.

Constructor & Destructor Documentation

libMesh::InfHex8::InfHex8 ( Elem p = libmesh_nullptr)
inlineexplicit

Constructor. By default this element has no parent.

Definition at line 63 of file cell_inf_hex8.h.

63  :
65  {}
virtual unsigned int n_nodes() const libmesh_override
Definition: cell_inf_hex8.h:70
Node * _nodelinks_data[8]
InfHex(const unsigned int nn, Elem *p, Node **nodelinkdata)
Definition: cell_inf_hex.h:54

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 1486 of file elem.h.

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

1487  {
1488  static std::vector<std::vector<std::vector<std::vector<std::pair<unsigned char, unsigned char> > > > > c;
1489  libmesh_error();
1490  return c;
1491  }
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 1500 of file elem.h.

References libMesh::Elem::nullify_neighbors().

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

1501  {
1502  static std::vector<std::vector<std::vector<signed char> > > c;
1503  libmesh_error();
1504  return c;
1505  }
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 2053 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::MeshRefinement::eliminate_unrefined_patches(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::ExactErrorEstimator::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_edge_neighbors(), libMesh::Patch::find_face_neighbors(), libMesh::Elem::find_interior_neighbors(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshTools::find_nodal_neighbors(), libMesh::Elem::find_point_neighbors(), libMesh::MeshRefinement::flag_elements_by_nelem_target(), libMesh::Elem::get_info(), libMesh::ErrorVector::is_active_elem(), libMesh::Elem::is_linear(), libMesh::MeshTools::libmesh_assert_topology_consistent_procids< Elem >(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_flags(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_p_levels(), libMesh::MeshTools::libmesh_assert_valid_refinement_tree(), 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::GhostPointNeighbors::operator()(), 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().

2054 {
2055 #ifdef LIBMESH_ENABLE_AMR
2056  if ((this->refinement_flag() == INACTIVE) ||
2057  (this->refinement_flag() == COARSEN_INACTIVE))
2058  return false;
2059  else
2060  return true;
2061 #else
2062  return true;
2063 #endif
2064 }
RefinementState refinement_flag() const
Definition: elem.h:2289
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 1717 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::active_family_tree(), libMesh::Elem::child_ptr(), libMesh::Elem::is_remote(), libMesh::libmesh_assert(), libMesh::Elem::n_children(), and libMesh::Elem::subactive().

Referenced by libMesh::Elem::active_family_tree(), libMesh::ParmetisPartitioner::build_graph(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::SiblingCoupling::operator()(), libMesh::MetisPartitioner::partition_range(), and libMesh::Partitioner::set_parent_processor_ids().

1719 {
1720  // The "family tree" doesn't include subactive elements
1721  libmesh_assert(!this->subactive());
1722 
1723  // Clear the vector if the flag reset tells us to.
1724  if (reset)
1725  active_family.clear();
1726 
1727  // Add this element to the family tree if it is active
1728  if (this->active())
1729  active_family.push_back(this);
1730 
1731  // Otherwise recurse into the element's children.
1732  // Do not clear the vector any more.
1733  else
1734  for (unsigned int c=0; c<this->n_children(); c++)
1735  if (!this->child_ptr(c)->is_remote())
1736  this->child_ptr(c)->active_family_tree (active_family, false);
1737 }
bool subactive() const
Definition: elem.h:2071
bool active() const
Definition: elem.h:2053
void active_family_tree(std::vector< const Elem * > &active_family, const bool reset=true) const
Definition: elem.C:1717
libmesh_assert(j)
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2232
virtual bool is_remote() const
Definition: elem.h:487
virtual unsigned int n_children() const =0
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 1994 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::active_family_tree_by_neighbor(), libMesh::Elem::child_ptr(), libMesh::Elem::has_neighbor(), libMesh::Elem::level(), libMesh::libmesh_assert(), libMesh::Elem::n_children(), libMesh::remote_elem, and libMesh::Elem::subactive().

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

1997 {
1998  // The "family tree" doesn't include subactive elements or
1999  // remote_elements
2000  libmesh_assert(!this->subactive());
2001  libmesh_assert(this != remote_elem);
2002 
2003  // Clear the vector if the flag reset tells us to.
2004  if (reset)
2005  family.clear();
2006 
2007  // This only makes sense if we're already a neighbor
2008 #ifndef NDEBUG
2009  if (this->level() >= neighbor_in->level())
2010  libmesh_assert (this->has_neighbor(neighbor_in));
2011 #endif
2012 
2013  // Add an active element to the family tree.
2014  if (this->active())
2015  family.push_back(this);
2016 
2017  // Or recurse into an ancestor element's children.
2018  // Do not clear the vector any more.
2019  else if (!this->active())
2020  for (unsigned int c=0; c<this->n_children(); c++)
2021  {
2022  const Elem * current_child = this->child_ptr(c);
2023  if (current_child != remote_elem && current_child->has_neighbor(neighbor_in))
2024  current_child->active_family_tree_by_neighbor (family, neighbor_in, false);
2025  }
2026 }
bool subactive() const
Definition: elem.h:2071
bool active() const
Definition: elem.h:2053
libmesh_assert(j)
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2232
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:1583
bool has_neighbor(const Elem *elem) const
Definition: elem.h:1856
unsigned int level() const
Definition: elem.h:2184
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 1767 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::libmesh_assert(), 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().

1770 {
1771  // The "family tree" doesn't include subactive or remote elements
1772  libmesh_assert(!this->subactive());
1773  libmesh_assert(this != remote_elem);
1774 
1775  // Clear the vector if the flag reset tells us to.
1776  if (reset)
1777  family.clear();
1778 
1779  libmesh_assert_less (s, this->n_sides());
1780 
1781  // Add an active element to the family tree.
1782  if (this->active())
1783  family.push_back(this);
1784 
1785  // Or recurse into an ancestor element's children.
1786  // Do not clear the vector any more.
1787  else
1788  for (unsigned int c=0; c<this->n_children(); c++)
1789  if (!this->child_ptr(c)->is_remote() && this->is_child_on_side(c, s))
1790  this->child_ptr(c)->active_family_tree_by_side (family, s, false);
1791 }
bool subactive() const
Definition: elem.h:2071
bool active() const
Definition: elem.h:2053
virtual bool is_child_on_side(const unsigned int c, const unsigned int s) const =0
libmesh_assert(j)
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2232
virtual unsigned int n_sides() const =0
virtual bool is_remote() const
Definition: elem.h:487
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:1767
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 1947 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::active_family_tree_by_topological_neighbor(), libMesh::Elem::child_ptr(), libMesh::Elem::has_topological_neighbor(), libMesh::Elem::level(), libMesh::libmesh_assert(), libMesh::Elem::n_children(), libMesh::remote_elem, and libMesh::Elem::subactive().

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

1953 {
1954  // The "family tree" doesn't include subactive elements or
1955  // remote_elements
1956  libmesh_assert(!this->subactive());
1957  libmesh_assert(this != remote_elem);
1958 
1959  // Clear the vector if the flag reset tells us to.
1960  if (reset)
1961  family.clear();
1962 
1963  // This only makes sense if we're already a topological neighbor
1964 #ifndef NDEBUG
1965  if (this->level() >= neighbor_in->level())
1966  libmesh_assert (this->has_topological_neighbor(neighbor_in,
1967  mesh,
1968  point_locator,
1969  pb));
1970 #endif
1971 
1972  // Add an active element to the family tree.
1973  if (this->active())
1974  family.push_back(this);
1975 
1976  // Or recurse into an ancestor element's children.
1977  // Do not clear the vector any more.
1978  else if (!this->active())
1979  for (unsigned int c=0; c<this->n_children(); c++)
1980  {
1981  const Elem * current_child = this->child_ptr(c);
1982  if (current_child != remote_elem &&
1983  current_child->has_topological_neighbor(neighbor_in,
1984  mesh,
1985  point_locator,
1986  pb))
1987  current_child->active_family_tree_by_topological_neighbor
1988  (family, neighbor_in, mesh, point_locator, pb, false);
1989  }
1990 }
bool subactive() const
Definition: elem.h:2071
bool active() const
Definition: elem.h:2053
bool has_topological_neighbor(const Elem *elem, const MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb) const
Definition: elem.C:1094
MeshBase & mesh
libmesh_assert(j)
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2232
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:1583
unsigned int level() const
Definition: elem.h:2184
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 1604 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::XdrIO::read_serialized_connectivity(), and libMesh::Parallel::Packing< Elem * >::unpack().

1605 {
1606  if (_children == libmesh_nullptr)
1607  {
1608  _children = new Elem *[this->n_children()];
1609 
1610  for (unsigned int c=0; c<this->n_children(); c++)
1611  this->set_child(c, libmesh_nullptr);
1612  }
1613 
1614  for (unsigned int c=0; c<this->n_children(); c++)
1615  {
1616  if (this->_children[c] == libmesh_nullptr || this->_children[c] == remote_elem)
1617  {
1618  libmesh_assert_equal_to (this, elem->parent());
1619  this->set_child(c, elem);
1620  return;
1621  }
1622  }
1623 
1624  libmesh_error_msg("Error: Tried to add a child to an element with full children array");
1625 }
const class libmesh_nullptr_t libmesh_nullptr
Elem ** _children
Definition: elem.h:1534
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:1583
void set_child(unsigned int c, Elem *elem)
Definition: elem.h:2262
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 1629 of file elem.C.

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

1630 {
1631  if (!this->has_children())
1632  {
1633  _children = new Elem *[this->n_children()];
1634 
1635  for (unsigned int i=0; i<this->n_children(); i++)
1636  this->set_child(i, libmesh_nullptr);
1637  }
1638 
1639  libmesh_assert (this->_children[c] == libmesh_nullptr || this->child_ptr(c) == remote_elem);
1640  libmesh_assert (elem == remote_elem || this == elem->parent());
1641 
1642  this->set_child(c, elem);
1643 }
bool has_children() const
Definition: elem.h:2091
const Elem * parent() const
Definition: elem.h:2142
const class libmesh_nullptr_t libmesh_nullptr
libmesh_assert(j)
Elem ** _children
Definition: elem.h:1534
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2232
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:1583
void set_child(unsigned int c, Elem *elem)
Definition: elem.h:2262
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 187 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().

188 {
189  // quick return?
190  if (this->n_systems() == 0)
191  {
192  this->set_n_systems(1);
193  return;
194  }
195 
196  DofObject::index_buffer_t::iterator it = _idx_buf.begin();
197 
198  std::advance(it, this->n_systems());
199 
200  // this inserts the current vector size at the position for the new system - creating the
201  // entry we need for the new system indicating there are 0 variables.
202  _idx_buf.insert(it, cast_int<dof_id_type>(_idx_buf.size()));
203 
204  // cache this value before we screw it up!
205  const unsigned int ns_orig = this->n_systems();
206 
207  // incriment the number of systems and the offsets for each of
208  // the systems including the new one we just added.
209  for (unsigned int i=0; i<ns_orig+1; i++)
210  _idx_buf[i]++;
211 
212  libmesh_assert_equal_to (this->n_systems(), (ns_orig+1));
213  libmesh_assert_equal_to (this->n_vars(ns_orig), 0);
214  libmesh_assert_equal_to (this->n_var_groups(ns_orig), 0);
215 }
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:737
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:727
void set_n_systems(const unsigned int s)
Definition: dof_object.C:157
index_buffer_t _idx_buf
Definition: dof_object.h:477
unsigned int n_systems() const
Definition: dof_object.h:718
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 1569 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::ancestor(), libMesh::Elem::child_ptr(), libMesh::Elem::has_children(), libMesh::libmesh_assert(), libMesh::Elem::n_children(), libMesh::remote_elem, and libMesh::Elem::subactive().

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

1570 {
1571 #ifdef LIBMESH_ENABLE_AMR
1572 
1573  // Use a fast, DistributedMesh-safe definition
1574  const bool is_ancestor =
1575  !this->active() && !this->subactive();
1576 
1577  // But check for inconsistencies if we have time
1578 #ifdef DEBUG
1579  if (!is_ancestor && this->has_children())
1580  {
1581  for (unsigned int c=0; c != this->n_children(); ++c)
1582  {
1583  const Elem * kid = this->child_ptr(c);
1584  if (kid != remote_elem)
1585  {
1586  libmesh_assert(!kid->active());
1587  libmesh_assert(!kid->ancestor());
1588  }
1589  }
1590  }
1591 #endif // DEBUG
1592 
1593  return is_ancestor;
1594 
1595 #else
1596  return false;
1597 #endif
1598 }
bool has_children() const
Definition: elem.h:2091
bool subactive() const
Definition: elem.h:2071
bool active() const
Definition: elem.h:2053
libmesh_assert(j)
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2232
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:1583
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 2102 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().

2104 {
2105  libmesh_assert_less(child, this->n_children());
2106 
2107  // Cached return values, indexed first by embedding_matrix version,
2108  // then by child number, then by child node number.
2109  std::vector<std::vector<std::vector<signed char> > > &
2110  cached_parent_indices = this->_get_parent_indices_cache();
2111 
2112  unsigned int em_vers = this->embedding_matrix_version();
2113 
2114  // We may be updating the cache on one thread, and while that
2115  // happens we can't safely access the cache from other threads.
2116  Threads::spin_mutex::scoped_lock lock(parent_indices_mutex);
2117 
2118  if (em_vers >= cached_parent_indices.size())
2119  cached_parent_indices.resize(em_vers+1);
2120 
2121  if (child >= cached_parent_indices[em_vers].size())
2122  {
2123  const unsigned int nn = this->n_nodes();
2124 
2125  cached_parent_indices[em_vers].resize(this->n_children());
2126 
2127  for (unsigned int c = 0; c != this->n_children(); ++c)
2128  {
2129  const unsigned int ncn = this->n_nodes_in_child(c);
2130  cached_parent_indices[em_vers][c].resize(ncn);
2131  for (unsigned int cn = 0; cn != ncn; ++cn)
2132  {
2133  for (unsigned int n = 0; n != nn; ++n)
2134  {
2135  const float em_val = this->embedding_matrix
2136  (c, cn, n);
2137  if (em_val == 1)
2138  {
2139  cached_parent_indices[em_vers][c][cn] = n;
2140  break;
2141  }
2142 
2143  if (em_val != 0)
2144  {
2145  cached_parent_indices[em_vers][c][cn] =
2146  -1;
2147  break;
2148  }
2149 
2150  // We should never see an all-zero embedding matrix
2151  // row
2152  libmesh_assert_not_equal_to (n+1, nn);
2153  }
2154  }
2155  }
2156  }
2157 
2158  const signed char cache_val =
2159  cached_parent_indices[em_vers][child][child_node];
2160  if (cache_val == -1)
2161  return libMesh::invalid_uint;
2162 
2163  return cached_parent_indices[em_vers][child][child_node];
2164 }
const unsigned int invalid_uint
Definition: libmesh.h:184
Threads::spin_mutex parent_indices_mutex
Definition: elem.C:79
Elem * child(const unsigned int i) const
Definition: elem.h:2251
virtual unsigned int n_nodes() const =0
virtual unsigned int n_nodes_in_child(unsigned int) const
Definition: elem.h:533
virtual std::vector< std::vector< std::vector< signed char > > > & _get_parent_indices_cache() const
Definition: elem.h:1500
virtual unsigned int n_children() const =0
virtual unsigned int embedding_matrix_version() const
Definition: elem.h:1443
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 2960 of file elem.C.

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

2961 {
2962  Predicates::BoundarySide<SideIter> bsp;
2963  return side_iterator(this->_first_side(), this->_last_side(), bsp);
2964 }
SideIter _last_side()
Definition: elem.h:2614
SideIter _first_side()
Definition: elem.h:2606
Elem::side_iterator libMesh::Elem::boundary_sides_end ( )
inherited

Definition at line 2969 of file elem.C.

References libMesh::Elem::_last_side().

2970 {
2971  Predicates::BoundarySide<SideIter> bsp;
2972  return side_iterator(this->_last_side(), this->_last_side(), bsp);
2973 }
SideIter _last_side()
Definition: elem.h:2614
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 2374 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().

2376 {
2377  std::vector<std::pair<dof_id_type, dof_id_type> > returnval;
2378 
2379  const std::vector<std::pair<unsigned char, unsigned char> > & pbc =
2380  this->parent_bracketing_nodes(child,child_node);
2381 
2382  for (std::size_t i = 0; i != pbc.size(); ++i)
2383  {
2384  if (pbc[i].first < this->n_nodes() &&
2385  pbc[i].second < this->n_nodes())
2386  returnval.push_back(std::make_pair(this->node_id(pbc[i].first),
2387  this->node_id(pbc[i].second)));
2388  else
2389  {
2390  // We must be on a non-full-order higher order element...
2391  libmesh_assert_not_equal_to(this->default_order(), FIRST);
2392  libmesh_assert_not_equal_to
2393  (second_order_equivalent_type (this->type(), true),
2394  this->type());
2395  libmesh_assert_equal_to
2396  (second_order_equivalent_type (this->type(), false),
2397  this->type());
2398 
2399  // And that's a shame, because this is a nasty search:
2400 
2401  // Build the full-order type
2402  ElemType full_type =
2403  second_order_equivalent_type(this->type(), /*full_ordered=*/ true);
2404  UniquePtr<Elem> full_elem = Elem::build(full_type);
2405 
2408 
2409  // Find the bracketing nodes by figuring out what
2410  // already-created children will have them.
2411 
2412  // This only doesn't break horribly because we add children
2413  // and nodes in straightforward + hierarchical orders...
2414  for (unsigned int c=0; c <= child; ++c)
2415  for (unsigned int n=0; n != this->n_nodes_in_child(c); ++n)
2416  {
2417  if (c == child && n == child_node)
2418  break;
2419 
2420  if (pbc[i].first == full_elem->as_parent_node(c,n))
2421  {
2422  // We should be consistent
2423  if (pt1 != DofObject::invalid_id)
2424  libmesh_assert_equal_to(pt1, this->child_ptr(c)->node_id(n));
2425 
2426  pt1 = this->child_ptr(c)->node_id(n);
2427  }
2428 
2429  if (pbc[i].second == full_elem->as_parent_node(c,n))
2430  {
2431  // We should be consistent
2432  if (pt2 != DofObject::invalid_id)
2433  libmesh_assert_equal_to(pt2, this->child_ptr(c)->node_id(n));
2434 
2435  pt2 = this->child_ptr(c)->node_id(n);
2436  }
2437  }
2438 
2439  // We should *usually* find all bracketing nodes by the time
2440  // we query them (again, because of the child & node add
2441  // order)
2442  //
2443  // The exception is if we're a HEX20, in which case we will
2444  // find pairs of vertex nodes and edge nodes bracketing the
2445  // new central node but we *won't* find the pairs of face
2446  // nodes which we would have had on a HEX27. In that case
2447  // we'll still have enough bracketing nodes for a
2448  // topological lookup, but we won't be able to make the
2449  // following assertions.
2450  if (this->type() != HEX20)
2451  {
2452  libmesh_assert_not_equal_to (pt1, DofObject::invalid_id);
2453  libmesh_assert_not_equal_to (pt2, DofObject::invalid_id);
2454  }
2455 
2456  if (pt1 != DofObject::invalid_id &&
2457  pt2 != DofObject::invalid_id)
2458  returnval.push_back(std::make_pair(pt1, pt2));
2459  }
2460  }
2461 
2462  return returnval;
2463 }
static UniquePtr< Elem > build(const ElemType type, Elem *p=libmesh_nullptr)
Definition: elem.C:234
virtual ElemType type() const =0
Elem * child(const unsigned int i) const
Definition: elem.h:2251
virtual unsigned int n_nodes() const =0
virtual unsigned int n_nodes_in_child(unsigned int) const
Definition: elem.h:533
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2232
static const dof_id_type invalid_id
Definition: dof_object.h:334
virtual Order default_order() const =0
static ElemType second_order_equivalent_type(const ElemType et, const bool full_ordered=true)
Definition: elem.C:2804
virtual const std::vector< std::pair< unsigned char, unsigned char > > & parent_bracketing_nodes(unsigned int c, unsigned int n) const
Definition: elem.C:2169
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:1683
uint8_t dof_id_type
Definition: id_types.h:64
UniquePtr< 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 234 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_nullptr, libMesh::NODEELEM, libMesh::PRISM15, libMesh::PRISM18, libMesh::PRISM6, libMesh::PYRAMID13, libMesh::PYRAMID14, libMesh::PYRAMID5, libMesh::QUAD4, libMesh::QUAD8, libMesh::QUAD9, libMesh::QUADSHELL4, 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().

236 {
237  Elem * elem = libmesh_nullptr;
238 
239  switch (type)
240  {
241  // 0D elements
242  case NODEELEM:
243  {
244  elem = new NodeElem(p);
245  break;
246  }
247 
248  // 1D elements
249  case EDGE2:
250  {
251  elem = new Edge2(p);
252  break;
253  }
254  case EDGE3:
255  {
256  elem = new Edge3(p);
257  break;
258  }
259  case EDGE4:
260  {
261  elem = new Edge4(p);
262  break;
263  }
264 
265 
266 
267  // 2D elements
268  case TRI3:
269  {
270  elem = new Tri3(p);
271  break;
272  }
273  case TRISHELL3:
274  {
275  elem = new TriShell3(p);
276  break;
277  }
278  case TRI3SUBDIVISION:
279  {
280  elem = new Tri3Subdivision(p);
281  break;
282  }
283  case TRI6:
284  {
285  elem = new Tri6(p);
286  break;
287  }
288  case QUAD4:
289  {
290  elem = new Quad4(p);
291  break;
292  }
293  case QUADSHELL4:
294  {
295  elem = new QuadShell4(p);
296  break;
297  }
298  case QUAD8:
299  {
300  elem = new Quad8(p);
301  break;
302  }
303  case QUAD9:
304  {
305  elem = new Quad9(p);
306  break;
307  }
308 
309 
310  // 3D elements
311  case TET4:
312  {
313  elem = new Tet4(p);
314  break;
315  }
316  case TET10:
317  {
318  elem = new Tet10(p);
319  break;
320  }
321  case HEX8:
322  {
323  elem = new Hex8(p);
324  break;
325  }
326  case HEX20:
327  {
328  elem = new Hex20(p);
329  break;
330  }
331  case HEX27:
332  {
333  elem = new Hex27(p);
334  break;
335  }
336  case PRISM6:
337  {
338  elem = new Prism6(p);
339  break;
340  }
341  case PRISM15:
342  {
343  elem = new Prism15(p);
344  break;
345  }
346  case PRISM18:
347  {
348  elem = new Prism18(p);
349  break;
350  }
351  case PYRAMID5:
352  {
353  elem = new Pyramid5(p);
354  break;
355  }
356  case PYRAMID13:
357  {
358  elem = new Pyramid13(p);
359  break;
360  }
361  case PYRAMID14:
362  {
363  elem = new Pyramid14(p);
364  break;
365  }
366 
367 
368 
369 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
370 
371  // 1D infinite elements
372  case INFEDGE2:
373  {
374  elem = new InfEdge2(p);
375  break;
376  }
377 
378 
379  // 2D infinite elements
380  case INFQUAD4:
381  {
382  elem = new InfQuad4(p);
383  break;
384  }
385  case INFQUAD6:
386  {
387  elem = new InfQuad6(p);
388  break;
389  }
390 
391 
392  // 3D infinite elements
393  case INFHEX8:
394  {
395  elem = new InfHex8(p);
396  break;
397  }
398  case INFHEX16:
399  {
400  elem = new InfHex16(p);
401  break;
402  }
403  case INFHEX18:
404  {
405  elem = new InfHex18(p);
406  break;
407  }
408  case INFPRISM6:
409  {
410  elem = new InfPrism6(p);
411  break;
412  }
413  case INFPRISM12:
414  {
415  elem = new InfPrism12(p);
416  break;
417  }
418 
419 #endif
420 
421  default:
422  libmesh_error_msg("ERROR: Undefined element type!");
423  }
424 
425  return UniquePtr<Elem>(elem);
426 }
virtual ElemType type() const =0
const class libmesh_nullptr_t libmesh_nullptr
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1583
UniquePtr< 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 1956 of file elem.h.

References libMesh::Elem::build_edge_ptr().

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

1957 {
1958  // Call the const version of build_edge_ptr(), and const_cast the result.
1959  libmesh_deprecated();
1960  Elem * e = const_cast<Elem *>(this->build_edge_ptr(i).release());
1961  return UniquePtr<Elem>(e);
1962 }
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1583
virtual UniquePtr< Elem > build_edge_ptr(const unsigned int i)=0
UniquePtr< Elem > libMesh::InfHex8::build_edge_ptr ( const unsigned int  i)
virtual
Returns
An EDGE2 built coincident with edges 0 to 3, or an INFEDGE2 built coincident with edges 4 to 7.
Note
The UniquePtr<Elem> takes care of freeing memory.

Implements libMesh::Elem.

Definition at line 172 of file cell_inf_hex8.C.

References libMesh::InfHex::n_edges().

Referenced by default_order().

173 {
174  libmesh_assert_less (i, this->n_edges());
175 
176  if (i < 4) // base edges
177  return UniquePtr<Elem>(new SideEdge<Edge2,InfHex8>(this,i));
178  // infinite edges
179  return UniquePtr<Elem>(new SideEdge<InfEdge2,InfHex8>(this,i));
180 }
virtual unsigned int n_edges() const libmesh_override
Definition: cell_inf_hex.h:98
UniquePtr< const Elem > libMesh::Elem::build_edge_ptr ( const unsigned int  i) const
inlineinherited

Definition at line 1943 of file elem.h.

References libMesh::Elem::build_edge_ptr().

1944 {
1945  // Call the non-const version of this function, return the result as
1946  // a UniquePtr<const Elem>.
1947  Elem * me = const_cast<Elem *>(this);
1948  const Elem * e = const_cast<const Elem *>(me->build_edge_ptr(i).release());
1949  return UniquePtr<const Elem>(e);
1950 }
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1583
UniquePtr< 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 1931 of file elem.h.

References libMesh::Elem::build_side_ptr().

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

1932 {
1933  // Call the const version of build_side_ptr(), and const_cast the result.
1934  libmesh_deprecated();
1935  Elem * s = const_cast<Elem *>(this->build_side_ptr(i, proxy).release());
1936  return UniquePtr<Elem>(s);
1937 }
virtual UniquePtr< 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:1583
UniquePtr< Elem > libMesh::InfHex8::build_side_ptr ( const unsigned int  i,
bool  proxy 
)
virtual
Returns
A QUAD4 built coincident with face 0, or an INFQUAD4 built coincident with faces 1 to 4.
Note
that the UniquePtr<Elem> takes care of freeing memory.

Implements libMesh::Elem.

Definition at line 105 of file cell_inf_hex8.C.

References libmesh_nullptr, libMesh::Elem::n_nodes(), libMesh::InfHex::n_sides(), libMesh::Elem::node_ptr(), libMesh::Elem::set_node(), and libMesh::Elem::subdomain_id().

Referenced by default_order().

107 {
108  libmesh_assert_less (i, this->n_sides());
109 
110  if (proxy)
111  {
112  switch (i)
113  {
114  // base
115  case 0:
116  return UniquePtr<Elem>(new Side<Quad4,InfHex8>(this,i));
117 
118  // ifem sides
119  case 1:
120  case 2:
121  case 3:
122  case 4:
123  return UniquePtr<Elem>(new Side<InfQuad4,InfHex8>(this,i));
124 
125  default:
126  libmesh_error_msg("Invalid side i = " << i);
127  }
128  }
129 
130  else
131  {
132  // Create NULL pointer to be initialized, returned later.
133  Elem * face = libmesh_nullptr;
134 
135  // Think of a unit cube: (-1,1) x (-1,1) x (1,1)
136  switch (i)
137  {
138  case 0: // the base face
139  {
140  face = new Quad4;
141  break;
142  }
143 
144  // connecting to another infinite element
145  case 1:
146  case 2:
147  case 3:
148  case 4:
149  {
150  face = new InfQuad4;
151  break;
152  }
153 
154  default:
155  libmesh_error_msg("Invalid side i = " << i);
156  }
157 
158  face->subdomain_id() = this->subdomain_id();
159 
160  // Set the nodes
161  for (unsigned n=0; n<face->n_nodes(); ++n)
162  face->set_node(n) = this->node_ptr(InfHex8::side_nodes_map[i][n]);
163 
164  return UniquePtr<Elem>(face);
165  }
166 
167  libmesh_error_msg("We'll never get here!");
168  return UniquePtr<Elem>();
169 }
const class libmesh_nullptr_t libmesh_nullptr
static const unsigned int side_nodes_map[5][4]
virtual unsigned int n_sides() const libmesh_override
Definition: cell_inf_hex.h:79
const Node * node_ptr(const unsigned int i) const
Definition: elem.h:1724
subdomain_id_type subdomain_id() const
Definition: elem.h:1799
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1583
UniquePtr< const Elem > libMesh::Elem::build_side_ptr ( const unsigned int  i,
bool  proxy = true 
) const
inlineinherited

Definition at line 1918 of file elem.h.

References libMesh::Elem::build_side_ptr().

1919 {
1920  // Call the non-const version of this function, return the result as
1921  // a UniquePtr<const Elem>.
1922  Elem * me = const_cast<Elem *>(this);
1923  const Elem * s = const_cast<const Elem *>(me->build_side_ptr(i, proxy).release());
1924  return UniquePtr<const Elem>(s);
1925 }
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1583
Point libMesh::Elem::centroid ( ) const
virtualinherited
Returns
The centriod 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 437 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::BoundaryInfo::get_side_and_node_maps(), 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().

438 {
439  Point cp;
440 
441  for (unsigned int n=0; n<this->n_vertices(); n++)
442  cp.add (this->point(n));
443 
444  return (cp /= static_cast<Real>(this->n_vertices()));
445 }
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 2251 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(), and libMesh::Elem::parent_bracketing_nodes().

2252 {
2253  // Support the deprecated interface by calling the new,
2254  // const-correct interface and casting the result to an Elem *.
2255  libmesh_deprecated();
2256  return const_cast<Elem *>(this->child_ptr(i));
2257 }
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2232
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1583
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 1868 of file elem.h.

References libmesh_nullptr, libMesh::Elem::n_neighbors(), libMesh::Elem::neighbor_ptr(), and libMesh::Elem::parent().

1869 {
1870  for (unsigned int n=0; n<elem->n_neighbors(); n++)
1871  if (elem->neighbor_ptr(n) &&
1872  elem->neighbor_ptr(n)->parent() == this)
1873  return elem->neighbor_ptr(n);
1874 
1875  return libmesh_nullptr;
1876 }
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 1881 of file elem.h.

References libmesh_nullptr, libMesh::Elem::n_neighbors(), libMesh::Elem::neighbor_ptr(), and libMesh::Elem::parent().

1882 {
1883  for (unsigned int n=0; n<elem->n_neighbors(); n++)
1884  if (elem->neighbor_ptr(n) &&
1885  elem->neighbor_ptr(n)->parent() == this)
1886  return elem->neighbor_ptr(n);
1887 
1888  return libmesh_nullptr;
1889 }
const class libmesh_nullptr_t libmesh_nullptr
const Elem * libMesh::Elem::child_ptr ( unsigned int  i) const
inlineinherited
Returns
A 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 2232 of file elem.h.

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

Referenced by 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::Elem::add_child(), libMesh::HPCoarsenTest::add_projection(), libMesh::UnstructuredMesh::all_first_order(), libMesh::Elem::ancestor(), libMesh::Elem::bracketing_nodes(), libMesh::OldSolutionValue< Output, point_output >::check_old_context(), libMesh::Elem::child(), libMesh::Elem::coarsen(), libMesh::FEGenericBase< OutputType >::coarsened_dof_values(), libMesh::connect_children(), libMesh::UnstructuredMesh::copy_nodes_and_elements(), libMesh::MeshRefinement::eliminate_unrefined_patches(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::ExactErrorEstimator::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::TopologyMap::fill(), libMesh::Elem::find_interior_neighbors(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshRefinement::flag_elements_by_nelem_target(), libMesh::Elem::has_ancestor_children(), libMesh::Elem::is_vertex_on_parent(), libMesh::MeshTools::libmesh_assert_no_links_to_elem(), libMesh::MeshTools::libmesh_assert_topology_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_valid_refinement_tree(), 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::refine(), libMesh::Elem::replace_child(), libMesh::Elem::set_p_level(), libMesh::Partitioner::set_parent_processor_ids(), libMesh::MeshTools::Modification::smooth(), 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::XdrIO::write_serialized_connectivity().

2233 {
2236 
2237  return _children[i];
2238 }
libmesh_assert(j)
Elem ** _children
Definition: elem.h:1534
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 2241 of file elem.h.

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

2242 {
2245 
2246  return _children[i];
2247 }
libmesh_assert(j)
Elem ** _children
Definition: elem.h:1534
void libMesh::DofObject::clear_dofs ( )
inlineinherited

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

Definition at line 590 of file dof_object.h.

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

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

591 {
592  // vector swap trick to force deallocation
593  index_buffer_t().swap(_idx_buf);
594 
595  libmesh_assert_equal_to (this->n_systems(), 0);
596  libmesh_assert (_idx_buf.empty());
597 }
libmesh_assert(j)
std::vector< index_t > index_buffer_t
Definition: dof_object.h:476
index_buffer_t _idx_buf
Definition: dof_object.h:477
unsigned int n_systems() const
Definition: dof_object.h:718
void libMesh::DofObject::clear_old_dof_object ( )
inherited

Sets the old_dof_object to libmesh_nullptr

Definition at line 134 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().

135 {
136  delete this->old_dof_object;
138 }
const class libmesh_nullptr_t libmesh_nullptr
DofObject * old_dof_object
Definition: dof_object.h:89
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 2494 of file elem.C.

References libMesh::Elem::point_test().

Referenced by libMesh::OldSolutionValue< Output, point_output >::check_old_context(), and libMesh::Elem::qual_bounds().

2495 {
2496  // This test uses the user's passed-in tolerance for the
2497  // bounding box test as well, thereby allowing the routine to
2498  // find points which are not only "in" the element, but also
2499  // "nearby" to within some tolerance.
2500  return this->point_test(p, tol, tol);
2501 }
bool point_test(const Point &p, Real box_tol, Real map_tol) const
Definition: elem.C:2506
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 104 of file elem_refinement.C.

References libMesh::Elem::active(), libMesh::TypeVector< T >::add_scaled(), libMesh::Elem::child_ptr(), libMesh::Elem::COARSEN, libMesh::Elem::COARSEN_INACTIVE, libMesh::Elem::embedding_matrix(), libMesh::Elem::INACTIVE, libMesh::Elem::JUST_COARSENED, libMesh::libmesh_assert(), libMesh::Elem::n_children(), libMesh::Elem::n_nodes(), libMesh::Elem::p_level(), 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().

105 {
106  libmesh_assert_equal_to (this->refinement_flag(), Elem::COARSEN_INACTIVE);
107  libmesh_assert (!this->active());
108 
109  // We no longer delete children until MeshRefinement::contract()
110  // delete [] _children;
111  // _children = libmesh_nullptr;
112 
113  unsigned int parent_p_level = 0;
114 
115  // re-compute hanging node nodal locations
116  for (unsigned int c=0; c<this->n_children(); c++)
117  {
118  Elem * mychild = this->child_ptr(c);
119  if (mychild == remote_elem)
120  continue;
121  for (unsigned int nc=0; nc<mychild->n_nodes(); nc++)
122  {
123  Point new_pos;
124  bool calculated_new_pos = false;
125 
126  for (unsigned int n=0; n<this->n_nodes(); n++)
127  {
128  // The value from the embedding matrix
129  const float em_val = this->embedding_matrix(c,nc,n);
130 
131  // The node location is somewhere between existing vertices
132  if ((em_val != 0.) && (em_val != 1.))
133  {
134  new_pos.add_scaled (this->point(n), em_val);
135  calculated_new_pos = true;
136  }
137  }
138 
139  if (calculated_new_pos)
140  {
141  //Move the existing node back into it's original location
142  for (unsigned int i=0; i<LIBMESH_DIM; i++)
143  {
144  Point & child_node = mychild->point(nc);
145  child_node(i)=new_pos(i);
146  }
147  }
148  }
149  }
150 
151  for (unsigned int c=0; c<this->n_children(); c++)
152  {
153  Elem * mychild = this->child_ptr(c);
154  if (mychild == remote_elem)
155  continue;
156  libmesh_assert_equal_to (mychild->refinement_flag(), Elem::COARSEN);
157  mychild->set_refinement_flag(Elem::INACTIVE);
158  if (mychild->p_level() > parent_p_level)
159  parent_p_level = mychild->p_level();
160  }
161 
163  this->set_p_level(parent_p_level);
164 
165  libmesh_assert (this->active());
166 }
void set_p_level(const unsigned int p)
Definition: elem.h:2343
bool active() const
Definition: elem.h:2053
void set_refinement_flag(const RefinementState rflag)
Definition: elem.h:2297
libmesh_assert(j)
virtual unsigned int n_nodes() const =0
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2232
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:1583
const Point & point(const unsigned int i) const
Definition: elem.h:1661
RefinementState refinement_flag() const
Definition: elem.h:2289
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 2413 of file elem.h.

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

2415 {
2416  // Order the two so that n0 < n1
2417  if (n0 > n1) std::swap (n0, n1);
2418 
2419  return Utility::hashword2(n0, n1);
2420 }
void swap(Iterator &lhs, Iterator &rhs)
uint32_t hashword2(const uint32_t &first, const uint32_t &second, uint32_t initval=0)
Definition: hashword.h:207
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 2425 of file elem.h.

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

2428 {
2429  // Order the numbers such that n0 < n1 < n2.
2430  // We'll do it in 3 steps like this:
2431  //
2432  // n0 n1 n2
2433  // min(n0,n1) max(n0,n1) n2
2434  // min(n0,n1) min(n2,max(n0,n1) max(n2,max(n0,n1)
2435  // |\ /| |
2436  // | \ / | |
2437  // | / | |
2438  // | / \| |
2439  // gb min= min max gb max
2440 
2441  // Step 1
2442  if (n0 > n1) std::swap (n0, n1);
2443 
2444  // Step 2
2445  if (n1 > n2) std::swap (n1, n2);
2446 
2447  // Step 3
2448  if (n0 > n1) std::swap (n0, n1);
2449 
2450  libmesh_assert ((n0 < n1) && (n1 < n2));
2451 
2452  dof_id_type array[3] = {n0, n1, n2};
2453  return Utility::hashword(array, 3);
2454 }
libmesh_assert(j)
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 2459 of file elem.h.

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

2463 {
2464  // Sort first
2465  // Step 1
2466  if (n0 > n1) std::swap (n0, n1);
2467 
2468  // Step 2
2469  if (n2 > n3) std::swap (n2, n3);
2470 
2471  // Step 3
2472  if (n0 > n2) std::swap (n0, n2);
2473 
2474  // Step 4
2475  if (n1 > n3) std::swap (n1, n3);
2476 
2477  // Finally sort step 5
2478  if (n1 > n2) std::swap (n1, n2);
2479 
2480  libmesh_assert ((n0 < n1) && (n1 < n2) && (n2 < n3));
2481 
2482  dof_id_type array[4] = {n0, n1, n2, n3};
2483  return Utility::hashword(array, 4);
2484 }
libmesh_assert(j)
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
void libMesh::InfHex8::connectivity ( const unsigned int  sc,
const IOPackage  iop,
std::vector< dof_id_type > &  conn 
) const
virtual
Returns
The connectivity for this element in a specific format, which is specified by the IOPackage tag.

Implements libMesh::Elem.

Definition at line 244 of file cell_inf_hex8.C.

References _embedding_matrix, libMesh::Elem::_nodes, libMesh::INVALID_IO_PACKAGE, libMesh::libmesh_assert(), n_sub_elem(), libMesh::Elem::node_id(), and libMesh::TECPLOT.

Referenced by default_order().

247 {
249  libmesh_assert_less (sc, this->n_sub_elem());
250  libmesh_assert_not_equal_to (iop, INVALID_IO_PACKAGE);
251 
252  switch (iop)
253  {
254  case TECPLOT:
255  {
256  conn.resize(8);
257  conn[0] = this->node_id(0)+1;
258  conn[1] = this->node_id(1)+1;
259  conn[2] = this->node_id(2)+1;
260  conn[3] = this->node_id(3)+1;
261  conn[4] = this->node_id(4)+1;
262  conn[5] = this->node_id(5)+1;
263  conn[6] = this->node_id(6)+1;
264  conn[7] = this->node_id(7)+1;
265  return;
266  }
267 
268  default:
269  libmesh_error_msg("Unsupported IO package " << iop);
270  }
271 }
Node ** _nodes
Definition: elem.h:1522
virtual unsigned int n_sub_elem() const libmesh_override
Definition: cell_inf_hex8.h:80
libmesh_assert(j)
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:1683
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 570 of file elem.C.

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

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

571 {
572  unsigned int num_contained_edges = 0;
573 
574  // Our vertices are the first numbered nodes
575  for (unsigned int n = 0; n != e->n_vertices(); ++n)
576  {
577  if (this->contains_point(e->point(n)))
578  {
579  num_contained_edges++;
580  if (num_contained_edges>=2)
581  {
582  return true;
583  }
584  }
585  }
586  return false;
587 }
virtual bool contains_point(const Point &p, Real tol=TOLERANCE) const
Definition: elem.C:2469
bool libMesh::InfHex8::contains_point ( const Point p,
Real  tol = TOLERANCE 
) const
virtual
Returns
true when this element contains the point p. Customized for infinite elements, since knowledge about the envelope can be helpful.

Reimplemented from libMesh::Elem.

Definition at line 182 of file cell_inf_hex8.C.

References default_order(), libMesh::InfCell::dim(), libMesh::FEInterface::inverse_map(), std::min(), libMesh::TensorTools::norm_sq(), libMesh::TypeVector< T >::norm_sq(), libMesh::FEInterface::on_reference_element(), libMesh::InfCell::origin(), libMesh::Elem::point(), libMesh::Real, and type().

Referenced by vtk_element_type().

183 {
184  /*
185  * For infinite elements with linear base interpolation:
186  *
187  * make use of the fact that infinite elements do not
188  * live inside the envelope. Use a fast scheme to
189  * check whether point \p p is inside or outside
190  * our relevant part of the envelope. Note that
191  * this is not exclusive: only when the distance is less,
192  * we are safe. Otherwise, we cannot say anything. The
193  * envelope may be non-spherical, the physical point may lie
194  * inside the envelope, outside the envelope, or even inside
195  * this infinite element. Therefore if this fails,
196  * fall back to the FEInterface::inverse_map()
197  */
198  const Point my_origin (this->origin());
199 
200  /*
201  * determine the minimal distance of the base from the origin
202  * Use norm_sq() instead of norm(), it is faster
203  */
204  const Real min_distance_sq = std::min((Point(this->point(0)-my_origin)).norm_sq(),
205  std::min((Point(this->point(1)-my_origin)).norm_sq(),
206  std::min((Point(this->point(2)-my_origin)).norm_sq(),
207  (Point(this->point(3)-my_origin)).norm_sq())));
208 
209  /*
210  * work with 1% allowable deviation. We can still fall
211  * back to the InfFE::inverse_map()
212  */
213  const Real conservative_p_dist_sq = 1.01 * (Point(p-my_origin).norm_sq());
214 
215 
216 
217  if (conservative_p_dist_sq < min_distance_sq)
218  {
219  /*
220  * the physical point is definitely not contained in the element
221  */
222  return false;
223  }
224  else
225  {
226  /*
227  * Declare a basic FEType. Will use default in the base,
228  * and something else (not important) in radial direction.
229  */
230  FEType fe_type(default_order());
231 
232  const Point mapped_point = FEInterface::inverse_map(dim(),
233  fe_type,
234  this,
235  p,
236  tol,
237  false);
238 
239  return FEInterface::on_reference_element(mapped_point, this->type(), tol);
240  }
241 }
virtual Order default_order() const libmesh_override
virtual Point origin() const libmesh_override
Definition: cell_inf.h:71
virtual ElemType type() const libmesh_override
Definition: cell_inf_hex8.h:75
static Point inverse_map(const unsigned int dim, const FEType &fe_t, const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true)
Definition: fe_interface.C:556
static bool on_reference_element(const Point &p, const ElemType t, const Real eps=TOLERANCE)
Definition: fe_interface.C:618
virtual unsigned int dim() const libmesh_override
Definition: cell_inf.h:60
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Point & point(const unsigned int i) const
Definition: elem.h:1661
long double min(long double a, double b)
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 559 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().

560 {
561  // Our vertices are the first numbered nodes
562  for (unsigned int n = 0; n != e->n_vertices(); ++n)
563  if (this->contains_point(e->point(n)))
564  return true;
565  return false;
566 }
virtual bool contains_point(const Point &p, Real tol=TOLERANCE) const
Definition: elem.C:2469
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 170 of file elem_refinement.C.

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

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

171 {
172  // Subactive elements get deleted entirely, not contracted
173  libmesh_assert (this->active());
174 
175  // Active contracted elements no longer can have children
176  delete [] _children;
178 
179  if (this->refinement_flag() == Elem::JUST_COARSENED)
181 }
bool active() const
Definition: elem.h:2053
const class libmesh_nullptr_t libmesh_nullptr
void set_refinement_flag(const RefinementState rflag)
Definition: elem.h:2297
libmesh_assert(j)
Elem ** _children
Definition: elem.h:1534
RefinementState refinement_flag() const
Definition: elem.h:2289
void libMesh::DofObject::debug_buffer ( ) const
inherited

Print our buffer for debugging.

Definition at line 542 of file dof_object.C.

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

543 {
544  libMesh::out << " [ ";
545  for (std::size_t i=0; i<_idx_buf.size(); i++)
546  libMesh::out << _idx_buf[i] << " ";
547  libMesh::out << "]\n";
548 }
index_buffer_t _idx_buf
Definition: dof_object.h:477
OStreamProxy out(std::cout)
virtual Order libMesh::InfHex8::default_order ( ) const
inlinevirtual
Returns
FIRST.

Implements libMesh::Elem.

Definition at line 114 of file cell_inf_hex8.h.

References build_edge_ptr(), build_side_ptr(), connectivity(), and libMesh::FIRST.

Referenced by contains_point().

114 { return FIRST; }
virtual unsigned int libMesh::InfCell::dim ( ) const
inlinevirtualinherited
Returns
3, the dimensionality of the object.

Implements libMesh::Elem.

Definition at line 60 of file cell_inf.h.

Referenced by libMesh::InfPrism6::contains_point(), and contains_point().

60 { return 3; }
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 802 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::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(), libMesh::DofMap::set_nonlocal_dof_objects(), and libMesh::System::zero_variable().

805 {
806  libmesh_assert_less (s, this->n_systems());
807  libmesh_assert_less (var, this->n_vars(s));
808  libmesh_assert_less (comp, this->n_comp(s,var));
809 
810  const unsigned int
811  vg = this->var_to_vg(s,var),
812  start_idx_sys = this->start_idx(s);
813 
814  libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());
815 
816  const dof_id_type
817  base_idx = _idx_buf[start_idx_sys + 2*vg + 1];
818 
819  // if the first component is invalid, they
820  // are all invalid
821  if (base_idx == invalid_id)
822  return invalid_id;
823 
824  // otherwise the index is the first component
825  // index augemented by the component number
826  else
827  {
828  const unsigned int
829  ncg = this->n_comp_group(s,vg),
830  vig = this->system_var_to_vg_var(s,vg,var);
831 
832  // std::cout << "base_idx, var, vg, vig, ncg, comp="
833  // << base_idx << " "
834  // << var << " "
835  // << vg << " "
836  // << vig << " "
837  // << ncg << " "
838  // << comp << '\n';
839 
840  return cast_int<dof_id_type>(base_idx + vig*ncg + comp);
841  }
842 }
unsigned int n_comp_group(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:785
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:737
unsigned int system_var_to_vg_var(const unsigned int s, const unsigned int vg, const unsigned int var) const
Definition: dof_object.h:957
static const dof_id_type invalid_id
Definition: dof_object.h:334
unsigned int start_idx(const unsigned int s) const
Definition: dof_object.h:870
unsigned int var_to_vg(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:938
index_buffer_t _idx_buf
Definition: dof_object.h:477
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:772
unsigned int n_systems() const
Definition: dof_object.h:718
uint8_t dof_id_type
Definition: id_types.h:64
virtual float libMesh::InfHex8::embedding_matrix ( const unsigned int  i,
const unsigned int  j,
const unsigned int  k 
) const
inlineprotectedvirtual

Matrix used to create the elements children.

Implements libMesh::Elem.

Definition at line 174 of file cell_inf_hex8.h.

References _embedding_matrix.

177  { return _embedding_matrix[i][j][k]; }
static const float _embedding_matrix[4][8][8]
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 1443 of file elem.h.

References libMesh::Elem::compute_key().

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

1443 { 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 1674 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::child_ptr(), libMesh::Elem::family_tree(), libMesh::Elem::is_remote(), libMesh::libmesh_assert(), libMesh::Elem::n_children(), and libMesh::Elem::subactive().

Referenced by libMesh::Elem::family_tree(), and libMesh::MeshCommunication::gather_neighboring_elements().

1676 {
1677  // The "family tree" doesn't include subactive elements
1678  libmesh_assert(!this->subactive());
1679 
1680  // Clear the vector if the flag reset tells us to.
1681  if (reset)
1682  family.clear();
1683 
1684  // Add this element to the family tree.
1685  family.push_back(this);
1686 
1687  // Recurse into the elements children, if it has them.
1688  // Do not clear the vector any more.
1689  if (!this->active())
1690  for (unsigned int c=0; c<this->n_children(); c++)
1691  if (!this->child_ptr(c)->is_remote())
1692  this->child_ptr(c)->family_tree (family, false);
1693 }
bool subactive() const
Definition: elem.h:2071
bool active() const
Definition: elem.h:2053
libmesh_assert(j)
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2232
virtual bool is_remote() const
Definition: elem.h:487
virtual unsigned int n_children() const =0
void family_tree(std::vector< const Elem * > &family, const bool reset=true) const
Definition: elem.C:1674
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 1795 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::child_ptr(), libMesh::Elem::family_tree_by_neighbor(), libMesh::Elem::has_neighbor(), libMesh::libmesh_assert(), libMesh::Elem::n_children(), libMesh::remote_elem, and libMesh::Elem::subactive().

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

1798 {
1799  // The "family tree" doesn't include subactive elements
1800  libmesh_assert(!this->subactive());
1801 
1802  // Clear the vector if the flag reset tells us to.
1803  if (reset)
1804  family.clear();
1805 
1806  // This only makes sense if we're already a neighbor
1807  libmesh_assert (this->has_neighbor(neighbor_in));
1808 
1809  // Add this element to the family tree.
1810  family.push_back(this);
1811 
1812  // Recurse into the elements children, if it's not active.
1813  // Do not clear the vector any more.
1814  if (!this->active())
1815  for (unsigned int c=0; c<this->n_children(); c++)
1816  {
1817  const Elem * current_child = this->child_ptr(c);
1818  if (current_child != remote_elem && current_child->has_neighbor(neighbor_in))
1819  current_child->family_tree_by_neighbor (family, neighbor_in, false);
1820  }
1821 }
bool subactive() const
Definition: elem.h:2071
bool active() const
Definition: elem.h:2053
libmesh_assert(j)
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2232
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:1583
bool has_neighbor(const Elem *elem) const
Definition: elem.h:1856
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 1741 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::libmesh_assert(), 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().

1744 {
1745  // The "family tree" doesn't include subactive elements
1746  libmesh_assert(!this->subactive());
1747 
1748  // Clear the vector if the flag reset tells us to.
1749  if (reset)
1750  family.clear();
1751 
1752  libmesh_assert_less (s, this->n_sides());
1753 
1754  // Add this element to the family tree.
1755  family.push_back(this);
1756 
1757  // Recurse into the elements children, if it has them.
1758  // Do not clear the vector any more.
1759  if (!this->active())
1760  for (unsigned int c=0; c<this->n_children(); c++)
1761  if (!this->child_ptr(c)->is_remote() && this->is_child_on_side(c, s))
1762  this->child_ptr(c)->family_tree_by_side (family, s, false);
1763 }
void family_tree_by_side(std::vector< const Elem * > &family, const unsigned int side, const bool reset=true) const
Definition: elem.C:1741
bool subactive() const
Definition: elem.h:2071
bool active() const
Definition: elem.h:2053
virtual bool is_child_on_side(const unsigned int c, const unsigned int s) const =0
libmesh_assert(j)
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2232
virtual unsigned int n_sides() const =0
virtual bool is_remote() const
Definition: elem.h:487
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 1852 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::child_ptr(), libMesh::Elem::family_tree_by_subneighbor(), libMesh::Elem::has_neighbor(), libMesh::Elem::is_ancestor_of(), libMesh::libmesh_assert(), libMesh::Elem::n_children(), libMesh::Elem::n_sides(), libMesh::Elem::neighbor_ptr(), libMesh::Elem::parent(), libMesh::remote_elem, and libMesh::Elem::subactive().

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

1856 {
1857  // The "family tree" doesn't include subactive elements
1858  libmesh_assert(!this->subactive());
1859 
1860  // Clear the vector if the flag reset tells us to.
1861  if (reset)
1862  family.clear();
1863 
1864  // To simplifly this function we need an existing neighbor
1865  libmesh_assert (neighbor_in);
1866  libmesh_assert_not_equal_to (neighbor_in, remote_elem);
1867  libmesh_assert (this->has_neighbor(neighbor_in));
1868 
1869  // This only makes sense if subneighbor descends from neighbor
1870  libmesh_assert (subneighbor);
1871  libmesh_assert_not_equal_to (subneighbor, remote_elem);
1872  libmesh_assert (neighbor_in->is_ancestor_of(subneighbor));
1873 
1874  // Add this element to the family tree if applicable.
1875  if (neighbor_in == subneighbor)
1876  family.push_back(this);
1877 
1878  // Recurse into the elements children, if it's not active.
1879  // Do not clear the vector any more.
1880  if (!this->active())
1881  for (unsigned int c=0; c != this->n_children(); ++c)
1882  {
1883  const Elem * current_child = this->child_ptr(c);
1884  if (current_child != remote_elem)
1885  for (unsigned int s=0; s != current_child->n_sides(); ++s)
1886  {
1887  const Elem * child_neigh = current_child->neighbor_ptr(s);
1888  if (child_neigh &&
1889  (child_neigh == neighbor_in ||
1890  (child_neigh->parent() == neighbor_in &&
1891  child_neigh->is_ancestor_of(subneighbor))))
1892  current_child->family_tree_by_subneighbor (family, child_neigh,
1893  subneighbor, false);
1894  }
1895  }
1896 }
bool subactive() const
Definition: elem.h:2071
bool active() const
Definition: elem.h:2053
libmesh_assert(j)
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2232
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:1583
bool has_neighbor(const Elem *elem) const
Definition: elem.h:1856
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 758 of file elem.C.

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

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

761 {
762  // Simple but perhaps suboptimal code: find elements containing the
763  // first point, then winnow this set down by removing elements which
764  // don't also contain the second point
765 
766  libmesh_assert(this->contains_point(p2));
767  this->find_point_neighbors(p1, neighbor_set);
768 
769  std::set<const Elem *>::iterator it = neighbor_set.begin();
770  const std::set<const Elem *>::iterator end = neighbor_set.end();
771 
772  while (it != end)
773  {
774  std::set<const Elem *>::iterator current = it++;
775 
776  const Elem * elem = *current;
777  // This won't invalidate iterator it, because it is already
778  // pointing to the next element
779  if (!elem->contains_point(p2))
780  neighbor_set.erase(current);
781  }
782 }
IterBase * end
void find_point_neighbors(const Point &p, std::set< const Elem * > &neighbor_set) const
Definition: elem.C:591
libmesh_assert(j)
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1583
virtual bool contains_point(const Point &p, Real tol=TOLERANCE) const
Definition: elem.C:2469
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 786 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::active_family_tree_by_neighbor(), libMesh::Elem::contains_edge_of(), end, libMesh::Elem::n_sides(), libMesh::Elem::neighbor_ptr(), and libMesh::remote_elem.

787 {
788  neighbor_set.clear();
789  neighbor_set.insert(this);
790 
791  std::set<const Elem *> untested_set, next_untested_set;
792  untested_set.insert(this);
793 
794  while (!untested_set.empty())
795  {
796  // Loop over all the elements in the patch that haven't already
797  // been tested
798  std::set<const Elem *>::const_iterator it = untested_set.begin();
799  const std::set<const Elem *>::const_iterator end = untested_set.end();
800 
801  for (; it != end; ++it)
802  {
803  const Elem * elem = *it;
804 
805  for (unsigned int s=0; s<elem->n_sides(); s++)
806  {
807  const Elem * current_neighbor = elem->neighbor_ptr(s);
808  if (current_neighbor &&
809  current_neighbor != remote_elem) // we have a real neighbor on this side
810  {
811  if (current_neighbor->active()) // ... if it is active
812  {
813  if (this->contains_edge_of(current_neighbor) // ... and touches us
814  || current_neighbor->contains_edge_of(this))
815  {
816  // Make sure we'll test it
817  if (!neighbor_set.count(current_neighbor))
818  next_untested_set.insert (current_neighbor);
819 
820  // And add it
821  neighbor_set.insert (current_neighbor);
822  }
823  }
824 #ifdef LIBMESH_ENABLE_AMR
825  else // ... the neighbor is *not* active,
826  { // ... so add *all* neighboring
827  // active children
828  std::vector<const Elem *> active_neighbor_children;
829 
830  current_neighbor->active_family_tree_by_neighbor
831  (active_neighbor_children, elem);
832 
833  std::vector<const Elem *>::const_iterator
834  child_it = active_neighbor_children.begin();
835  const std::vector<const Elem *>::const_iterator
836  child_end = active_neighbor_children.end();
837  for (; child_it != child_end; ++child_it)
838  {
839  const Elem * current_child = *child_it;
840  if (this->contains_edge_of(*child_it) ||
841  (*child_it)->contains_edge_of(this))
842  {
843  // Make sure we'll test it
844  if (!neighbor_set.count(current_child))
845  next_untested_set.insert (current_child);
846 
847  neighbor_set.insert (current_child);
848  }
849  }
850  }
851 #endif // #ifdef LIBMESH_ENABLE_AMR
852  }
853  }
854  }
855  untested_set.swap(next_untested_set);
856  next_untested_set.clear();
857  }
858 }
IterBase * end
bool contains_edge_of(const Elem *e) const
Definition: elem.C:570
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1583
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 861 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::child(), libMesh::Elem::child_ptr(), 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::libmesh_assert(), libMesh::Elem::n_children(), libMesh::Elem::n_nodes(), libMesh::Elem::point(), and libMesh::Elem::subactive().

Referenced by libMesh::ParmetisPartitioner::build_graph(), libMesh::MeshRefinement::limit_overrefined_boundary(), libMesh::MeshRefinement::limit_underrefined_boundary(), and libMesh::MetisPartitioner::partition_range().

862 {
863  neighbor_set.clear();
864 
865  if ((this->dim() >= LIBMESH_DIM) ||
866  !this->interior_parent())
867  return;
868 
869  const Elem * ip = this->interior_parent();
870  libmesh_assert (ip->contains_vertex_of(this) ||
871  this->contains_vertex_of(ip));
872 
873  libmesh_assert (!ip->subactive());
874 
875 #ifdef LIBMESH_ENABLE_AMR
876  while (!ip->active()) // only possible with AMR, be careful because
877  { // ip->child_ptr(c) is only good with AMR.
878  for (unsigned int c = 0; c != ip->n_children(); ++c)
879  {
880  const Elem * child = ip->child_ptr(c);
881  if (child->contains_vertex_of(this) ||
882  this->contains_vertex_of(child))
883  {
884  ip = child;
885  break;
886  }
887  }
888  }
889 #endif
890 
891  this->find_point_neighbors(neighbor_set, ip);
892 
893  // Now we have all point neighbors from the interior manifold, but
894  // we need to weed out any neighbors that *only* intersect us at one
895  // point (or at one edge, if we're a 1-D element in 3D).
896  //
897  // The refinement hierarchy helps us here: if the interior element
898  // has a lower or equal refinement level then we can discard it iff
899  // it doesn't contain all our vertices. If it has a higher
900  // refinement level then we can discard it iff we don't contain at
901  // least dim()+1 of its vertices
902  std::set<const Elem *>::iterator it = neighbor_set.begin();
903  const std::set<const Elem *>::iterator end = neighbor_set.end();
904 
905  while (it != end)
906  {
907  std::set<const Elem *>::iterator current = it++;
908  const Elem * elem = *current;
909 
910  // This won't invalidate iterator it, because it is already
911  // pointing to the next element
912  if (elem->level() > this->level())
913  {
914  unsigned int vertices_contained = 0;
915  for (unsigned int p=0; p < elem->n_nodes(); ++p)
916  if (this->contains_point(elem->point(p)))
917  vertices_contained++;
918 
919  if (vertices_contained <= this->dim())
920  {
921  neighbor_set.erase(current);
922  continue;
923  }
924  }
925  else
926  {
927  for (unsigned int p=0; p < this->n_nodes(); ++p)
928  {
929  if (!elem->contains_point(this->point(p)))
930  {
931  neighbor_set.erase(current);
932  break;
933  }
934  }
935  }
936  }
937 }
const Elem * interior_parent() const
Definition: elem.C:941
IterBase * end
Elem * child(const unsigned int i) const
Definition: elem.h:2251
void find_point_neighbors(const Point &p, std::set< const Elem * > &neighbor_set) const
Definition: elem.C:591
bool contains_vertex_of(const Elem *e) const
Definition: elem.C:559
libmesh_assert(j)
virtual unsigned int n_nodes() const =0
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2232
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1583
virtual unsigned int dim() const =0
unsigned int level() const
Definition: elem.h:2184
virtual bool contains_point(const Point &p, Real tol=TOLERANCE) const
Definition: elem.C:2469
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 591 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::active_family_tree_by_neighbor(), libMesh::Elem::contains_point(), end, libMesh::libmesh_assert(), libMesh::Elem::n_sides(), libMesh::Elem::neighbor_ptr(), and libMesh::remote_elem.

Referenced by libMesh::MeshRefinement::enforce_mismatch_limit_prior_to_refinement(), libMesh::AdjointRefinementEstimator::estimate_error(), 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()().

593 {
594  libmesh_assert(this->contains_point(p));
595  libmesh_assert(this->active());
596 
597  neighbor_set.clear();
598  neighbor_set.insert(this);
599 
600  std::set<const Elem *> untested_set, next_untested_set;
601  untested_set.insert(this);
602 
603  while (!untested_set.empty())
604  {
605  // Loop over all the elements in the patch that haven't already
606  // been tested
607  std::set<const Elem *>::const_iterator it = untested_set.begin();
608  const std::set<const Elem *>::const_iterator end = untested_set.end();
609 
610  for (; it != end; ++it)
611  {
612  const Elem * elem = *it;
613 
614  for (unsigned int s=0; s<elem->n_sides(); s++)
615  {
616  const Elem * current_neighbor = elem->neighbor_ptr(s);
617  if (current_neighbor &&
618  current_neighbor != remote_elem) // we have a real neighbor on this side
619  {
620  if (current_neighbor->active()) // ... if it is active
621  {
622  if (current_neighbor->contains_point(p)) // ... and touches p
623  {
624  // Make sure we'll test it
625  if (!neighbor_set.count(current_neighbor))
626  next_untested_set.insert (current_neighbor);
627 
628  // And add it
629  neighbor_set.insert (current_neighbor);
630  }
631  }
632 #ifdef LIBMESH_ENABLE_AMR
633  else // ... the neighbor is *not* active,
634  { // ... so add *all* neighboring
635  // active children that touch p
636  std::vector<const Elem *> active_neighbor_children;
637 
638  current_neighbor->active_family_tree_by_neighbor
639  (active_neighbor_children, elem);
640 
641  std::vector<const Elem *>::const_iterator
642  child_it = active_neighbor_children.begin();
643  const std::vector<const Elem *>::const_iterator
644  child_end = active_neighbor_children.end();
645  for (; child_it != child_end; ++child_it)
646  {
647  const Elem * current_child = *child_it;
648  if (current_child->contains_point(p))
649  {
650  // Make sure we'll test it
651  if (!neighbor_set.count(current_child))
652  next_untested_set.insert (current_child);
653 
654  neighbor_set.insert (current_child);
655  }
656  }
657  }
658 #endif // #ifdef LIBMESH_ENABLE_AMR
659  }
660  }
661  }
662  untested_set.swap(next_untested_set);
663  next_untested_set.clear();
664  }
665 }
bool active() const
Definition: elem.h:2053
IterBase * end
libmesh_assert(j)
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1583
virtual bool contains_point(const Point &p, Real tol=TOLERANCE) const
Definition: elem.C:2469
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 669 of file elem.C.

References libMesh::Elem::find_point_neighbors().

670 {
671  this->find_point_neighbors(neighbor_set, this);
672 }
void find_point_neighbors(const Point &p, std::set< const Elem * > &neighbor_set) const
Definition: elem.C:591
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 676 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::active_family_tree_by_neighbor(), libMesh::Elem::contains_vertex_of(), end, libMesh::libmesh_assert(), libMesh::Elem::n_sides(), libMesh::Elem::neighbor_ptr(), and libMesh::remote_elem.

678 {
679  libmesh_assert(start_elem);
680  libmesh_assert(start_elem->active());
681  libmesh_assert(start_elem->contains_vertex_of(this) ||
682  this->contains_vertex_of(start_elem));
683 
684  neighbor_set.clear();
685  neighbor_set.insert(start_elem);
686 
687  std::set<const Elem *> untested_set, next_untested_set;
688  untested_set.insert(start_elem);
689 
690  while (!untested_set.empty())
691  {
692  // Loop over all the elements in the patch that haven't already
693  // been tested
694  std::set<const Elem *>::const_iterator it = untested_set.begin();
695  const std::set<const Elem *>::const_iterator end = untested_set.end();
696 
697  for (; it != end; ++it)
698  {
699  const Elem * elem = *it;
700 
701  for (unsigned int s=0; s<elem->n_sides(); s++)
702  {
703  const Elem * current_neighbor = elem->neighbor_ptr(s);
704  if (current_neighbor &&
705  current_neighbor != remote_elem) // we have a real neighbor on this side
706  {
707  if (current_neighbor->active()) // ... if it is active
708  {
709  if (this->contains_vertex_of(current_neighbor) // ... and touches us
710  || current_neighbor->contains_vertex_of(this))
711  {
712  // Make sure we'll test it
713  if (!neighbor_set.count(current_neighbor))
714  next_untested_set.insert (current_neighbor);
715 
716  // And add it
717  neighbor_set.insert (current_neighbor);
718  }
719  }
720 #ifdef LIBMESH_ENABLE_AMR
721  else // ... the neighbor is *not* active,
722  { // ... so add *all* neighboring
723  // active children
724  std::vector<const Elem *> active_neighbor_children;
725 
726  current_neighbor->active_family_tree_by_neighbor
727  (active_neighbor_children, elem);
728 
729  std::vector<const Elem *>::const_iterator
730  child_it = active_neighbor_children.begin();
731  const std::vector<const Elem *>::const_iterator
732  child_end = active_neighbor_children.end();
733  for (; child_it != child_end; ++child_it)
734  {
735  const Elem * current_child = *child_it;
736  if (this->contains_vertex_of(current_child) ||
737  (current_child)->contains_vertex_of(this))
738  {
739  // Make sure we'll test it
740  if (!neighbor_set.count(current_child))
741  next_untested_set.insert (current_child);
742 
743  neighbor_set.insert (current_child);
744  }
745  }
746  }
747 #endif // #ifdef LIBMESH_ENABLE_AMR
748  }
749  }
750  }
751  untested_set.swap(next_untested_set);
752  next_untested_set.clear();
753  }
754 }
IterBase * end
bool contains_vertex_of(const Elem *e) const
Definition: elem.C:559
libmesh_assert(j)
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1583
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 2746 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::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().

2747 {
2748  switch (et)
2749  {
2750  case EDGE2:
2751  case EDGE3:
2752  case EDGE4:
2753  return EDGE2;
2754  case TRI3:
2755  case TRI6:
2756  return TRI3;
2757  case TRISHELL3:
2758  return TRISHELL3;
2759  case QUAD4:
2760  case QUAD8:
2761  case QUAD9:
2762  return QUAD4;
2763  case QUADSHELL4:
2764  return QUADSHELL4;
2765  case TET4:
2766  case TET10:
2767  return TET4;
2768  case HEX8:
2769  case HEX27:
2770  case HEX20:
2771  return HEX8;
2772  case PRISM6:
2773  case PRISM15:
2774  case PRISM18:
2775  return PRISM6;
2776  case PYRAMID5:
2777  case PYRAMID13:
2778  case PYRAMID14:
2779  return PYRAMID5;
2780 
2781 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
2782 
2783  case INFQUAD4:
2784  case INFQUAD6:
2785  return INFQUAD4;
2786  case INFHEX8:
2787  case INFHEX16:
2788  case INFHEX18:
2789  return INFHEX8;
2790  case INFPRISM6:
2791  case INFPRISM12:
2792  return INFPRISM6;
2793 
2794 #endif
2795 
2796  default:
2797  // unknown element
2798  return INVALID_ELEM;
2799  }
2800 }
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 2617 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().

2618 {
2619  std::ostringstream oss;
2620 
2621  oss << " Elem Information" << '\n'
2622  << " id()=";
2623 
2624  if (this->valid_id())
2625  oss << this->id();
2626  else
2627  oss << "invalid";
2628 
2629 #ifdef LIBMESH_ENABLE_UNIQUE_ID
2630  oss << ", unique_id()=";
2631  if (this->valid_unique_id())
2632  oss << this->unique_id();
2633  else
2634  oss << "invalid";
2635 #endif
2636 
2637  oss << ", processor_id()=" << this->processor_id() << '\n';
2638 
2639  oss << " type()=" << Utility::enum_to_string(this->type()) << '\n'
2640  << " dim()=" << this->dim() << '\n'
2641  << " n_nodes()=" << this->n_nodes() << '\n';
2642 
2643  for (unsigned int n=0; n != this->n_nodes(); ++n)
2644  oss << " " << n << this->node_ref(n);
2645 
2646  oss << " n_sides()=" << this->n_sides() << '\n';
2647 
2648  for (unsigned int s=0; s != this->n_sides(); ++s)
2649  {
2650  oss << " neighbor(" << s << ")=";
2651  if (this->neighbor_ptr(s))
2652  oss << this->neighbor_ptr(s)->id() << '\n';
2653  else
2654  oss << "NULL\n";
2655  }
2656 
2657  oss << " hmin()=" << this->hmin()
2658  << ", hmax()=" << this->hmax() << '\n'
2659  << " volume()=" << this->volume() << '\n'
2660  << " active()=" << this->active()
2661  << ", ancestor()=" << this->ancestor()
2662  << ", subactive()=" << this->subactive()
2663  << ", has_children()=" << this->has_children() << '\n'
2664  << " parent()=";
2665  if (this->parent())
2666  oss << this->parent()->id() << '\n';
2667  else
2668  oss << "NULL\n";
2669  oss << " level()=" << this->level()
2670  << ", p_level()=" << this->p_level() << '\n'
2671 #ifdef LIBMESH_ENABLE_AMR
2672  << " refinement_flag()=" << Utility::enum_to_string(this->refinement_flag()) << '\n'
2673  << " p_refinement_flag()=" << Utility::enum_to_string(this->p_refinement_flag()) << '\n'
2674 #endif
2675 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
2676  << " infinite()=" << this->infinite() << '\n';
2677  if (this->infinite())
2678  oss << " origin()=" << this->origin() << '\n'
2679 #endif
2680  ;
2681 
2682  oss << " DoFs=";
2683  for (unsigned int s=0; s != this->n_systems(); ++s)
2684  for (unsigned int v=0; v != this->n_vars(s); ++v)
2685  for (unsigned int c=0; c != this->n_comp(s,v); ++c)
2686  oss << '(' << s << '/' << v << '/' << this->dof_number(s,v,c) << ") ";
2687 
2688 
2689  return oss.str();
2690 }
bool ancestor() const
Definition: elem.C:1569
bool has_children() const
Definition: elem.h:2091
bool valid_id() const
Definition: dof_object.h:666
bool subactive() const
Definition: elem.h:2071
bool active() const
Definition: elem.h:2053
virtual ElemType type() const =0
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:737
unsigned int p_level() const
Definition: elem.h:2218
const Elem * parent() const
Definition: elem.h:2142
virtual Real hmin() const
Definition: elem.C:449
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
Definition: dof_object.h:802
virtual Real volume() const
Definition: elem.C:2978
bool valid_unique_id() const
Definition: dof_object.h:674
virtual bool infinite() const =0
virtual unsigned int n_nodes() const =0
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:1815
const Node & node_ref(const unsigned int i) const
Definition: elem.h:1746
RefinementState p_refinement_flag() const
Definition: elem.h:2305
virtual unsigned int n_sides() const =0
virtual Point origin() const
Definition: elem.h:1387
std::string enum_to_string(const T e)
virtual Real hmax() const
Definition: elem.C:466
virtual unsigned int dim() const =0
unsigned int level() const
Definition: elem.h:2184
RefinementState refinement_flag() const
Definition: elem.h:2289
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:772
dof_id_type id() const
Definition: dof_object.h:624
unsigned int n_systems() const
Definition: dof_object.h:718
unique_id_type unique_id() const
Definition: dof_object.h:641
processor_id_type processor_id() const
Definition: dof_object.h:686
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 1762 of file elem.h.

References libMesh::Elem::node_ptr().

1763 {
1764  // This const function has incorrectly returned a non-const pointer
1765  // for years. Now that it is reimplemented in terms of the new
1766  // interface which does return a const pointer, we need to use a
1767  // const_cast to mimic the old (incorrect) behavior. This function
1768  // is now deprecated and eventually will be removed entirely,
1769  // obviating the need for this ugly cast.
1770  libmesh_deprecated();
1771  return const_cast<Node *>(this->node_ptr(i));
1772 }
const Node * node_ptr(const unsigned int i) const
Definition: elem.h:1724
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 1777 of file elem.h.

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

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

1778 {
1779  for (unsigned int n=0; n != this->n_nodes(); ++n)
1780  if (this->_nodes[n] == node_ptr)
1781  return n;
1782 
1783  return libMesh::invalid_uint;
1784 }
Node ** _nodes
Definition: elem.h:1522
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:1724
const Node *const * libMesh::Elem::get_nodes ( ) const
inlineinherited
Returns
A pointer to an array of local node pointers.

Definition at line 1716 of file elem.h.

References libMesh::Elem::_nodes.

Referenced by libMesh::DofMap::dof_indices().

1717 {
1718  return _nodes;
1719 }
Node ** _nodes
Definition: elem.h:1522
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 2390 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().

2391 {
2392  if (p == 0)
2393  libmesh_assert_not_equal_to
2395 
2396  _p_level = cast_int<unsigned char>(p);
2397 }
unsigned char _p_level
Definition: elem.h:1563
RefinementState p_refinement_flag() const
Definition: elem.h:2305
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 847 of file elem.h.

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

847 { 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 2105 of file elem.h.

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

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

2106 {
2107 #ifdef LIBMESH_ENABLE_AMR
2108  if (_children == libmesh_nullptr)
2109  return false;
2110  else
2111  for (unsigned int c=0; c != this->n_children(); c++)
2112  if (this->child_ptr(c)->has_children())
2113  return true;
2114 #endif
2115  return false;
2116 }
bool has_children() const
Definition: elem.h:2091
const class libmesh_nullptr_t libmesh_nullptr
Elem ** _children
Definition: elem.h:1534
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2232
virtual unsigned int n_children() const =0
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 2091 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::copy_nodes_and_elements(), libMesh::TopologyMap::fill(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshRefinement::flag_elements_by_nelem_target(), libMesh::Elem::get_info(), libMesh::Elem::has_ancestor_children(), libMesh::Elem::is_linear(), libMesh::MeshTools::libmesh_assert_no_links_to_elem(), libMesh::MeshTools::libmesh_assert_topology_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_valid_refinement_tree(), 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(), and libMesh::Elem::which_child_am_i().

2092 {
2093 #ifdef LIBMESH_ENABLE_AMR
2094  if (_children == libmesh_nullptr)
2095  return false;
2096  else
2097  return true;
2098 #else
2099  return false;
2100 #endif
2101 }
const class libmesh_nullptr_t libmesh_nullptr
Elem ** _children
Definition: elem.h:1534
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 847 of file dof_object.h.

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

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

848 {
849  if (sys == libMesh::invalid_uint)
850  {
851  for (unsigned int s=0; s<this->n_systems(); s++)
852  if (this->n_vars(s))
853  return true;
854  }
855 
856  else
857  {
858  libmesh_assert_less (sys, this->n_systems());
859 
860  if (this->n_vars(sys))
861  return true;
862  }
863 
864  return false;
865 }
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:737
ImplicitSystem & sys
unsigned int n_systems() const
Definition: dof_object.h:718
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 1094 of file elem.C.

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

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

1098 {
1099  // First see if this is a normal "interior" neighbor
1100  if (has_neighbor(elem))
1101  return true;
1102 
1103  for (unsigned int n=0; n<this->n_neighbors(); n++)
1104  if (this->topological_neighbor(n, mesh, point_locator, pb))
1105  return true;
1106 
1107  return false;
1108 }
virtual unsigned int n_neighbors() const
Definition: elem.h:557
MeshBase & mesh
const Elem * topological_neighbor(const unsigned int i, const MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb) const
Definition: elem.C:1057
bool has_neighbor(const Elem *elem) const
Definition: elem.h:1856
Real libMesh::Elem::hmax ( ) const
virtualinherited
Returns
The maximum vertex separation for the element.

Definition at line 466 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::OldSolutionValue< 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().

467 {
468  Real h_max=0;
469 
470  for (unsigned int n_outer=0; n_outer<this->n_vertices(); n_outer++)
471  for (unsigned int n_inner=n_outer+1; n_inner<this->n_vertices(); n_inner++)
472  {
473  const Point diff = (this->point(n_outer) - this->point(n_inner));
474 
475  h_max = std::max(h_max, diff.norm_sq());
476  }
477 
478  return std::sqrt(h_max);
479 }
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:1661
virtual unsigned int n_vertices() const =0
Real libMesh::Elem::hmin ( ) const
virtualinherited
Returns
The minimum vertex separation for the element.

Definition at line 449 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::UnstructuredMesh::find_neighbors(), libMesh::Elem::get_info(), libMesh::BoundaryInfo::get_side_and_node_maps(), libMesh::Elem::is_vertex_on_child(), libMesh::FEMSystem::numerical_jacobian(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::operator()(), and libMesh::ReplicatedMesh::stitching_helper().

450 {
452 
453  for (unsigned int n_outer=0; n_outer<this->n_vertices(); n_outer++)
454  for (unsigned int n_inner=n_outer+1; n_inner<this->n_vertices(); n_inner++)
455  {
456  const Point diff = (this->point(n_outer) - this->point(n_inner));
457 
458  h_min = std::min(h_min, diff.norm_sq());
459  }
460 
461  return std::sqrt(h_min);
462 }
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:1661
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 624 of file dof_object.h.

References libMesh::DofObject::_id, libMesh::libmesh_assert(), 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::Subdivision::all_subdivision(), libMesh::MeshTools::Modification::all_tri(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::ParmetisPartitioner::assign_partitioning(), libMesh::MeshTools::Generation::build_delaunay_square(), libMesh::Nemesis_IO_Helper::build_element_and_node_maps(), libMesh::MeshTools::Generation::build_extrusion(), libMesh::ParmetisPartitioner::build_graph(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::BoundaryInfo::build_node_list_from_side_list(), libMesh::VTKIO::cells_to_vtk(), libMesh::Nemesis_IO_Helper::compute_internal_and_border_elems_and_internal_nodes(), libMesh::FEGenericBase< OutputType >::compute_periodic_constraints(), libMesh::FEMap::compute_single_point_map(), libMesh::UnstructuredMesh::copy_nodes_and_elements(), 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::MeshRefinement::flag_elements_by_mean_stddev(), libMesh::MeshTools::Modification::flatten(), libMesh::Node::get_info(), libMesh::Elem::get_info(), libMesh::DofMap::get_local_constraints(), libMesh::BoundaryInfo::get_side_and_node_maps(), libMesh::EquationSystems::get_solution(), libMesh::LaplaceMeshSmoother::init(), libMesh::ParmetisPartitioner::initialize(), libMesh::ExodusII_IO_Helper::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_parallel_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_topology_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_valid_amr_elem_ids(), libMesh::MeshTools::libmesh_assert_valid_elem_ids(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::MeshTools::libmesh_assert_valid_refinement_flags(), libMesh::Tri3Subdivision::local_node_number(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::Elem::node_id(), libMesh::UNVIO::nodes_out(), 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::ErrorVector::plot_error(), 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::HPCoarsenTest::select_refinement(), libMesh::Partitioner::set_node_processor_ids(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::Partitioner::set_parent_processor_ids(), libMesh::LaplaceMeshSmoother::smooth(), 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::GMVIO::write_ascii_new_impl(), libMesh::GMVIO::write_ascii_old_impl(), libMesh::CheckpointIO::write_connectivity(), libMesh::ExodusII_IO_Helper::write_element_values(), libMesh::ExodusII_IO_Helper::write_elements(), libMesh::GmshIO::write_mesh(), libMesh::ExodusII_IO_Helper::write_nodal_coordinates(), libMesh::CheckpointIO::write_nodes(), libMesh::CheckpointIO::write_remote_elem(), and libMesh::XdrIO::write_serialized_connectivity().

625 {
626  libmesh_assert (this->valid_id());
627  return _id;
628 }
bool valid_id() const
Definition: dof_object.h:666
dof_id_type _id
Definition: dof_object.h:411
libmesh_assert(j)
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::InfCell::infinite ( ) const
inlinevirtualinherited
Returns
true. All classes derived from InfCell are infinite elements.

Implements libMesh::Elem.

Definition at line 66 of file cell_inf.h.

66 { 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 desireable 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 941 of file elem.C.

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

Referenced by libMesh::ParmetisPartitioner::build_graph(), 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::MeshRefinement::limit_overrefined_boundary(), libMesh::MeshRefinement::limit_underrefined_boundary(), libMesh::GhostPointNeighbors::operator()(), libMesh::Parallel::Packing< const Elem * >::pack(), libMesh::MetisPartitioner::partition_range(), and libMesh::Parallel::Packing< Elem * >::unpack().

942 {
943  // interior parents make no sense for full-dimensional elements.
944  libmesh_assert_less (this->dim(), LIBMESH_DIM);
945 
946  // they USED TO BE only good for level-0 elements, but we now
947  // support keeping interior_parent() valid on refined boundary
948  // elements.
949  // if (this->level() != 0)
950  // return this->parent()->interior_parent();
951 
952  // We store the interior_parent pointer after both the parent
953  // neighbor and neighbor pointers
954  Elem * interior_p = _elemlinks[1+this->n_sides()];
955 
956  // If we have an interior_parent, we USED TO assume it was a
957  // one-higher-dimensional interior element, but we now allow e.g.
958  // edge elements to have a 3D interior_parent with no
959  // intermediate 2D element.
960  // libmesh_assert (!interior_p ||
961  // interior_p->dim() == (this->dim()+1));
962  libmesh_assert (!interior_p ||
963  (interior_p == remote_elem) ||
964  (interior_p->dim() > this->dim()));
965 
966  // We require consistency between AMR of interior and of boundary
967  // elements
968  if (interior_p && (interior_p != remote_elem))
969  libmesh_assert_less_equal (interior_p->level(), this->level());
970 
971  return interior_p;
972 }
libmesh_assert(j)
Elem ** _elemlinks
Definition: elem.h:1528
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:1583
virtual unsigned int dim() const =0
unsigned int level() const
Definition: elem.h:2184
const RemoteElem * remote_elem
Definition: remote_elem.C:57
Elem * libMesh::Elem::interior_parent ( )
inherited

Definition at line 976 of file elem.C.

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

977 {
978  // See the const version for comments
979  libmesh_assert_less (this->dim(), LIBMESH_DIM);
980  Elem * interior_p = _elemlinks[1+this->n_sides()];
981 
982  libmesh_assert (!interior_p ||
983  (interior_p == remote_elem) ||
984  (interior_p->dim() > this->dim()));
985  if (interior_p && (interior_p != remote_elem))
986  libmesh_assert_less_equal (interior_p->level(), this->level());
987 
988  return interior_p;
989 }
libmesh_assert(j)
Elem ** _elemlinks
Definition: elem.h:1528
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:1583
virtual unsigned int dim() const =0
unsigned int level() const
Definition: elem.h:2184
const RemoteElem * remote_elem
Definition: remote_elem.C:57
void libMesh::DofObject::invalidate ( )
inlineinherited

Invalidates all the indices for this DofObject

Definition at line 580 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().

581 {
582  this->invalidate_dofs ();
583  this->invalidate_id ();
584  this->invalidate_processor_id ();
585 }
void invalidate_processor_id()
Definition: dof_object.h:572
void invalidate_dofs(const unsigned int sys_num=libMesh::invalid_uint)
Definition: dof_object.h:544
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 544 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().

545 {
546  // If the user does not specify the system number...
547  if (sys_num >= this->n_systems())
548  {
549  for (unsigned int s=0; s<this->n_systems(); s++)
550  for (unsigned int vg=0; vg<this->n_var_groups(s); vg++)
551  if (this->n_comp_group(s,vg))
552  this->set_vg_dof_base(s,vg,invalid_id);
553  }
554  // ...otherwise invalidate the dofs for all systems
555  else
556  for (unsigned int vg=0; vg<this->n_var_groups(sys_num); vg++)
557  if (this->n_comp_group(sys_num,vg))
558  this->set_vg_dof_base(sys_num,vg,invalid_id);
559 }
unsigned int n_comp_group(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:785
void set_vg_dof_base(const unsigned int s, const unsigned int vg, const dof_id_type db)
Definition: dof_object.h:894
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:727
static const dof_id_type invalid_id
Definition: dof_object.h:334
unsigned int n_systems() const
Definition: dof_object.h:718
void libMesh::DofObject::invalidate_id ( )
inlineinherited

Sets the id to invalid_id

Definition at line 564 of file dof_object.h.

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

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

565 {
566  this->set_id (invalid_id);
567 }
dof_id_type & set_id()
Definition: dof_object.h:633
static const dof_id_type invalid_id
Definition: dof_object.h:334
void libMesh::DofObject::invalidate_processor_id ( )
inlineinherited

Sets the processor id to invalid_processor_id

Definition at line 572 of file dof_object.h.

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

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

573 {
575 }
static const processor_id_type invalid_processor_id
Definition: dof_object.h:345
processor_id_type processor_id() const
Definition: dof_object.h:686
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 2121 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().

2126 {
2127 #ifdef LIBMESH_ENABLE_AMR
2128  const Elem * e = descendant;
2129  while (e)
2130  {
2131  if (this == e)
2132  return true;
2133  e = e->parent();
2134  }
2135 #endif
2136  return false;
2137 }
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1583
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 1658 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()().

1660 {
1661  libmesh_assert_less (c, this->n_children());
1662  libmesh_assert_less (e, this->n_edges());
1663 
1664  UniquePtr<const Elem> my_edge = this->build_edge_ptr(e);
1665  UniquePtr<const Elem> child_edge = this->build_edge_ptr(e);
1666 
1667  // We're assuming that an overlapping child edge has the same
1668  // number and orientation as its parent
1669  return (child_edge->node_id(0) == my_edge->node_id(0) ||
1670  child_edge->node_id(1) == my_edge->node_id(1));
1671 }
virtual unsigned int n_edges() const =0
virtual unsigned int n_children() const =0
virtual UniquePtr< Elem > build_edge_ptr(const unsigned int i)=0
bool libMesh::InfHex::is_child_on_side ( const unsigned int  c,
const unsigned int  s 
) const
virtualinherited
Returns
true if the specified child is on the specified side.

Implements libMesh::Elem.

Definition at line 147 of file cell_inf_hex.C.

References libMesh::InfHex::n_children(), and libMesh::InfHex::n_sides().

Referenced by libMesh::InfHex::n_children().

149 {
150  libmesh_assert_less (c, this->n_children());
151  libmesh_assert_less (s, this->n_sides());
152 
153  return (s == 0 || c+1 == s || c == s%4);
154 }
virtual unsigned int n_children() const libmesh_override
Definition: cell_inf_hex.h:108
virtual unsigned int n_sides() const libmesh_override
Definition: cell_inf_hex.h:79
bool libMesh::InfHex8::is_edge ( const unsigned int  i) const
virtual
Returns
true if the specified (local) node number is an edge.

Implements libMesh::Elem.

Definition at line 73 of file cell_inf_hex8.C.

Referenced by n_sub_elem().

74 {
75  if (i < 4)
76  return false;
77  return true;
78 }
bool libMesh::InfHex::is_edge_on_side ( const unsigned int  e,
const unsigned int  s 
) const
virtualinherited
Returns
true if the specified edge is on the specified side.

Implements libMesh::Elem.

Definition at line 158 of file cell_inf_hex.C.

References edge_nodes_map, libMesh::Elem::is_node_on_side(), libMesh::InfHex::n_edges(), and libMesh::InfHex::n_sides().

Referenced by libMesh::InfHex::n_children().

160 {
161  libmesh_assert_less (e, this->n_edges());
162  libmesh_assert_less (s, this->n_sides());
163 
164  return (is_node_on_side(InfHex8::edge_nodes_map[e][0],s) &&
166 }
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const =0
virtual unsigned int n_sides() const libmesh_override
Definition: cell_inf_hex.h:79
static const unsigned int edge_nodes_map[8][2]
virtual unsigned int n_edges() const libmesh_override
Definition: cell_inf_hex.h:98
bool libMesh::InfHex8::is_face ( const unsigned int  i) const
virtual
Returns
true if the specified (local) node number is a face.

Implements libMesh::Elem.

Definition at line 80 of file cell_inf_hex8.C.

Referenced by n_sub_elem().

81 {
82  return false;
83 }
virtual bool libMesh::InfHex::is_mid_infinite_edge_node ( const unsigned int  i) const
inlinevirtualinherited
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 91 of file cell_inf_hex.h.

92  { return (i > 3 && i < 8); }
bool libMesh::InfHex8::is_node_on_edge ( const unsigned int  n,
const unsigned int  e 
) const
virtual
Returns
true if the specified (local) node number is on the specified edge.

Implements libMesh::Elem.

Definition at line 95 of file cell_inf_hex8.C.

References edge_nodes_map, and libMesh::InfHex::n_edges().

Referenced by n_sub_elem().

97 {
98  libmesh_assert_less (e, n_edges());
99  for (unsigned int i = 0; i != 2; ++i)
100  if (edge_nodes_map[e][i] == n)
101  return true;
102  return false;
103 }
static const unsigned int edge_nodes_map[8][2]
virtual unsigned int n_edges() const libmesh_override
Definition: cell_inf_hex.h:98
bool libMesh::InfHex8::is_node_on_side ( const unsigned int  n,
const unsigned int  s 
) const
virtual
Returns
true if the specified (local) node number is on the specified side.

Implements libMesh::Elem.

Definition at line 85 of file cell_inf_hex8.C.

References libMesh::InfHex::n_sides(), and side_nodes_map.

Referenced by n_sub_elem().

87 {
88  libmesh_assert_less (s, n_sides());
89  for (unsigned int i = 0; i != 4; ++i)
90  if (side_nodes_map[s][i] == n)
91  return true;
92  return false;
93 }
static const unsigned int side_nodes_map[5][4]
virtual unsigned int n_sides() const libmesh_override
Definition: cell_inf_hex.h:79
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 487 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(), libMesh::Elem::active_family_tree_by_side(), libMesh::Elem::family_tree(), libMesh::Elem::family_tree_by_side(), libMesh::TopologyMap::fill(), libMesh::Elem::make_links_to_me_local(), libMesh::Partitioner::set_parent_processor_ids(), and libMesh::Elem::total_family_tree().

488  { 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 538 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().

539 {
540  std::set<const Elem *> point_neighbors;
541 
542  this->find_point_neighbors(point_neighbors);
543 
544  std::set<const Elem *>::const_iterator it = point_neighbors.begin();
545  const std::set<const Elem *>::const_iterator end = point_neighbors.end();
546 
547  for (; it != end; ++it)
548  {
549  const Elem * elem = *it;
550  if (elem->processor_id() == my_pid)
551  return true;
552  }
553 
554  return false;
555 }
IterBase * end
void find_point_neighbors(const Point &p, std::set< const Elem * > &neighbor_set) const
Definition: elem.C:591
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1583
bool libMesh::InfHex8::is_vertex ( const unsigned int  i) const
virtual
Returns
true if the specified (local) node number is a vertex.

Implements libMesh::Elem.

Definition at line 66 of file cell_inf_hex8.C.

Referenced by n_sub_elem().

67 {
68  if (i < 4)
69  return true;
70  return false;
71 }
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 3031 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()().

3033 {
3034 #ifdef LIBMESH_ENABLE_AMR
3035 
3036  unsigned int my_n_vertices = this->n_vertices();
3037  for (unsigned int n_parent = 0; n_parent != my_n_vertices;
3038  ++n_parent)
3039  if (this->node_ptr(n_parent) == this->child_ptr(c)->node_ptr(n))
3040  return true;
3041  return false;
3042 
3043 #else
3044 
3045  // No AMR?
3046  libmesh_ignore(c);
3047  libmesh_ignore(n);
3048  libmesh_error_msg("ERROR: AMR disabled, how did we get here?");
3049  return true;
3050 
3051 #endif
3052 }
const Node * node_ptr(const unsigned int i) const
Definition: elem.h:1724
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2232
void libmesh_ignore(const T &)
virtual unsigned int n_vertices() const =0
dof_id_type libMesh::InfHex::key ( const unsigned int  s) const
virtualinherited
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::InfHex18.

Definition at line 72 of file cell_inf_hex.C.

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

73 {
74  libmesh_assert_less (s, this->n_sides());
75 
76  // The order of the node ids does not matter, they are sorted by the
77  // compute_key() function.
78  return this->compute_key(this->node_id(InfHex8::side_nodes_map[s][0]),
79  this->node_id(InfHex8::side_nodes_map[s][1]),
80  this->node_id(InfHex8::side_nodes_map[s][2]),
81  this->node_id(InfHex8::side_nodes_map[s][3]));
82 }
static const unsigned int side_nodes_map[5][4]
virtual unsigned int n_sides() const libmesh_override
Definition: cell_inf_hex.h:79
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:1683
static dof_id_type compute_key(dof_id_type n0)
Definition: elem.h:2405
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 494 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::Quad9::default_order(), libMesh::Tri6::default_order(), libMesh::Quad8::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(), libMesh::InfQuad::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().

495 {
496  std::vector<dof_id_type> node_ids(this->n_nodes());
497 
498  for (unsigned n=0; n<this->n_nodes(); n++)
499  node_ids[n] = this->node_id(n);
500 
501  // Always sort, so that different local node numberings hash to the
502  // same value.
503  std::sort (node_ids.begin(), node_ids.end());
504 
505  return Utility::hashword(node_ids);
506 }
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:1683
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 483 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().

485 {
486  libmesh_assert_less ( n1, this->n_vertices() );
487  libmesh_assert_less ( n2, this->n_vertices() );
488 
489  return (this->point(n1) - this->point(n2)).norm();
490 }
const Point & point(const unsigned int i) const
Definition: elem.h:1661
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 2184 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::eliminate_unrefined_patches(), 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_elem_fraction(), libMesh::MeshRefinement::flag_elements_by_error_fraction(), libMesh::MeshRefinement::flag_elements_by_error_tolerance(), libMesh::MeshRefinement::flag_elements_by_mean_stddev(), 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_level_mismatch_at_edge(), libMesh::MeshRefinement::limit_level_mismatch_at_node(), 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().

2185 {
2186 #ifdef LIBMESH_ENABLE_AMR
2187 
2188  // if I don't have a parent I was
2189  // created directly from file
2190  // or by the user, so I am a
2191  // level-0 element
2192  if (this->parent() == libmesh_nullptr)
2193  return 0;
2194 
2195  // if the parent and this element are of different
2196  // dimensionality we are at the same level as
2197  // the parent (e.g. we are the 2D side of a
2198  // 3D element)
2199  if (this->dim() != this->parent()->dim())
2200  return this->parent()->level();
2201 
2202  // otherwise we are at a level one
2203  // higher than our parent
2204  return (this->parent()->level() + 1);
2205 
2206 #else
2207 
2208  // Without AMR all elements are
2209  // at level 0.
2210  return 0;
2211 
2212 #endif
2213 }
const Elem * parent() const
Definition: elem.h:2142
const class libmesh_nullptr_t libmesh_nullptr
virtual unsigned int dim() const =0
unsigned int level() const
Definition: elem.h:2184
void libMesh::Elem::libmesh_assert_valid_neighbors ( ) const
inherited

Checks for consistent neighbor links on this element.

Definition at line 1127 of file elem.C.

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

Referenced by libMesh::MeshTools::libmesh_assert_valid_neighbors().

1128 {
1129  for (unsigned int s=0; s<this->n_neighbors(); s++)
1130  {
1131  const Elem * neigh = this->neighbor_ptr(s);
1132 
1133  // Any element might have a remote neighbor; checking
1134  // to make sure that's not inaccurate is tough.
1135  if (neigh == remote_elem)
1136  continue;
1137 
1138  if (neigh)
1139  {
1140  // Only subactive elements have subactive neighbors
1141  libmesh_assert (this->subactive() || !neigh->subactive());
1142 
1143  const Elem * elem = this;
1144 
1145  // If we're subactive but our neighbor isn't, its
1146  // return neighbor link will be to our first active
1147  // ancestor OR to our inactive ancestor of the same
1148  // level as neigh,
1149  if (this->subactive() && !neigh->subactive())
1150  {
1151  for (elem = this; !elem->active();
1152  elem = elem->parent())
1153  libmesh_assert(elem);
1154  }
1155  else
1156  {
1157  unsigned int rev = neigh->which_neighbor_am_i(elem);
1158  libmesh_assert_less (rev, neigh->n_neighbors());
1159 
1160  if (this->subactive() && !neigh->subactive())
1161  {
1162  while (neigh->neighbor_ptr(rev) != elem)
1163  {
1164  libmesh_assert(elem->parent());
1165  elem = elem->parent();
1166  }
1167  }
1168  else
1169  {
1170  const Elem * nn = neigh->neighbor_ptr(rev);
1171  libmesh_assert(nn);
1172 
1173  for (; elem != nn; elem = elem->parent())
1174  libmesh_assert(elem);
1175  }
1176  }
1177  }
1178  // If we don't have a neighbor and we're not subactive, our
1179  // ancestors shouldn't have any neighbors in this same
1180  // direction.
1181  else if (!this->subactive())
1182  {
1183  const Elem * my_parent = this->parent();
1184  if (my_parent &&
1185  // A parent with a different dimension isn't really one of
1186  // our ancestors, it means we're on a boundary mesh and this
1187  // is an interior mesh element for which we're on a side.
1188  // Nothing to test for in that case.
1189  (my_parent->dim() == this->dim()))
1190  libmesh_assert (!my_parent->neighbor_ptr(s));
1191  }
1192  }
1193 }
bool subactive() const
Definition: elem.h:2071
virtual unsigned int n_neighbors() const
Definition: elem.h:557
const Elem * parent() const
Definition: elem.h:2142
libmesh_assert(j)
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:1815
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1583
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 1115 of file elem.C.

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

Referenced by libMesh::MeshTools::libmesh_assert_valid_node_pointers().

1116 {
1117  libmesh_assert(this->valid_id());
1118  for (unsigned int n=0; n != this->n_nodes(); ++n)
1119  {
1120  libmesh_assert(this->node_ptr(n));
1121  libmesh_assert(this->node_ptr(n)->valid_id());
1122  }
1123 }
bool valid_id() const
Definition: dof_object.h:666
libmesh_assert(j)
virtual unsigned int n_nodes() const =0
const Node * node_ptr(const unsigned int i) const
Definition: elem.h:1724
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 1704 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().

1705 {
1706  for (unsigned int n=0; n != this->n_nodes(); ++n)
1707  if (this->node_id(n) == i)
1708  return n;
1709 
1710  return libMesh::invalid_uint;
1711 }
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:1683
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 3009 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().

3010 {
3011  Point pmin = this->point(0);
3012  Point pmax = pmin;
3013 
3014  unsigned int n_points = this->n_nodes();
3015  for (unsigned int p=0; p != n_points; ++p)
3016  for (unsigned d=0; d<LIBMESH_DIM; ++d)
3017  {
3018  const Point & pt = this->point(p);
3019  if (pmin(d) > pt(d))
3020  pmin(d) = pt(d);
3021 
3022  if (pmax(d) < pt(d))
3023  pmax(d) = pt(d);
3024  }
3025 
3026  return BoundingBox(pmin, pmax);
3027 }
virtual unsigned int n_nodes() const =0
const Point & point(const unsigned int i) const
Definition: elem.h:1661
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 1199 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::libmesh_assert(), 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().

1200 {
1201  Elem * neigh = this->neighbor_ptr(n);
1202 
1203  // Don't bother calling this function unless it's necessary
1204  libmesh_assert(neigh);
1205  libmesh_assert(!neigh->is_remote());
1206 
1207  // We never have neighbors more refined than us
1208  libmesh_assert_less_equal (neigh->level(), this->level());
1209 
1210  // We never have subactive neighbors of non subactive elements
1211  libmesh_assert(!neigh->subactive() || this->subactive());
1212 
1213  // If we have a neighbor less refined than us then it must not
1214  // have any more refined descendants we could have pointed to
1215  // instead.
1216  libmesh_assert((neigh->level() == this->level()) ||
1217  (neigh->active() && !this->subactive()) ||
1218  (!neigh->has_children() && this->subactive()));
1219 
1220  // If neigh is at our level, then its family might have
1221  // remote_elem neighbor links which need to point to us
1222  // instead, but if not, then we're done.
1223  if (neigh->level() != this->level())
1224  return;
1225 
1226  // What side of neigh are we on? We can't use the usual Elem
1227  // method because we're in the middle of restoring topology
1228  const UniquePtr<Elem> my_side = this->side_ptr(n);
1229  unsigned int nn = 0;
1230  for (; nn != neigh->n_sides(); ++nn)
1231  {
1232  const UniquePtr<Elem> neigh_side = neigh->side_ptr(nn);
1233  if (*my_side == *neigh_side)
1234  break;
1235  }
1236 
1237  // we had better be on *some* side of neigh
1238  libmesh_assert_less (nn, neigh->n_sides());
1239 
1240  // Find any elements that ought to point to elem
1241  std::vector<const Elem *> neigh_family;
1242 #ifdef LIBMESH_ENABLE_AMR
1243  if (this->active())
1244  neigh->family_tree_by_side(neigh_family, nn);
1245  else if (neigh->subactive())
1246 #endif
1247  neigh_family.push_back(neigh);
1248 
1249  // And point them to elem
1250  for (std::size_t i = 0; i != neigh_family.size(); ++i)
1251  {
1252  Elem * neigh_family_member = const_cast<Elem *>(neigh_family[i]);
1253 
1254  // Only subactive elements point to other subactive elements
1255  if (this->subactive() && !neigh_family_member->subactive())
1256  continue;
1257 
1258  // Ideally, the neighbor link ought to either be correct
1259  // already or ought to be to remote_elem.
1260  //
1261  // However, if we're redistributing a newly created elem,
1262  // after an AMR step but before find_neighbors has fixed up
1263  // neighbor links, we might have an out of date neighbor
1264  // link to elem's parent instead.
1265 #ifdef LIBMESH_ENABLE_AMR
1266  libmesh_assert((neigh_family_member->neighbor_ptr(nn) &&
1267  (neigh_family_member->neighbor_ptr(nn)->active() ||
1268  neigh_family_member->neighbor_ptr(nn)->is_ancestor_of(this))) ||
1269  (neigh_family_member->neighbor_ptr(nn) == remote_elem) ||
1270  ((this->refinement_flag() == JUST_REFINED) &&
1271  (this->parent() != libmesh_nullptr) &&
1272  (neigh_family_member->neighbor_ptr(nn) == this->parent())));
1273 #else
1274  libmesh_assert((neigh_family_member->neighbor_ptr(nn) == this) ||
1275  (neigh_family_member->neighbor_ptr(nn) == remote_elem));
1276 #endif
1277 
1278  neigh_family_member->set_neighbor(nn, this);
1279  }
1280 }
bool subactive() const
Definition: elem.h:2071
bool active() const
Definition: elem.h:2053
const Elem * parent() const
Definition: elem.h:2142
const class libmesh_nullptr_t libmesh_nullptr
libmesh_assert(j)
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:1815
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1583
unsigned int level() const
Definition: elem.h:2184
RefinementState refinement_flag() const
Definition: elem.h:2289
virtual UniquePtr< Elem > side_ptr(unsigned int i)=0
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 1283 of file elem.C.

References libMesh::Elem::child_ptr(), libMesh::Elem::dim(), libMesh::Elem::has_children(), libMesh::Elem::has_neighbor(), libMesh::Elem::level(), libMesh::libmesh_assert(), libMesh::Elem::n_children(), libMesh::Elem::n_neighbors(), libMesh::Elem::n_sides(), libMesh::Elem::neighbor_ptr(), libMesh::Elem::parent(), libMesh::remote_elem, libMesh::Elem::set_child(), libMesh::Elem::set_neighbor(), libMesh::Elem::subactive(), libMesh::Elem::total_family_tree_by_neighbor(), libMesh::Elem::total_family_tree_by_subneighbor(), libMesh::Elem::which_child_am_i(), and libMesh::Elem::which_neighbor_am_i().

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

1284 {
1285  libmesh_assert_not_equal_to (this, remote_elem);
1286 
1287  // We need to have handled any children first
1288 #if defined(LIBMESH_ENABLE_AMR) && defined(DEBUG)
1289  if (this->has_children())
1290  for (unsigned int c = 0; c != this->n_children(); ++c)
1291  {
1292  Elem * current_child = this->child_ptr(c);
1293  libmesh_assert_equal_to (current_child, remote_elem);
1294  }
1295 #endif
1296 
1297  // Remotify any neighbor links
1298  for (unsigned int s = 0; s != this->n_sides(); ++s)
1299  {
1300  Elem * neigh = this->neighbor_ptr(s);
1301  if (neigh && neigh != remote_elem)
1302  {
1303  // My neighbor should never be more refined than me; my real
1304  // neighbor would have been its parent in that case.
1305  libmesh_assert_greater_equal (this->level(), neigh->level());
1306 
1307  if (this->level() == neigh->level() &&
1308  neigh->has_neighbor(this))
1309  {
1310 #ifdef LIBMESH_ENABLE_AMR
1311  // My neighbor may have descendants which also consider me a
1312  // neighbor
1313  std::vector<const Elem *> family;
1314  neigh->total_family_tree_by_neighbor (family, this);
1315 
1316  // FIXME - There's a lot of ugly const_casts here; we
1317  // may want to make remote_elem non-const and create
1318  // non-const versions of the family_tree methods
1319  for (std::size_t i=0; i != family.size(); ++i)
1320  {
1321  Elem * n = const_cast<Elem *>(family[i]);
1322  libmesh_assert (n);
1323  if (n == remote_elem)
1324  continue;
1325  unsigned int my_s = n->which_neighbor_am_i(this);
1326  libmesh_assert_less (my_s, n->n_neighbors());
1327  libmesh_assert_equal_to (n->neighbor_ptr(my_s), this);
1328  n->set_neighbor(my_s, const_cast<RemoteElem *>(remote_elem));
1329  }
1330 #else
1331  unsigned int my_s = neigh->which_neighbor_am_i(this);
1332  libmesh_assert_less (my_s, neigh->n_neighbors());
1333  libmesh_assert_equal_to (neigh->neighbor_ptr(my_s), this);
1334  neigh->set_neighbor(my_s, const_cast<RemoteElem *>(remote_elem));
1335 #endif
1336  }
1337 #ifdef LIBMESH_ENABLE_AMR
1338  // Even if my neighbor doesn't link back to me, it might
1339  // have subactive descendants which do
1340  else if (neigh->has_children())
1341  {
1342  // If my neighbor at the same level doesn't have me as a
1343  // neighbor, I must be subactive
1344  libmesh_assert(this->level() > neigh->level() ||
1345  this->subactive());
1346 
1347  // My neighbor must have some ancestor of mine as a
1348  // neighbor
1349  Elem * my_ancestor = this->parent();
1350  libmesh_assert(my_ancestor);
1351  while (!neigh->has_neighbor(my_ancestor))
1352  {
1353  my_ancestor = my_ancestor->parent();
1354  libmesh_assert(my_ancestor);
1355  }
1356 
1357  // My neighbor may have descendants which consider me a
1358  // neighbor
1359  std::vector<const Elem *> family;
1360  neigh->total_family_tree_by_subneighbor (family, my_ancestor, this);
1361 
1362  // FIXME - There's a lot of ugly const_casts here; we
1363  // may want to make remote_elem non-const and create
1364  // non-const versions of the family_tree methods
1365  for (std::size_t i=0; i != family.size(); ++i)
1366  {
1367  Elem * n = const_cast<Elem *>(family[i]);
1368  libmesh_assert (n);
1369  if (n == remote_elem)
1370  continue;
1371  unsigned int my_s = n->which_neighbor_am_i(this);
1372  libmesh_assert_less (my_s, n->n_neighbors());
1373  libmesh_assert_equal_to (n->neighbor_ptr(my_s), this);
1374  n->set_neighbor(my_s, const_cast<RemoteElem *>(remote_elem));
1375  }
1376  }
1377 #endif
1378  }
1379  }
1380 
1381 #ifdef LIBMESH_ENABLE_AMR
1382  // Remotify parent's child link
1383  Elem * my_parent = this->parent();
1384  if (my_parent &&
1385  // As long as it's not already remote
1386  my_parent != remote_elem &&
1387  // And it's a real parent, not an interior parent
1388  this->dim() == my_parent->dim())
1389  {
1390  unsigned int me = my_parent->which_child_am_i(this);
1391  libmesh_assert_equal_to (my_parent->child_ptr(me), this);
1392  my_parent->set_child(me, const_cast<RemoteElem *>(remote_elem));
1393  }
1394 #endif
1395 }
bool has_children() const
Definition: elem.h:2091
bool subactive() const
Definition: elem.h:2071
const Elem * parent() const
Definition: elem.h:2142
libmesh_assert(j)
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:1815
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2232
virtual unsigned int n_sides() const =0
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:1583
virtual unsigned int dim() const =0
unsigned int level() const
Definition: elem.h:2184
const RemoteElem * remote_elem
Definition: remote_elem.C:57
virtual Point libMesh::InfHex::master_point ( const unsigned int  i) const
inlinevirtualinherited
Returns
The Point associated with local Node i, in master element rather than physical coordinates.

Implements libMesh::Elem.

Definition at line 66 of file cell_inf_hex.h.

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

67  {
68  libmesh_assert_less(i, this->n_nodes());
69  return Point(_master_points[i][0],
70  _master_points[i][1],
71  _master_points[i][2]);
72  }
virtual unsigned int n_nodes() const =0
static const Real _master_points[18][3]
Definition: cell_inf_hex.h:193
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 2325 of file elem.h.

References libMesh::Elem::_p_level, libMesh::Elem::active(), libMesh::Elem::child_ptr(), libMesh::libmesh_assert(), std::max(), libMesh::Elem::max_descendant_p_level(), libMesh::Elem::n_children(), libMesh::Elem::p_level(), and libMesh::Elem::subactive().

Referenced by libMesh::FEGenericBase< OutputType >::coarsened_dof_values(), and libMesh::Elem::max_descendant_p_level().

2326 {
2327  // This is undefined for subactive elements,
2328  // which have no active descendants
2329  libmesh_assert (!this->subactive());
2330  if (this->active())
2331  return this->p_level();
2332 
2333  unsigned int max_p_level = _p_level;
2334  for (unsigned int c=0; c != this->n_children(); c++)
2335  max_p_level = std::max(max_p_level,
2336  this->child_ptr(c)->max_descendant_p_level());
2337  return max_p_level;
2338 }
bool subactive() const
Definition: elem.h:2071
bool active() const
Definition: elem.h:2053
unsigned char _p_level
Definition: elem.h:1563
unsigned int p_level() const
Definition: elem.h:2218
unsigned int max_descendant_p_level() const
Definition: elem.h:2325
long double max(long double a, double b)
libmesh_assert(j)
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2232
virtual unsigned int n_children() const =0
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 2063 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::child_ptr(), libMesh::Elem::COARSEN, libMesh::Elem::has_neighbor(), libMesh::libmesh_assert(), std::min(), libMesh::Elem::min_new_p_level_by_neighbor(), libMesh::Elem::n_children(), libMesh::Elem::p_level(), libMesh::Elem::p_refinement_flag(), libMesh::Elem::REFINE, libMesh::remote_elem, and libMesh::Elem::subactive().

Referenced by libMesh::MeshRefinement::eliminate_unrefined_patches(), and libMesh::Elem::min_new_p_level_by_neighbor().

2065 {
2066  libmesh_assert(!this->subactive());
2067  libmesh_assert(neighbor_in->active());
2068 
2069  // If we're an active element this is simple
2070  if (this->active())
2071  {
2072  unsigned int new_p_level = this->p_level();
2073  if (this->p_refinement_flag() == Elem::REFINE)
2074  new_p_level += 1;
2075  if (this->p_refinement_flag() == Elem::COARSEN)
2076  {
2077  libmesh_assert_greater (new_p_level, 0);
2078  new_p_level -= 1;
2079  }
2080  return std::min(current_min, new_p_level);
2081  }
2082 
2083  libmesh_assert(has_neighbor(neighbor_in));
2084 
2085  unsigned int min_p_level = current_min;
2086 
2087  for (unsigned int c=0; c<this->n_children(); c++)
2088  {
2089  const Elem * const current_child = this->child_ptr(c);
2090  if (current_child && current_child != remote_elem)
2091  if (current_child->has_neighbor(neighbor_in))
2092  min_p_level =
2093  current_child->min_new_p_level_by_neighbor(neighbor_in,
2094  min_p_level);
2095  }
2096 
2097  return min_p_level;
2098 }
bool subactive() const
Definition: elem.h:2071
bool active() const
Definition: elem.h:2053
unsigned int p_level() const
Definition: elem.h:2218
libmesh_assert(j)
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2232
RefinementState p_refinement_flag() const
Definition: elem.h:2305
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:1583
bool has_neighbor(const Elem *elem) const
Definition: elem.h:1856
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 2030 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::child_ptr(), libMesh::Elem::has_neighbor(), libMesh::libmesh_assert(), std::min(), libMesh::Elem::min_p_level_by_neighbor(), libMesh::Elem::n_children(), libMesh::Elem::p_level(), libMesh::remote_elem, and libMesh::Elem::subactive().

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

2032 {
2033  libmesh_assert(!this->subactive());
2034  libmesh_assert(neighbor_in->active());
2035 
2036  // If we're an active element this is simple
2037  if (this->active())
2038  return std::min(current_min, this->p_level());
2039 
2040  libmesh_assert(has_neighbor(neighbor_in));
2041 
2042  // The p_level() of an ancestor element is already the minimum
2043  // p_level() of its children - so if that's high enough, we don't
2044  // need to examine any children.
2045  if (current_min <= this->p_level())
2046  return current_min;
2047 
2048  unsigned int min_p_level = current_min;
2049 
2050  for (unsigned int c=0; c<this->n_children(); c++)
2051  {
2052  const Elem * const current_child = this->child_ptr(c);
2053  if (current_child != remote_elem && current_child->has_neighbor(neighbor_in))
2054  min_p_level =
2055  current_child->min_p_level_by_neighbor(neighbor_in,
2056  min_p_level);
2057  }
2058 
2059  return min_p_level;
2060 }
bool subactive() const
Definition: elem.h:2071
bool active() const
Definition: elem.h:2053
unsigned int p_level() const
Definition: elem.h:2218
libmesh_assert(j)
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2232
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:1583
bool has_neighbor(const Elem *elem) const
Definition: elem.h:1856
long double min(long double a, double b)
const RemoteElem * remote_elem
Definition: remote_elem.C:57
virtual unsigned int libMesh::InfHex::n_children ( ) const
inlinevirtualinherited
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 772 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::distribute_local_dofs_node_major(), libMesh::DofMap::dof_indices(), libMesh::DofObject::dof_number(), libMesh::DofObject::DofObject(), libMesh::OldSolutionValue< 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(), libMesh::DofMap::set_nonlocal_dof_objects(), and libMesh::System::zero_variable().

774 {
775  libmesh_assert_less (s, this->n_systems());
776  libmesh_assert_less (var, this->n_vars(s));
777 
778  return this->n_comp_group(s,this->var_to_vg(s,var));
779 }
unsigned int n_comp_group(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:785
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:737
unsigned int var_to_vg(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:938
unsigned int n_systems() const
Definition: dof_object.h:718
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 785 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().

787 {
788  libmesh_assert_less (s, this->n_systems());
789  libmesh_assert_less (vg, this->n_var_groups(s));
790 
791  const unsigned int
792  start_idx_sys = this->start_idx(s);
793 
794  libmesh_assert_less ((start_idx_sys + 2*vg), _idx_buf.size());
795 
796  return (_idx_buf[start_idx_sys + 2*vg] % ncv_magic);
797 }
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:727
unsigned int start_idx(const unsigned int s) const
Definition: dof_object.h:870
index_buffer_t _idx_buf
Definition: dof_object.h:477
unsigned int n_systems() const
Definition: dof_object.h:718
static const index_t ncv_magic
Definition: dof_object.h:488
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 602 of file dof_object.h.

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

Referenced by libMesh::EquationSystems::build_parallel_solution_vector().

604 {
605  libmesh_assert_less (s, this->n_systems());
606 
607  unsigned int num = 0;
608 
609  // Count all variables
610  if (var == libMesh::invalid_uint)
611  for (unsigned int v=0; v<this->n_vars(s); v++)
612  num += this->n_comp(s,v);
613 
614  // Only count specified variable
615  else
616  num = this->n_comp(s,var);
617 
618  return num;
619 }
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:737
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:772
unsigned int n_systems() const
Definition: dof_object.h:718
virtual unsigned int libMesh::InfHex::n_edges ( ) const
inlinevirtualinherited
Returns
8. All infinite hexahedra have 8 edges, 4 lying in the base, and 4 perpendicular to the base.

Implements libMesh::Elem.

Definition at line 98 of file cell_inf_hex.h.

Referenced by build_edge_ptr(), libMesh::InfHex18::build_edge_ptr(), l