libMesh::Pyramid Class Referenceabstract

The base class for all pyramid element types. More...

#include <cell_pyramid.h>

Inheritance diagram for libMesh::Pyramid:

Public Types

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

Public Member Functions

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

Static Public Member Functions

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

Public Attributes

DofObjectold_dof_object
 

Static Public Attributes

static const subdomain_id_type invalid_subdomain_id = std::numeric_limits<subdomain_id_type>::max()
 
static const unsigned int type_to_n_nodes_map [INVALID_ELEM]
 
static const unsigned int max_n_nodes = 27
 
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

unsigned int side_children_matrix (const unsigned int, const unsigned int) const
 
template<typename Subclass >
void simple_build_side_ptr (std::unique_ptr< Elem > &side, const unsigned int i, ElemType sidetype)
 
virtual std::vector< std::vector< std::vector< std::vector< std::pair< unsigned char, unsigned char > > > > > & _get_bracketing_node_cache () const
 
virtual std::vector< std::vector< std::vector< signed char > > > & _get_parent_indices_cache () const
 
void increment_constructor_count (const std::string &name)
 
void increment_constructor_count (const std::string &name)
 
void increment_destructor_count (const std::string &name)
 
void increment_destructor_count (const std::string &name)
 

Static Protected Member Functions

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

Protected Attributes

Elem_elemlinks_data [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 Real _master_points [14][3]
 
static Counts _counts
 
static Counts _counts
 
static Threads::atomic< unsigned int > _n_objects
 
static Threads::atomic< unsigned int > _n_objects
 
static Threads::spin_mutex _mutex
 
static Threads::spin_mutex _mutex
 
static bool _enable_print_counter = true
 
static bool _enable_print_counter = true
 

Detailed Description

The base class for all pyramid element types.

The Pyramid is an element in 3D with 5 sides.

Author
Benjamin S. Kirk
Date
2002

Definition at line 39 of file cell_pyramid.h.

Member Typedef Documentation

◆ ConstNeighborPtrIter

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

Definition at line 324 of file elem.h.

◆ Counts [1/2]

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 117 of file reference_counter.h.

◆ Counts [2/2]

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 117 of file reference_counter.h.

◆ NeighborPtrIter

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

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

Definition at line 323 of file elem.h.

◆ Predicate

Useful iterator typedefs

Definition at line 1499 of file elem.h.

Member Enumeration Documentation

◆ RefinementState

Enumeration of possible element refinement states.

Enumerator
COARSEN 
DO_NOTHING 
REFINE 
JUST_REFINED 
JUST_COARSENED 
INACTIVE 
COARSEN_INACTIVE 
INVALID_REFINEMENTSTATE 

Definition at line 1198 of file elem.h.

Constructor & Destructor Documentation

◆ Pyramid() [1/3]

libMesh::Pyramid::Pyramid ( const unsigned int  nn,
Elem p,
Node **  nodelinkdata 
)
inline

Default pyramid, one quad face, four triangular faces, takes number of nodes and parent. Derived classes implement 'true' elements.

Definition at line 48 of file cell_pyramid.h.

References libMesh::Elem::set_interior_parent().

48  :
49  Cell(nn, Pyramid::n_sides(), p, _elemlinks_data, nodelinkdata)
50  {
51  // Make sure the interior parent isn't undefined
52  if (LIBMESH_DIM > 3)
53  this->set_interior_parent(nullptr);
54  }
Cell(const unsigned int nn, const unsigned int ns, Elem *p, Elem **elemlinkdata, Node **nodelinkdata)
Definition: cell.h:45
virtual unsigned int n_sides() const override
Definition: cell_pyramid.h:83
void set_interior_parent(Elem *p)
Definition: elem.C:856
Elem * _elemlinks_data[6+(LIBMESH_DIM >3)]
Definition: cell_pyramid.h:151

◆ Pyramid() [2/3]

libMesh::Pyramid::Pyramid ( Pyramid &&  )
delete

◆ Pyramid() [3/3]

libMesh::Pyramid::Pyramid ( const Pyramid )
delete

◆ ~Pyramid()

virtual libMesh::Pyramid::~Pyramid ( )
virtualdefault

Member Function Documentation

◆ _get_bracketing_node_cache()

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

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

1660  {
1661  static std::vector<std::vector<std::vector<std::vector<std::pair<unsigned char, unsigned char>>>>> c;
1662  libmesh_error();
1663  return c;
1664  }

◆ _get_parent_indices_cache()

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

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

1674  {
1675  static std::vector<std::vector<std::vector<signed char>>> c;
1676  libmesh_error();
1677  return c;
1678  }

◆ active()

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

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

Referenced by libMesh::DofMap::_dof_indices(), 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::Partitioner::build_graph(), libMesh::Elem::coarsen(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_periodic_constraints(), libMesh::FEAbstract::compute_periodic_node_constraints(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_proj_constraints(), libMesh::connect_families(), libMesh::UnstructuredMesh::contract(), libMesh::Elem::contract(), libMesh::DofMap::dof_indices(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::Elem::family_tree(), libMesh::Elem::family_tree_by_neighbor(), libMesh::Elem::family_tree_by_side(), libMesh::Elem::family_tree_by_subneighbor(), libMesh::Elem::find_interior_neighbors(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshTools::find_nodal_neighbors(), libMesh::Elem::find_point_neighbors(), libMesh::Elem::get_info(), libMesh::ErrorVector::is_active_elem(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_flags(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_p_levels(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::Elem::make_links_to_me_local(), libMesh::MeshRefinement::make_refinement_compatible(), libMesh::Elem::max_descendant_p_level(), libMesh::Elem::min_new_p_level_by_neighbor(), libMesh::Elem::min_p_level_by_neighbor(), libMesh::DofMap::old_dof_indices(), libMesh::PointLocatorTree::operator()(), libMesh::MetisPartitioner::partition_range(), libMesh::Elem::refine(), libMesh::Elem::subactive(), libMesh::Parallel::sync_element_data_by_parent_id(), libMesh::MeshRefinement::test_level_one(), and libMesh::Parallel::Packing< T >::unpack().

2391 {
2392 #ifdef LIBMESH_ENABLE_AMR
2393  if ((this->refinement_flag() == INACTIVE) ||
2394  (this->refinement_flag() == COARSEN_INACTIVE))
2395  return false;
2396  else
2397  return true;
2398 #else
2399  return true;
2400 #endif
2401 }
RefinementState refinement_flag() const
Definition: elem.h:2638

◆ active_family_tree()

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 1577 of file elem.C.

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

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

1579 {
1580  // The "family tree" doesn't include subactive elements
1581  libmesh_assert(!this->subactive());
1582 
1583  // Clear the vector if the flag reset tells us to.
1584  if (reset)
1585  active_family.clear();
1586 
1587  // Add this element to the family tree if it is active
1588  if (this->active())
1589  active_family.push_back(this);
1590 
1591  // Otherwise recurse into the element's children.
1592  // Do not clear the vector any more.
1593  else
1594  for (auto & c : this->child_ref_range())
1595  if (!c.is_remote())
1596  c.active_family_tree (active_family, false);
1597 }
SimpleRange< ChildRefIter > child_ref_range()
Definition: elem.h:1779
bool subactive() const
Definition: elem.h:2408
bool active() const
Definition: elem.h:2390

◆ active_family_tree_by_neighbor()

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 1837 of file elem.C.

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

Referenced by libMesh::DefaultCoupling::operator()().

1840 {
1841  // The "family tree" doesn't include subactive elements or
1842  // remote_elements
1843  libmesh_assert(!this->subactive());
1844  libmesh_assert(this != remote_elem);
1845 
1846  // Clear the vector if the flag reset tells us to.
1847  if (reset)
1848  family.clear();
1849 
1850  // This only makes sense if we're already a neighbor
1851 #ifndef NDEBUG
1852  if (this->level() >= neighbor_in->level())
1853  libmesh_assert (this->has_neighbor(neighbor_in));
1854 #endif
1855 
1856  // Add an active element to the family tree.
1857  if (this->active())
1858  family.push_back(this);
1859 
1860  // Or recurse into an ancestor element's children.
1861  // Do not clear the vector any more.
1862  else if (!this->active())
1863  for (auto & c : this->child_ref_range())
1864  if (&c != remote_elem && c.has_neighbor(neighbor_in))
1865  c.active_family_tree_by_neighbor (family, neighbor_in, false);
1866 }
bool has_neighbor(const Elem *elem) const
Definition: elem.h:2093
SimpleRange< ChildRefIter > child_ref_range()
Definition: elem.h:1779
unsigned int level() const
Definition: elem.h:2521
bool subactive() const
Definition: elem.h:2408
bool active() const
Definition: elem.h:2390
const RemoteElem * remote_elem
Definition: remote_elem.C:57

◆ active_family_tree_by_side()

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 1630 of file elem.C.

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

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

1633 {
1634  // The "family tree" doesn't include subactive or remote elements
1635  libmesh_assert(!this->subactive());
1636  libmesh_assert(this != remote_elem);
1637 
1638  // Clear the vector if the flag reset tells us to.
1639  if (reset)
1640  family.clear();
1641 
1642  libmesh_assert_less (s, this->n_sides());
1643 
1644  // Add an active element to the family tree.
1645  if (this->active())
1646  family.push_back(this);
1647 
1648  // Or recurse into an ancestor element's children.
1649  // Do not clear the vector any more.
1650  else
1651  {
1652  const unsigned int nc = this->n_children();
1653  for (unsigned int c = 0; c != nc; c++)
1654  if (!this->child_ptr(c)->is_remote() && this->is_child_on_side(c, s))
1655  this->child_ptr(c)->active_family_tree_by_side (family, s, false);
1656  }
1657 }
virtual bool is_child_on_side(const unsigned int c, const unsigned int s) const =0
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:1630
virtual bool is_remote() const
Definition: elem.h:555
virtual unsigned int n_sides() const =0
bool subactive() const
Definition: elem.h:2408
bool active() const
Definition: elem.h:2390
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2578
const RemoteElem * remote_elem
Definition: remote_elem.C:57

◆ active_family_tree_by_topological_neighbor()

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 1795 of file elem.C.

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

Referenced by libMesh::DefaultCoupling::operator()().

1801 {
1802  // The "family tree" doesn't include subactive elements or
1803  // remote_elements
1804  libmesh_assert(!this->subactive());
1805  libmesh_assert(this != remote_elem);
1806 
1807  // Clear the vector if the flag reset tells us to.
1808  if (reset)
1809  family.clear();
1810 
1811  // This only makes sense if we're already a topological neighbor
1812 #ifndef NDEBUG
1813  if (this->level() >= neighbor_in->level())
1814  libmesh_assert (this->has_topological_neighbor(neighbor_in,
1815  mesh,
1816  point_locator,
1817  pb));
1818 #endif
1819 
1820  // Add an active element to the family tree.
1821  if (this->active())
1822  family.push_back(this);
1823 
1824  // Or recurse into an ancestor element's children.
1825  // Do not clear the vector any more.
1826  else if (!this->active())
1827  for (auto & c : this->child_ref_range())
1828  if (&c != remote_elem &&
1829  c.has_topological_neighbor(neighbor_in, mesh, point_locator,
1830  pb))
1831  c.active_family_tree_by_topological_neighbor
1832  (family, neighbor_in, mesh, point_locator, pb, false);
1833 }
MeshBase & mesh
SimpleRange< ChildRefIter > child_ref_range()
Definition: elem.h:1779
bool has_topological_neighbor(const Elem *elem, const MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb) const
Definition: elem.C:957
unsigned int level() const
Definition: elem.h:2521
bool subactive() const
Definition: elem.h:2408
bool active() const
Definition: elem.h:2390
const RemoteElem * remote_elem
Definition: remote_elem.C:57

◆ add_child() [1/2]

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 1461 of file elem.C.

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

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

1462 {
1463  const unsigned int nc = this->n_children();
1464 
1465  if (_children == nullptr)
1466  {
1467  _children = new Elem *[nc];
1468 
1469  for (unsigned int c = 0; c != nc; c++)
1470  this->set_child(c, nullptr);
1471  }
1472 
1473  for (unsigned int c = 0; c != nc; c++)
1474  {
1475  if (this->_children[c] == nullptr || this->_children[c] == remote_elem)
1476  {
1477  libmesh_assert_equal_to (this, elem->parent());
1478  this->set_child(c, elem);
1479  return;
1480  }
1481  }
1482 
1483  libmesh_error_msg("Error: Tried to add a child to an element with full children array");
1484 }
virtual unsigned int n_children() const =0
Elem ** _children
Definition: elem.h:1707
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1811
void set_child(unsigned int c, Elem *elem)
Definition: elem.h:2610
const RemoteElem * remote_elem
Definition: remote_elem.C:57

◆ add_child() [2/2]

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 1488 of file elem.C.

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

1489 {
1490  if (!this->has_children())
1491  {
1492  const unsigned int nc = this->n_children();
1493  _children = new Elem *[nc];
1494 
1495  for (unsigned int i = 0; i != nc; i++)
1496  this->set_child(i, nullptr);
1497  }
1498 
1499  libmesh_assert (this->_children[c] == nullptr || this->child_ptr(c) == remote_elem);
1500  libmesh_assert (elem == remote_elem || this == elem->parent());
1501 
1502  this->set_child(c, elem);
1503 }
const Elem * parent() const
Definition: elem.h:2479
virtual unsigned int n_children() const =0
Elem ** _children
Definition: elem.h:1707
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1811
void set_child(unsigned int c, Elem *elem)
Definition: elem.h:2610
bool has_children() const
Definition: elem.h:2428
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2578
const RemoteElem * remote_elem
Definition: remote_elem.C:57

◆ add_system()

void libMesh::DofObject::add_system ( )
inherited

Adds an additional system to the DofObject

Definition at line 195 of file dof_object.C.

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

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

◆ ancestor()

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 1427 of file elem.C.

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

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

1428 {
1429 #ifdef LIBMESH_ENABLE_AMR
1430 
1431  // Use a fast, DistributedMesh-safe definition
1432  const bool is_ancestor =
1433  !this->active() && !this->subactive();
1434 
1435  // But check for inconsistencies if we have time
1436 #ifdef DEBUG
1437  if (!is_ancestor && this->has_children())
1438  {
1439  for (auto & c : this->child_ref_range())
1440  {
1441  if (&c != remote_elem)
1442  {
1443  libmesh_assert(!c.active());
1444  libmesh_assert(!c.ancestor());
1445  }
1446  }
1447  }
1448 #endif // DEBUG
1449 
1450  return is_ancestor;
1451 
1452 #else
1453  return false;
1454 #endif
1455 }
SimpleRange< ChildRefIter > child_ref_range()
Definition: elem.h:1779
bool subactive() const
Definition: elem.h:2408
bool active() const
Definition: elem.h:2390
bool has_children() const
Definition: elem.h:2428
const RemoteElem * remote_elem
Definition: remote_elem.C:57

◆ as_parent_node()

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 1933 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(), libMesh::Elem::n_nodes_in_child(), and libMesh::parent_indices_mutex.

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

1935 {
1936  const unsigned int nc = this->n_children();
1937  libmesh_assert_less(child, nc);
1938 
1939  // Cached return values, indexed first by embedding_matrix version,
1940  // then by child number, then by child node number.
1941  std::vector<std::vector<std::vector<signed char>>> &
1942  cached_parent_indices = this->_get_parent_indices_cache();
1943 
1944  unsigned int em_vers = this->embedding_matrix_version();
1945 
1946  // We may be updating the cache on one thread, and while that
1947  // happens we can't safely access the cache from other threads.
1948  Threads::spin_mutex::scoped_lock lock(parent_indices_mutex);
1949 
1950  if (em_vers >= cached_parent_indices.size())
1951  cached_parent_indices.resize(em_vers+1);
1952 
1953  if (child >= cached_parent_indices[em_vers].size())
1954  {
1955  const signed char nn = cast_int<signed char>(this->n_nodes());
1956 
1957  cached_parent_indices[em_vers].resize(nc);
1958 
1959  for (unsigned int c = 0; c != nc; ++c)
1960  {
1961  const unsigned int ncn = this->n_nodes_in_child(c);
1962  cached_parent_indices[em_vers][c].resize(ncn);
1963  for (unsigned int cn = 0; cn != ncn; ++cn)
1964  {
1965  for (signed char n = 0; n != nn; ++n)
1966  {
1967  const float em_val = this->embedding_matrix
1968  (c, cn, n);
1969  if (em_val == 1)
1970  {
1971  cached_parent_indices[em_vers][c][cn] = n;
1972  break;
1973  }
1974 
1975  if (em_val != 0)
1976  {
1977  cached_parent_indices[em_vers][c][cn] =
1978  -1;
1979  break;
1980  }
1981 
1982  // We should never see an all-zero embedding matrix
1983  // row
1984  libmesh_assert_not_equal_to (n+1, nn);
1985  }
1986  }
1987  }
1988  }
1989 
1990  const signed char cache_val =
1991  cached_parent_indices[em_vers][child][child_node];
1992  if (cache_val == -1)
1993  return libMesh::invalid_uint;
1994 
1995  return cached_parent_indices[em_vers][child][child_node];
1996 }
const unsigned int invalid_uint
Definition: libmesh.h:245
virtual unsigned int embedding_matrix_version() const
Definition: elem.h:1609
Threads::spin_mutex parent_indices_mutex
Definition: elem.C:85
virtual float embedding_matrix(const unsigned int child_num, const unsigned int child_node_num, const unsigned int parent_node_num) const =0
virtual unsigned int n_children() const =0
virtual std::vector< std::vector< std::vector< signed char > > > & _get_parent_indices_cache() const
Definition: elem.h:1673
virtual unsigned int n_nodes() const =0
Elem * child(const unsigned int i) const
Definition: elem.h:2598
virtual unsigned int n_nodes_in_child(unsigned int) const
Definition: elem.h:613

◆ boundary_sides_begin()

Elem::side_iterator libMesh::Elem::boundary_sides_begin ( )
inherited

Iterator accessor functions

Definition at line 2808 of file elem.C.

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

2809 {
2810  Predicates::BoundarySide<SideIter> bsp;
2811  return side_iterator(this->_first_side(), this->_last_side(), bsp);
2812 }
SideIter _last_side()
Definition: elem.h:2963
SideIter _first_side()
Definition: elem.h:2955

◆ boundary_sides_end()

Elem::side_iterator libMesh::Elem::boundary_sides_end ( )
inherited

Definition at line 2817 of file elem.C.

References libMesh::Elem::_last_side().

2818 {
2819  Predicates::BoundarySide<SideIter> bsp;
2820  return side_iterator(this->_last_side(), this->_last_side(), bsp);
2821 }
SideIter _last_side()
Definition: elem.h:2963

◆ bracketing_nodes()

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 2206 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(), and libMesh::TopologyMap::fill().

2208 {
2209  std::vector<std::pair<dof_id_type, dof_id_type>> returnval;
2210 
2211  const std::vector<std::pair<unsigned char, unsigned char>> & pbc =
2212  this->parent_bracketing_nodes(child,child_node);
2213 
2214  for (const auto & pb : pbc)
2215  {
2216  const unsigned short n_n = this->n_nodes();
2217  if (pb.first < n_n && pb.second < n_n)
2218  returnval.push_back(std::make_pair(this->node_id(pb.first),
2219  this->node_id(pb.second)));
2220  else
2221  {
2222  // We must be on a non-full-order higher order element...
2223  libmesh_assert_not_equal_to(this->default_order(), FIRST);
2224  libmesh_assert_not_equal_to
2225  (second_order_equivalent_type (this->type(), true),
2226  this->type());
2227  libmesh_assert_equal_to
2228  (second_order_equivalent_type (this->type(), false),
2229  this->type());
2230 
2231  // And that's a shame, because this is a nasty search:
2232 
2233  // Build the full-order type
2234  ElemType full_type =
2235  second_order_equivalent_type(this->type(), /*full_ordered=*/ true);
2236  std::unique_ptr<Elem> full_elem = Elem::build(full_type);
2237 
2240 
2241  // Find the bracketing nodes by figuring out what
2242  // already-created children will have them.
2243 
2244  // This only doesn't break horribly because we add children
2245  // and nodes in straightforward + hierarchical orders...
2246  for (unsigned int c=0; c <= child; ++c)
2247  for (unsigned int n=0; n != this->n_nodes_in_child(c); ++n)
2248  {
2249  if (c == child && n == child_node)
2250  break;
2251 
2252  if (pb.first == full_elem->as_parent_node(c,n))
2253  {
2254  // We should be consistent
2255  if (pt1 != DofObject::invalid_id)
2256  libmesh_assert_equal_to(pt1, this->child_ptr(c)->node_id(n));
2257 
2258  pt1 = this->child_ptr(c)->node_id(n);
2259  }
2260 
2261  if (pb.second == full_elem->as_parent_node(c,n))
2262  {
2263  // We should be consistent
2264  if (pt2 != DofObject::invalid_id)
2265  libmesh_assert_equal_to(pt2, this->child_ptr(c)->node_id(n));
2266 
2267  pt2 = this->child_ptr(c)->node_id(n);
2268  }
2269  }
2270 
2271  // We should *usually* find all bracketing nodes by the time
2272  // we query them (again, because of the child & node add
2273  // order)
2274  //
2275  // The exception is if we're a HEX20, in which case we will
2276  // find pairs of vertex nodes and edge nodes bracketing the
2277  // new central node but we *won't* find the pairs of face
2278  // nodes which we would have had on a HEX27. In that case
2279  // we'll still have enough bracketing nodes for a
2280  // topological lookup, but we won't be able to make the
2281  // following assertions.
2282  if (this->type() != HEX20)
2283  {
2284  libmesh_assert_not_equal_to (pt1, DofObject::invalid_id);
2285  libmesh_assert_not_equal_to (pt2, DofObject::invalid_id);
2286  }
2287 
2288  if (pt1 != DofObject::invalid_id &&
2289  pt2 != DofObject::invalid_id)
2290  returnval.push_back(std::make_pair(pt1, pt2));
2291  }
2292  }
2293 
2294  return returnval;
2295 }
virtual unsigned int n_nodes() const =0
static std::unique_ptr< Elem > build(const ElemType type, Elem *p=nullptr)
Definition: elem.C:245
static const dof_id_type invalid_id
Definition: dof_object.h:347
static ElemType second_order_equivalent_type(const ElemType et, const bool full_ordered=true)
Definition: elem.C:2643
Elem * child(const unsigned int i) const
Definition: elem.h:2598
virtual Order default_order() const =0
virtual const std::vector< std::pair< unsigned char, unsigned char > > & parent_bracketing_nodes(unsigned int c, unsigned int n) const
Definition: elem.C:2001
virtual ElemType type() const =0
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:1914
virtual unsigned int n_nodes_in_child(unsigned int) const
Definition: elem.h:613
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2578
uint8_t dof_id_type
Definition: id_types.h:64

◆ build()

std::unique_ptr< Elem > libMesh::Elem::build ( const ElemType  type,
Elem p = nullptr 
)
staticinherited
Returns
An Elem of type type wrapped in a smart pointer.

Definition at line 245 of file elem.C.

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

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::UnstructuredMesh::copy_nodes_and_elements(), libMesh::UnstructuredMesh::create_submesh(), libMesh::MeshTools::Modification::flatten(), 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< T >::unpack(), and libMesh::GMVIO::write_ascii_old_impl().

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

◆ build_edge()

std::unique_ptr< Elem > libMesh::Elem::build_edge ( const unsigned int  i) const
inlineinherited

Creates an element coincident with edge i.

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

Definition at line 2292 of file elem.h.

References libMesh::Elem::build_edge_ptr().

2293 {
2294  // Call the const version of build_edge_ptr(), and const_cast the result.
2295  libmesh_deprecated();
2296  Elem * e = const_cast<Elem *>(this->build_edge_ptr(i).release());
2297  return std::unique_ptr<Elem>(e);
2298 }
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1811
virtual std::unique_ptr< Elem > build_edge_ptr(const unsigned int i)=0

◆ build_edge_ptr() [1/2]

virtual std::unique_ptr<Elem> libMesh::Elem::build_edge_ptr ( const unsigned int  i)
pure virtualinherited
Returns
An element coincident with edge i wrapped in a smart pointer.

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

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

Implemented in libMesh::Pyramid14, libMesh::Prism18, libMesh::Hex27, libMesh::RemoteElem, libMesh::InfQuad, libMesh::InfHex16, libMesh::Prism15, libMesh::Pyramid13, libMesh::Edge, libMesh::Hex20, libMesh::Tet10, libMesh::InfHex18, libMesh::InfPrism12, libMesh::Tet4, libMesh::InfPrism6, libMesh::InfHex8, libMesh::Hex8, libMesh::NodeElem, libMesh::Prism6, libMesh::Pyramid5, and libMesh::Face.

Referenced by libMesh::Elem::build_edge(), libMesh::Elem::build_edge_ptr(), libMesh::FE< Dim, LAGRANGE_VEC >::edge_reinit(), libMesh::ElemCutter::find_intersection_points(), and libMesh::Elem::is_child_on_edge().

◆ build_edge_ptr() [2/2]

std::unique_ptr< const Elem > libMesh::Elem::build_edge_ptr ( const unsigned int  i) const
inlineinherited

Definition at line 2278 of file elem.h.

References libMesh::Elem::build_edge_ptr().

2279 {
2280  // Call the non-const version of this function, return the result as
2281  // a std::unique_ptr<const Elem>.
2282  Elem * me = const_cast<Elem *>(this);
2283  const Elem * e = const_cast<const Elem *>(me->build_edge_ptr(i).release());
2284  return std::unique_ptr<const Elem>(e);
2285 }
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1811

◆ build_side()

std::unique_ptr< Elem > libMesh::Elem::build_side ( const unsigned int  i,
bool  proxy = true 
) const
inlineinherited
Returns
A proxy element coincident with side i.
Deprecated:
This method will eventually be removed since it hands back a non-const pointer to a side that could be used to indirectly modify this. Please use the the const-correct build_side_ptr() function instead.

Definition at line 2243 of file elem.h.

References libMesh::Elem::build_side_ptr().

2244 {
2245  // Call the const version of build_side_ptr(), and const_cast the result.
2246  libmesh_deprecated();
2247  Elem * s = const_cast<Elem *>(this->build_side_ptr(i, proxy).release());
2248  return std::unique_ptr<Elem>(s);
2249 }
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int i, bool proxy=true)=0
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1811

◆ build_side_ptr() [1/4]

virtual std::unique_ptr<Elem> libMesh::Elem::build_side_ptr ( const unsigned int  i,
bool  proxy = true 
)
pure virtualinherited
Returns
An element coincident with side i wrapped in a smart pointer.

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

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

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

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

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

◆ build_side_ptr() [2/4]

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

Definition at line 2215 of file elem.h.

References libMesh::Elem::build_side_ptr().

2216 {
2217  // Call the non-const version of this function, return the result as
2218  // a std::unique_ptr<const Elem>.
2219  Elem * me = const_cast<Elem *>(this);
2220  const Elem * s = const_cast<const Elem *>(me->build_side_ptr(i, proxy).release());
2221  return std::unique_ptr<const Elem>(s);
2222 }
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1811

◆ build_side_ptr() [3/4]

virtual void libMesh::Elem::build_side_ptr ( std::unique_ptr< Elem > &  side,
const unsigned int  i 
)
pure virtualinherited

Resets the loose element side, which may currently point to a different side than i or even a different element than this, to point to side i on this. If side is currently an element of the wrong type, it will be freed and a new element allocated; otherwise no memory allocation will occur.

This should not be called with proxy Side elements. This will cause side to be a full-ordered element, even if it is handed a lower-ordered element that must be replaced.

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

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

◆ build_side_ptr() [4/4]

void libMesh::Elem::build_side_ptr ( std::unique_ptr< const Elem > &  side,
const unsigned int  i 
) const
inlineinherited

Definition at line 2228 of file elem.h.

References libMesh::Elem::build_side_ptr().

2230 {
2231  // Hand off to the non-const version of this function
2232  Elem * me = const_cast<Elem *>(this);
2233  std::unique_ptr<Elem> e {const_cast<Elem *>(elem.release())};
2234  me->build_side_ptr(e, i);
2235  elem.reset(e.release());
2236 }
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1811

◆ centroid()

Point libMesh::Elem::centroid ( ) const
virtualinherited
Returns
The centroid of the element. The centroid is computed as the average of all the element vertices.

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

Definition at line 344 of file elem.C.

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

Referenced by libMesh::UnstructuredMesh::find_neighbors(), libMesh::LocationMap< T >::point_of(), libMesh::FE< Dim, LAGRANGE_VEC >::shape(), libMesh::FE< Dim, LAGRANGE_VEC >::shape_deriv(), and libMesh::FE< Dim, LAGRANGE_VEC >::shape_second_deriv().

345 {
346  Point cp;
347 
348  for (unsigned int n=0; n<this->n_vertices(); n++)
349  cp.add (this->point(n));
350 
351  return (cp /= static_cast<Real>(this->n_vertices()));
352 }
virtual unsigned int n_vertices() const =0

◆ child()

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

References libMesh::Elem::child_ptr().

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

2599 {
2600  // Support the deprecated interface by calling the new,
2601  // const-correct interface and casting the result to an Elem *.
2602  libmesh_deprecated();
2603  return const_cast<Elem *>(this->child_ptr(i));
2604 }
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1811
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2578

◆ child_neighbor() [1/2]

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 nullptr.

Definition at line 2105 of file elem.h.

References libMesh::Elem::neighbor_ptr_range().

2106 {
2107  for (auto n : elem->neighbor_ptr_range())
2108  if (n && n->parent() == this)
2109  return n;
2110 
2111  return nullptr;
2112 }

◆ child_neighbor() [2/2]

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 nullptr.

Definition at line 2117 of file elem.h.

References libMesh::Elem::neighbor_ptr_range().

2118 {
2119  for (auto n : elem->neighbor_ptr_range())
2120  if (n && n->parent() == this)
2121  return n;
2122 
2123  return nullptr;
2124 }

◆ child_ptr() [1/2]

◆ child_ptr() [2/2]

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

References libMesh::Elem::_children.

2588 {
2589  libmesh_assert(_children);
2590  libmesh_assert(_children[i]);
2591 
2592  return _children[i];
2593 }
Elem ** _children
Definition: elem.h:1707

◆ child_ref_range() [1/2]

SimpleRange< Elem::ChildRefIter > libMesh::Elem::child_ref_range ( )
inlineinherited

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

Definition at line 1779 of file elem.h.

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

Referenced by libMesh::Elem::active_family_tree(), libMesh::Elem::active_family_tree_by_neighbor(), libMesh::Elem::active_family_tree_by_topological_neighbor(), libMesh::HPCoarsenTest::add_projection(), libMesh::Elem::ancestor(), libMesh::OldSolutionBase< Output, point_output >::check_old_context(), libMesh::Elem::coarsen(), libMesh::FEGenericBase< FEOutputType< T >::type >::coarsened_dof_values(), libMesh::connect_children(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::ExactErrorEstimator::estimate_error(), libMesh::Elem::family_tree(), libMesh::Elem::family_tree_by_neighbor(), libMesh::Elem::family_tree_by_subneighbor(), libMesh::Elem::find_interior_neighbors(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshRefinement::flag_elements_by_nelem_target(), libMesh::Elem::has_ancestor_children(), libMesh::MeshTools::libmesh_assert_topology_consistent_procids< Elem >(), libMesh::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::Elem::set_p_level(), libMesh::Partitioner::set_parent_processor_ids(), libMesh::Elem::total_family_tree(), libMesh::Elem::total_family_tree_by_neighbor(), and libMesh::Elem::total_family_tree_by_subneighbor().

1780 {
1781  libmesh_assert(_children);
1782  return {_children, _children + this->n_children()};
1783 }
virtual unsigned int n_children() const =0
Elem ** _children
Definition: elem.h:1707

◆ child_ref_range() [2/2]

SimpleRange< Elem::ConstChildRefIter > libMesh::Elem::child_ref_range ( ) const
inlineinherited

Definition at line 1787 of file elem.h.

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

1788 {
1789  libmesh_assert(_children);
1790  return {_children, _children + this->n_children()};
1791 }
virtual unsigned int n_children() const =0
Elem ** _children
Definition: elem.h:1707

◆ clear_dofs()

void libMesh::DofObject::clear_dofs ( )
inlineinherited

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

Definition at line 621 of file dof_object.h.

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

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

622 {
623  // vector swap trick to force deallocation
624  index_buffer_t().swap(_idx_buf);
625 
626  libmesh_assert_equal_to (this->n_systems(), 0);
627  libmesh_assert (_idx_buf.empty());
628 }
unsigned int n_systems() const
Definition: dof_object.h:749
std::vector< index_t > index_buffer_t
Definition: dof_object.h:507
index_buffer_t _idx_buf
Definition: dof_object.h:508

◆ clear_old_dof_object()

void libMesh::DofObject::clear_old_dof_object ( )
inherited

Sets the old_dof_object to nullptr

Definition at line 142 of file dof_object.C.

References libMesh::DofObject::old_dof_object.

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

143 {
144  delete this->old_dof_object;
145  this->old_dof_object = nullptr;
146 }
DofObject * old_dof_object
Definition: dof_object.h:79

◆ close_to_point()

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 2326 of file elem.C.

References libMesh::Elem::point_test().

2327 {
2328  // This test uses the user's passed-in tolerance for the
2329  // bounding box test as well, thereby allowing the routine to
2330  // find points which are not only "in" the element, but also
2331  // "nearby" to within some tolerance.
2332  return this->point_test(p, tol, tol);
2333 }
bool point_test(const Point &p, Real box_tol, Real map_tol) const
Definition: elem.C:2338

◆ coarsen()

void libMesh::Elem::coarsen ( )
inherited

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

Definition at line 106 of file elem_refinement.C.

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

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

◆ compute_key() [1/4]

◆ compute_key() [2/4]

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

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

2764 {
2765  // Order the two so that n0 < n1
2766  if (n0 > n1) std::swap (n0, n1);
2767 
2768  return Utility::hashword2(n0, n1);
2769 }
void swap(Iterator &lhs, Iterator &rhs)
uint32_t hashword2(const uint32_t &first, const uint32_t &second, uint32_t initval=0)
Definition: hashword.h:210

◆ compute_key() [3/4]

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

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

2777 {
2778  // Order the numbers such that n0 < n1 < n2.
2779  // We'll do it in 3 steps like this:
2780  //
2781  // n0 n1 n2
2782  // min(n0,n1) max(n0,n1) n2
2783  // min(n0,n1) min(n2,max(n0,n1) max(n2,max(n0,n1)
2784  // |\ /| |
2785  // | \ / | |
2786  // | / | |
2787  // | / \| |
2788  // gb min= min max gb max
2789 
2790  // Step 1
2791  if (n0 > n1) std::swap (n0, n1);
2792 
2793  // Step 2
2794  if (n1 > n2) std::swap (n1, n2);
2795 
2796  // Step 3
2797  if (n0 > n1) std::swap (n0, n1);
2798 
2799  libmesh_assert ((n0 < n1) && (n1 < n2));
2800 
2801  dof_id_type array[3] = {n0, n1, n2};
2802  return Utility::hashword(array, 3);
2803 }
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

◆ compute_key() [4/4]

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

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

2812 {
2813  // Sort first
2814  // Step 1
2815  if (n0 > n1) std::swap (n0, n1);
2816 
2817  // Step 2
2818  if (n2 > n3) std::swap (n2, n3);
2819 
2820  // Step 3
2821  if (n0 > n2) std::swap (n0, n2);
2822 
2823  // Step 4
2824  if (n1 > n3) std::swap (n1, n3);
2825 
2826  // Finally sort step 5
2827  if (n1 > n2) std::swap (n1, n2);
2828 
2829  libmesh_assert ((n0 < n1) && (n1 < n2) && (n2 < n3));
2830 
2831  dof_id_type array[4] = {n0, n1, n2, n3};
2832  return Utility::hashword(array, 4);
2833 }
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

◆ connectivity()

◆ contains_edge_of()

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 477 of file elem.C.

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

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

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

◆ contains_point()

bool libMesh::Elem::contains_point ( const Point p,
Real  tol = TOLERANCE 
) const
virtualinherited
Returns
true if the point p is contained in this element, false otherwise.

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

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

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

Definition at line 2301 of file elem.C.

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

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

2302 {
2303  // We currently allow the user to enlarge the bounding box by
2304  // providing a tol > TOLERANCE (so this routine is identical to
2305  // Elem::close_to_point()), but print a warning so that the
2306  // user can eventually switch his code over to calling close_to_point()
2307  // instead, which is intended to be used for this purpose.
2308  if (tol > TOLERANCE)
2309  {
2310  libmesh_do_once(libMesh::err
2311  << "WARNING: Resizing bounding box to match user-specified tolerance!\n"
2312  << "In the future, calls to Elem::contains_point() with tol > TOLERANCE\n"
2313  << "will be more optimized, but should not be used\n"
2314  << "to search for points 'close to' elements!\n"
2315  << "Instead, use Elem::close_to_point() for this purpose.\n"
2316  << std::endl;);
2317  return this->point_test(p, tol, tol);
2318  }
2319  else
2320  return this->point_test(p, TOLERANCE, tol);
2321 }
static const Real TOLERANCE
bool point_test(const Point &p, Real box_tol, Real map_tol) const
Definition: elem.C:2338
OStreamProxy err(std::cerr)

◆ contains_vertex_of()

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 466 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().

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

◆ contract()

void libMesh::Elem::contract ( )
inherited

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

Definition at line 171 of file elem_refinement.C.

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

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

172 {
173  // Subactive elements get deleted entirely, not contracted
174  libmesh_assert (this->active());
175 
176  // Active contracted elements no longer can have children
177  delete [] _children;
178  _children = nullptr;
179 
180  if (this->refinement_flag() == Elem::JUST_COARSENED)
182 }
RefinementState refinement_flag() const
Definition: elem.h:2638
void set_refinement_flag(const RefinementState rflag)
Definition: elem.h:2646
Elem ** _children
Definition: elem.h:1707
bool active() const
Definition: elem.h:2390

◆ debug_buffer()

void libMesh::DofObject::debug_buffer ( ) const
inherited

Print our buffer for debugging.

Definition at line 538 of file dof_object.C.

References libMesh::DofObject::_idx_buf, libMesh::MeshTools::Generation::Private::idx(), and libMesh::out.

539 {
540  libMesh::out << " [ ";
541  for (const auto & idx : _idx_buf)
542  libMesh::out << idx << " ";
543  libMesh::out << "]\n";
544 }
index_buffer_t _idx_buf
Definition: dof_object.h:508
OStreamProxy out(std::cout)
unsigned int idx(const ElemType type, const unsigned int nx, const unsigned int i, const unsigned int j)

◆ default_order()

◆ dim()

virtual unsigned short libMesh::Cell::dim ( ) const
inlineoverridevirtualinherited
Returns
3, the dimensionality of the object.

Implements libMesh::Elem.

Definition at line 61 of file cell.h.

61 { return 3; }

◆ disable_print_counter_info() [1/2]

void libMesh::ReferenceCounter::disable_print_counter_info ( )
staticinherited

Definition at line 106 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter.

Referenced by libMesh::LibMeshInit::LibMeshInit().

107 {
108  _enable_print_counter = false;
109  return;
110 }

◆ disable_print_counter_info() [2/2]

void libMesh::ReferenceCounter::disable_print_counter_info ( )
staticinherited

Definition at line 106 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter.

Referenced by libMesh::LibMeshInit::LibMeshInit().

107 {
108  _enable_print_counter = false;
109  return;
110 }

◆ dof_number() [1/2]

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 833 of file dof_object.h.

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

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

836 {
837  libmesh_assert_less (s, this->n_systems());
838  libmesh_assert_less (var, this->n_vars(s));
839  libmesh_assert_less (comp, this->n_comp(s,var));
840 
841  const std::pair<unsigned int, unsigned int>
842  vg_vig = this->var_to_vg_and_offset(s,var);
843 
844  const unsigned int
845  n_comp = this->n_comp_group(s,vg_vig.first);
846 
847  return this->dof_number(s, vg_vig.first, vg_vig.second,
848  comp, n_comp);
849 }
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
Definition: dof_object.h:833
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:803
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:768
unsigned int n_systems() const
Definition: dof_object.h:749
std::pair< unsigned int, unsigned int > var_to_vg_and_offset(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:887
unsigned int n_comp_group(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:816

◆ dof_number() [2/2]

dof_id_type libMesh::DofObject::dof_number ( const unsigned int  s,
const unsigned int  vg,
const unsigned int  vig,
const unsigned int  comp,
const unsigned int  n_comp 
) const
inlineinherited
Returns
The global degree of freedom number for variable group vg, variable index vig within the group, component comp out of n_comp, for system s on this DofObject

Even users who need to call dof_number from user code probably don't want to call this overload.

Definition at line 854 of file dof_object.h.

References libMesh::DofObject::_idx_buf, libMesh::DofObject::invalid_id, libMesh::DofObject::n_comp(), libMesh::DofObject::n_systems(), libMesh::DofObject::n_var_groups(), libMesh::DofObject::n_vars(), and libMesh::DofObject::start_idx().

859 {
860  libmesh_assert_less (s, this->n_systems());
861  libmesh_assert_less (vg, this->n_var_groups(s));
862  libmesh_assert_less (vig, this->n_vars(s,vg));
863 
864  const unsigned int
865  start_idx_sys = this->start_idx(s);
866 
867  libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());
868 
869  const dof_id_type
870  base_idx = _idx_buf[start_idx_sys + 2*vg + 1];
871 
872  // if the first component is invalid, they
873  // are all invalid
874  if (base_idx == invalid_id)
875  return invalid_id;
876 
877  // otherwise the index is the first component
878  // index augmented by the component number
879  else
880  return cast_int<dof_id_type>(base_idx + vig*n_comp + comp);
881 }
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:803
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:758
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:768
unsigned int n_systems() const
Definition: dof_object.h:749
static const dof_id_type invalid_id
Definition: dof_object.h:347
unsigned int start_idx(const unsigned int s) const
Definition: dof_object.h:936
index_buffer_t _idx_buf
Definition: dof_object.h:508
uint8_t dof_id_type
Definition: id_types.h:64

◆ edge_index_range()

IntRange< unsigned short > libMesh::Elem::edge_index_range ( ) const
inlineinherited
Returns
An integer range from 0 up to (but not including) the number of edges this element has.

Definition at line 2157 of file elem.h.

References libMesh::Elem::n_edges().

Referenced by libMesh::FEGenericBase< FEOutputType< T >::type >::coarsened_dof_values(), libMesh::BoundaryInfo::copy_boundary_ids(), libMesh::Parallel::Packing< T >::pack(), and libMesh::Parallel::Packing< T >::unpack().

2158 {
2159  return {0, cast_int<unsigned short>(this->n_edges())};
2160 }
virtual unsigned int n_edges() const =0

◆ embedding_matrix()

◆ embedding_matrix_version()

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

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

1609 { return 0; }

◆ enable_print_counter_info() [1/2]

void libMesh::ReferenceCounter::enable_print_counter_info ( )
staticinherited

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

Definition at line 100 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter.

101 {
102  _enable_print_counter = true;
103  return;
104 }

◆ enable_print_counter_info() [2/2]

void libMesh::ReferenceCounter::enable_print_counter_info ( )
staticinherited

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

Definition at line 100 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter.

101 {
102  _enable_print_counter = true;
103  return;
104 }

◆ family_tree()

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 1534 of file elem.C.

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

1536 {
1537  // The "family tree" doesn't include subactive elements
1538  libmesh_assert(!this->subactive());
1539 
1540  // Clear the vector if the flag reset tells us to.
1541  if (reset)
1542  family.clear();
1543 
1544  // Add this element to the family tree.
1545  family.push_back(this);
1546 
1547  // Recurse into the elements children, if it has them.
1548  // Do not clear the vector any more.
1549  if (!this->active())
1550  for (auto & c : this->child_ref_range())
1551  if (!c.is_remote())
1552  c.family_tree (family, false);
1553 }
SimpleRange< ChildRefIter > child_ref_range()
Definition: elem.h:1779
bool subactive() const
Definition: elem.h:2408
bool active() const
Definition: elem.h:2390

◆ family_tree_by_neighbor()

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 1661 of file elem.C.

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

1664 {
1665  // The "family tree" doesn't include subactive elements
1666  libmesh_assert(!this->subactive());
1667 
1668  // Clear the vector if the flag reset tells us to.
1669  if (reset)
1670  family.clear();
1671 
1672  // This only makes sense if we're already a neighbor
1673  libmesh_assert (this->has_neighbor(neighbor_in));
1674 
1675  // Add this element to the family tree.
1676  family.push_back(this);
1677 
1678  // Recurse into the elements children, if it's not active.
1679  // Do not clear the vector any more.
1680  if (!this->active())
1681  for (auto & c : this->child_ref_range())
1682  if (&c != remote_elem && c.has_neighbor(neighbor_in))
1683  c.family_tree_by_neighbor (family, neighbor_in, false);
1684 }
bool has_neighbor(const Elem *elem) const
Definition: elem.h:2093
SimpleRange< ChildRefIter > child_ref_range()
Definition: elem.h:1779
bool subactive() const
Definition: elem.h:2408
bool active() const
Definition: elem.h:2390
const RemoteElem * remote_elem
Definition: remote_elem.C:57

◆ family_tree_by_side()

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 1601 of file elem.C.

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

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

1604 {
1605  // The "family tree" doesn't include subactive elements
1606  libmesh_assert(!this->subactive());
1607 
1608  // Clear the vector if the flag reset tells us to.
1609  if (reset)
1610  family.clear();
1611 
1612  libmesh_assert_less (s, this->n_sides());
1613 
1614  // Add this element to the family tree.
1615  family.push_back(this);
1616 
1617  // Recurse into the elements children, if it has them.
1618  // Do not clear the vector any more.
1619  if (!this->active())
1620  {
1621  const unsigned int nc = this->n_children();
1622  for (unsigned int c = 0; c != nc; c++)
1623  if (!this->child_ptr(c)->is_remote() && this->is_child_on_side(c, s))
1624  this->child_ptr(c)->family_tree_by_side (family, s, false);
1625  }
1626 }
virtual bool is_child_on_side(const unsigned int c, const unsigned int s) const =0
virtual unsigned int n_children() const =0
void family_tree_by_side(std::vector< const Elem *> &family, const unsigned int side, const bool reset=true) const
Definition: elem.C:1601
virtual bool is_remote() const
Definition: elem.h:555
virtual unsigned int n_sides() const =0
bool subactive() const
Definition: elem.h:2408
bool active() const
Definition: elem.h:2390
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2578

◆ family_tree_by_subneighbor()

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 1712 of file elem.C.

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

1716 {
1717  // The "family tree" doesn't include subactive elements
1718  libmesh_assert(!this->subactive());
1719 
1720  // Clear the vector if the flag reset tells us to.
1721  if (reset)
1722  family.clear();
1723 
1724  // To simplify this function we need an existing neighbor
1725  libmesh_assert (neighbor_in);
1726  libmesh_assert_not_equal_to (neighbor_in, remote_elem);
1727  libmesh_assert (this->has_neighbor(neighbor_in));
1728 
1729  // This only makes sense if subneighbor descends from neighbor
1730  libmesh_assert (subneighbor);
1731  libmesh_assert_not_equal_to (subneighbor, remote_elem);
1732  libmesh_assert (neighbor_in->is_ancestor_of(subneighbor));
1733 
1734  // Add this element to the family tree if applicable.
1735  if (neighbor_in == subneighbor)
1736  family.push_back(this);
1737 
1738  // Recurse into the elements children, if it's not active.
1739  // Do not clear the vector any more.
1740  if (!this->active())
1741  for (auto & c : this->child_ref_range())
1742  if (&c != remote_elem)
1743  for (auto child_neigh : c.neighbor_ptr_range())
1744  if (child_neigh &&
1745  (child_neigh == neighbor_in ||
1746  (child_neigh->parent() == neighbor_in &&
1747  child_neigh->is_ancestor_of(subneighbor))))
1748  c.family_tree_by_subneighbor (family, child_neigh,
1749  subneighbor, false);
1750 }
bool has_neighbor(const Elem *elem) const
Definition: elem.h:2093
SimpleRange< ChildRefIter > child_ref_range()
Definition: elem.h:1779
bool subactive() const
Definition: elem.h:2408
bool active() const
Definition: elem.h:2390
const RemoteElem * remote_elem
Definition: remote_elem.C:57

◆ find_edge_neighbors() [1/2]

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 637 of file elem.C.

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

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

640 {
641  // Simple but perhaps suboptimal code: find elements containing the
642  // first point, then winnow this set down by removing elements which
643  // don't also contain the second point
644 
645  libmesh_assert(this->contains_point(p2));
646  this->find_point_neighbors(p1, neighbor_set);
647 
648  std::set<const Elem *>::iterator it = neighbor_set.begin();
649  const std::set<const Elem *>::iterator end = neighbor_set.end();
650 
651  while (it != end)
652  {
653  // As of C++11, set::erase returns an iterator to the element
654  // following the erased element, or end.
655  if (!(*it)->contains_point(p2))
656  it = neighbor_set.erase(it);
657  else
658  ++it;
659  }
660 }
IterBase * end
virtual bool contains_point(const Point &p, Real tol=TOLERANCE) const
Definition: elem.C:2301
void find_point_neighbors(const Point &p, std::set< const Elem *> &neighbor_set) const
Definition: elem.C:498

◆ find_edge_neighbors() [2/2]

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 664 of file elem.C.

References libMesh::Elem::contains_edge_of(), and libMesh::remote_elem.

665 {
666  neighbor_set.clear();
667  neighbor_set.insert(this);
668 
669  std::set<const Elem *> untested_set, next_untested_set;
670  untested_set.insert(this);
671 
672  while (!untested_set.empty())
673  {
674  // Loop over all the elements in the patch that haven't already
675  // been tested
676  for (const auto & elem : untested_set)
677  {
678  for (auto current_neighbor : elem->neighbor_ptr_range())
679  {
680  if (current_neighbor &&
681  current_neighbor != remote_elem) // we have a real neighbor on this side
682  {
683  if (current_neighbor->active()) // ... if it is active
684  {
685  if (this->contains_edge_of(current_neighbor) // ... and touches us
686  || current_neighbor->contains_edge_of(this))
687  {
688  // Make sure we'll test it
689  if (!neighbor_set.count(current_neighbor))
690  next_untested_set.insert (current_neighbor);
691 
692  // And add it
693  neighbor_set.insert (current_neighbor);
694  }
695  }
696 #ifdef LIBMESH_ENABLE_AMR
697  else // ... the neighbor is *not* active,
698  { // ... so add *all* neighboring
699  // active children
700  std::vector<const Elem *> active_neighbor_children;
701 
702  current_neighbor->active_family_tree_by_neighbor
703  (active_neighbor_children, elem);
704 
705  for (const auto & current_child : active_neighbor_children)
706  if (this->contains_edge_of(current_child) || current_child->contains_edge_of(this))
707  {
708  // Make sure we'll test it
709  if (!neighbor_set.count(current_child))
710  next_untested_set.insert (current_child);
711 
712  neighbor_set.insert (current_child);
713  }
714  }
715 #endif // #ifdef LIBMESH_ENABLE_AMR
716  }
717  }
718  }
719  untested_set.swap(next_untested_set);
720  next_untested_set.clear();
721  }
722 }
bool contains_edge_of(const Elem *e) const
Definition: elem.C:477
const RemoteElem * remote_elem
Definition: remote_elem.C:57

◆ find_interior_neighbors()

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 725 of file elem.C.

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

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

726 {
727  neighbor_set.clear();
728 
729  if ((this->dim() >= LIBMESH_DIM) ||
730  !this->interior_parent())
731  return;
732 
733  const Elem * ip = this->interior_parent();
734  libmesh_assert (ip->contains_vertex_of(this) ||
735  this->contains_vertex_of(ip));
736 
737  libmesh_assert (!ip->subactive());
738 
739 #ifdef LIBMESH_ENABLE_AMR
740  while (!ip->active()) // only possible with AMR, be careful because
741  { // ip->child_ptr(c) is only good with AMR.
742  for (auto & child : ip->child_ref_range())
743  {
744  if (child.contains_vertex_of(this) ||
745  this->contains_vertex_of(&child))
746  {
747  ip = &child;
748  break;
749  }
750  }
751  }
752 #endif
753 
754  this->find_point_neighbors(neighbor_set, ip);
755 
756  // Now we have all point neighbors from the interior manifold, but
757  // we need to weed out any neighbors that *only* intersect us at one
758  // point (or at one edge, if we're a 1-D element in 3D).
759  //
760  // The refinement hierarchy helps us here: if the interior element
761  // has a lower or equal refinement level then we can discard it iff
762  // it doesn't contain all our vertices. If it has a higher
763  // refinement level then we can discard it iff we don't contain at
764  // least dim()+1 of its vertices
765  std::set<const Elem *>::iterator it = neighbor_set.begin();
766  const std::set<const Elem *>::iterator end = neighbor_set.end();
767 
768  while (it != end)
769  {
770  std::set<const Elem *>::iterator current = it++;
771  const Elem * elem = *current;
772 
773  // This won't invalidate iterator it, because it is already
774  // pointing to the next element
775  if (elem->level() > this->level())
776  {
777  unsigned int vertices_contained = 0;
778  for (auto & n : elem->node_ref_range())
779  if (this->contains_point(n))
780  vertices_contained++;
781 
782  if (vertices_contained <= this->dim())
783  {
784  neighbor_set.erase(current);
785  continue;
786  }
787  }
788  else
789  {
790  for (auto & n : this->node_ref_range())
791  {
792  if (!elem->contains_point(n))
793  {
794  neighbor_set.erase(current);
795  break;
796  }
797  }
798  }
799  }
800 }
const Elem * interior_parent() const
Definition: elem.C:804
IterBase * end
SimpleRange< ChildRefIter > child_ref_range()
Definition: elem.h:1779
virtual bool contains_point(const Point &p, Real tol=TOLERANCE) const
Definition: elem.C:2301
void find_point_neighbors(const Point &p, std::set< const Elem *> &neighbor_set) const
Definition: elem.C:498
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1811
bool contains_vertex_of(const Elem *e) const
Definition: elem.C:466
Elem * child(const unsigned int i) const
Definition: elem.h:2598
SimpleRange< NodeRefIter > node_ref_range()
Definition: elem.h:2130
unsigned int level() const
Definition: elem.h:2521
virtual unsigned short dim() const =0

◆ find_point_neighbors() [1/3]

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 498 of file elem.C.

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

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

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

◆ find_point_neighbors() [2/3]

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 561 of file elem.C.

References libMesh::Elem::find_point_neighbors().

562 {
563  this->find_point_neighbors(neighbor_set, this);
564 }
void find_point_neighbors(const Point &p, std::set< const Elem *> &neighbor_set) const
Definition: elem.C:498

◆ find_point_neighbors() [3/3]

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 568 of file elem.C.

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

570 {
571  libmesh_assert(start_elem);
572  libmesh_assert(start_elem->active());
573  libmesh_assert(start_elem->contains_vertex_of(this) ||
574  this->contains_vertex_of(start_elem));
575 
576  neighbor_set.clear();
577  neighbor_set.insert(start_elem);
578 
579  std::set<const Elem *> untested_set, next_untested_set;
580  untested_set.insert(start_elem);
581 
582  while (!untested_set.empty())
583  {
584  // Loop over all the elements in the patch that haven't already
585  // been tested
586  for (const auto & elem : untested_set)
587  for (auto current_neighbor : elem->neighbor_ptr_range())
588  {
589  if (current_neighbor &&
590  current_neighbor != remote_elem) // we have a real neighbor on this side
591  {
592  if (current_neighbor->active()) // ... if it is active
593  {
594  if (this->contains_vertex_of(current_neighbor) // ... and touches us
595  || current_neighbor->contains_vertex_of(this))
596  {
597  // Make sure we'll test it
598  if (!neighbor_set.count(current_neighbor))
599  next_untested_set.insert (current_neighbor);
600 
601  // And add it
602  neighbor_set.insert (current_neighbor);
603  }
604  }
605 #ifdef LIBMESH_ENABLE_AMR
606  else // ... the neighbor is *not* active,
607  { // ... so add *all* neighboring
608  // active children
609  std::vector<const Elem *> active_neighbor_children;
610 
611  current_neighbor->active_family_tree_by_neighbor
612  (active_neighbor_children, elem);
613 
614  for (const auto & current_child : active_neighbor_children)
615  {
616  if (this->contains_vertex_of(current_child) ||
617  (current_child)->contains_vertex_of(this))
618  {
619  // Make sure we'll test it
620  if (!neighbor_set.count(current_child))
621  next_untested_set.insert (current_child);
622 
623  neighbor_set.insert (current_child);
624  }
625  }
626  }
627 #endif // #ifdef LIBMESH_ENABLE_AMR
628  }
629  }
630  untested_set.swap(next_untested_set);
631  next_untested_set.clear();
632  }
633 }
bool contains_vertex_of(const Elem *e) const
Definition: elem.C:466
const RemoteElem * remote_elem
Definition: remote_elem.C:57

◆ first_order_equivalent_type()

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 2584 of file elem.C.

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

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

2585 {
2586  switch (et)
2587  {
2588  case EDGE2:
2589  case EDGE3:
2590  case EDGE4:
2591  return EDGE2;
2592  case TRI3:
2593  case TRI6:
2594  return TRI3;
2595  case TRISHELL3:
2596  return TRISHELL3;
2597  case QUAD4:
2598  case QUAD8:
2599  case QUAD9:
2600  return QUAD4;
2601  case QUADSHELL4:
2602  case QUADSHELL8:
2603  return QUADSHELL4;
2604  case TET4:
2605  case TET10:
2606  return TET4;
2607  case HEX8:
2608  case HEX27:
2609  case HEX20:
2610  return HEX8;
2611  case PRISM6:
2612  case PRISM15:
2613  case PRISM18:
2614  return PRISM6;
2615  case PYRAMID5:
2616  case PYRAMID13:
2617  case PYRAMID14:
2618  return PYRAMID5;
2619 
2620 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
2621 
2622  case INFQUAD4:
2623  case INFQUAD6:
2624  return INFQUAD4;
2625  case INFHEX8:
2626  case INFHEX16:
2627  case INFHEX18:
2628  return INFHEX8;
2629  case INFPRISM6:
2630  case INFPRISM12:
2631  return INFPRISM6;
2632 
2633 #endif
2634 
2635  default:
2636  // unknown element
2637  return INVALID_ELEM;
2638  }
2639 }

◆ get_info() [1/3]

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 (const auto & pr : _counts)
59  {
60  const std::string name(pr.first);
61  const unsigned int creations = pr.second.first;
62  const unsigned int destructions = pr.second.second;
63 
64  oss << "| " << name << " reference count information:\n"
65  << "| Creations: " << creations << '\n'
66  << "| Destructions: " << destructions << '\n';
67  }
68 
69  oss << " ---------------------------------------------------------------------------- \n";
70 
71  return oss.str();
72 
73 #else
74 
75  return "";
76 
77 #endif
78 }
std::string name(const ElemQuality q)
Definition: elem_quality.C:42

◆ get_info() [2/3]

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 (const auto & pr : _counts)
59  {
60  const std::string name(pr.first);
61  const unsigned int creations = pr.second.first;
62  const unsigned int destructions = pr.second.second;
63 
64  oss << "| " << name << " reference count information:\n"
65  << "| Creations: " << creations << '\n'
66  << "| Destructions: " << destructions << '\n';
67  }
68 
69  oss << " ---------------------------------------------------------------------------- \n";
70 
71  return oss.str();
72 
73 #else
74 
75  return "";
76 
77 #endif
78 }
std::string name(const ElemQuality q)
Definition: elem_quality.C:42

◆ get_info() [3/3]

std::string libMesh::Elem::get_info ( ) const
inherited

Prints relevant information about the element to a string.

Definition at line 2448 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::print_info().

2449 {
2450  std::ostringstream oss;
2451 
2452  oss << " Elem Information" << '\n'
2453  << " id()=";
2454 
2455  if (this->valid_id())
2456  oss << this->id();
2457  else
2458  oss << "invalid";
2459 
2460 #ifdef LIBMESH_ENABLE_UNIQUE_ID
2461  oss << ", unique_id()=";
2462  if (this->valid_unique_id())
2463  oss << this->unique_id();
2464  else
2465  oss << "invalid";
2466 #endif
2467 
2468  oss << ", processor_id()=" << this->processor_id() << '\n';
2469 
2470  oss << " type()=" << Utility::enum_to_string(this->type()) << '\n'
2471  << " dim()=" << this->dim() << '\n'
2472  << " n_nodes()=" << this->n_nodes() << '\n';
2473 
2474  for (unsigned int n=0; n != this->n_nodes(); ++n)
2475  oss << " " << n << this->node_ref(n);
2476 
2477  oss << " n_sides()=" << this->n_sides() << '\n';
2478 
2479  for (unsigned int s=0; s != this->n_sides(); ++s)
2480  {
2481  oss << " neighbor(" << s << ")=";
2482  if (this->neighbor_ptr(s))
2483  oss << this->neighbor_ptr(s)->id() << '\n';
2484  else
2485  oss << "nullptr\n";
2486  }
2487 
2488 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
2489  if (!this->infinite())
2490  {
2491 #endif
2492  oss << " hmin()=" << this->hmin()
2493  << ", hmax()=" << this->hmax() << '\n'
2494  << " volume()=" << this->volume() << '\n';
2495 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
2496  }
2497 #endif
2498  oss << " active()=" << this->active()
2499  << ", ancestor()=" << this->ancestor()
2500  << ", subactive()=" << this->subactive()
2501  << ", has_children()=" << this->has_children() << '\n'
2502  << " parent()=";
2503  if (this->parent())
2504  oss << this->parent()->id() << '\n';
2505  else
2506  oss << "nullptr\n";
2507  oss << " level()=" << this->level()
2508  << ", p_level()=" << this->p_level() << '\n'
2509 #ifdef LIBMESH_ENABLE_AMR
2510  << " refinement_flag()=" << Utility::enum_to_string(this->refinement_flag()) << '\n'
2511  << " p_refinement_flag()=" << Utility::enum_to_string(this->p_refinement_flag()) << '\n'
2512 #endif
2513 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
2514  << " infinite()=" << this->infinite() << '\n';
2515  if (this->infinite())
2516  oss << " origin()=" << this->origin() << '\n'
2517 #endif
2518  ;
2519 
2520  oss << " DoFs=";
2521  for (unsigned int s=0; s != this->n_systems(); ++s)
2522  for (unsigned int v=0; v != this->n_vars(s); ++v)
2523  for (unsigned int c=0; c != this->n_comp(s,v); ++c)
2524  oss << '(' << s << '/' << v << '/' << this->dof_number(s,v,c) << ") ";
2525 
2526 
2527  return oss.str();
2528 }
RefinementState refinement_flag() const
Definition: elem.h:2638
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
Definition: dof_object.h:833
const Elem * parent() const
Definition: elem.h:2479
virtual Point origin() const
Definition: elem.h:1553
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:803
RefinementState p_refinement_flag() const
Definition: elem.h:2654
unique_id_type unique_id() const
Definition: dof_object.h:672
unsigned int p_level() const
Definition: elem.h:2555
virtual Real hmax() const
Definition: elem.C:373
bool ancestor() const
Definition: elem.C:1427
const Node & node_ref(const unsigned int i) const
Definition: elem.h:1979
dof_id_type id() const
Definition: dof_object.h:655
virtual Real hmin() const
Definition: elem.C:356
virtual unsigned int n_nodes() const =0
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:768
unsigned int n_systems() const
Definition: dof_object.h:749
bool valid_unique_id() const
Definition: dof_object.h:705
std::string enum_to_string(const T e)
virtual unsigned int n_sides() const =0
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:2050
unsigned int level() const
Definition: elem.h:2521
bool valid_id() const
Definition: dof_object.h:697
virtual unsigned short dim() const =0
bool subactive() const
Definition: elem.h:2408
virtual Real volume() const
Definition: elem.C:2826
virtual bool infinite() const =0
bool active() const
Definition: elem.h:2390
processor_id_type processor_id() const
Definition: dof_object.h:717
virtual ElemType type() const =0
bool has_children() const
Definition: elem.h:2428

◆ get_node()

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

References libMesh::Elem::node_ptr().

1997 {
1998  // This const function has incorrectly returned a non-const pointer
1999  // for years. Now that it is reimplemented in terms of the new
2000  // interface which does return a const pointer, we need to use a
2001  // const_cast to mimic the old (incorrect) behavior. This function
2002  // is now deprecated and eventually will be removed entirely,
2003  // obviating the need for this ugly cast.
2004  libmesh_deprecated();
2005  return const_cast<Node *>(this->node_ptr(i));
2006 }
const Node * node_ptr(const unsigned int i) const
Definition: elem.h:1957

◆ get_node_index()

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

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

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

2013 {
2014  for (unsigned int n=0; n != this->n_nodes(); ++n)
2015  if (this->_nodes[n] == node_ptr)
2016  return n;
2017 
2018  return libMesh::invalid_uint;
2019 }
Node ** _nodes
Definition: elem.h:1695
const unsigned int invalid_uint
Definition: libmesh.h:245
virtual unsigned int n_nodes() const =0
const Node * node_ptr(const unsigned int i) const
Definition: elem.h:1957

◆ get_nodes()

const Node *const * libMesh::Elem::get_nodes ( ) const
inlineinherited
Returns
A pointer to an array of local node pointers.

Definition at line 1949 of file elem.h.

References libMesh::Elem::_nodes.

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

1950 {
1951  return _nodes;
1952 }
Node ** _nodes
Definition: elem.h:1695

◆ hack_p_level()

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 2739 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< T >::unpack().

2740 {
2741  if (p == 0)
2742  libmesh_assert_not_equal_to
2744 
2745  _p_level = cast_int<unsigned char>(p);
2746 }
unsigned char _p_level
Definition: elem.h:1736
RefinementState p_refinement_flag() const
Definition: elem.h:2654

◆ has_affine_map()

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::Tri6, libMesh::Hex8, libMesh::Quad8, libMesh::Quad9, libMesh::Tri3, libMesh::Edge4, libMesh::Prism6, libMesh::Pyramid5, libMesh::Edge3, libMesh::Quad4, libMesh::Edge2, and libMesh::Tri3Subdivision.

Definition at line 988 of file elem.h.

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

988 { return false; }

◆ has_ancestor_children()

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

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

2443 {
2444 #ifdef LIBMESH_ENABLE_AMR
2445  if (_children == nullptr)
2446  return false;
2447  else
2448  for (auto & c : child_ref_range())
2449  if (c.has_children())
2450  return true;
2451 #endif
2452  return false;
2453 }
SimpleRange< ChildRefIter > child_ref_range()
Definition: elem.h:1779
Elem ** _children
Definition: elem.h:1707

◆ has_children()

◆ has_dofs()

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 913 of file dof_object.h.

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

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

914 {
915  if (sys == libMesh::invalid_uint)
916  {
917  for (unsigned int s=0; s<this->n_systems(); s++)
918  if (this->n_vars(s))
919  return true;
920  }
921 
922  else
923  {
924  libmesh_assert_less (sys, this->n_systems());
925 
926  if (this->n_vars(sys))
927  return true;
928  }
929 
930  return false;
931 }
const unsigned int invalid_uint
Definition: libmesh.h:245
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:768
unsigned int n_systems() const
Definition: dof_object.h:749

◆ has_neighbor()

bool libMesh::Elem::has_neighbor ( const Elem elem) const
inlineinherited

◆ has_topological_neighbor()

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 957 of file elem.C.

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

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

961 {
962  // First see if this is a normal "interior" neighbor
963  if (has_neighbor(elem))
964  return true;
965 
966  for (auto n : this->side_index_range())
967  if (this->topological_neighbor(n, mesh, point_locator, pb))
968  return true;
969 
970  return false;
971 }
bool has_neighbor(const Elem *elem) const
Definition: elem.h:2093
const Elem * topological_neighbor(const unsigned int i, const MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb) const
Definition: elem.C:920
IntRange< unsigned short > side_index_range() const
Definition: elem.h:2166
MeshBase & mesh

◆ hmax()

Real libMesh::Elem::hmax ( ) const
virtualinherited
Returns
The maximum vertex separation for the element.

Definition at line 373 of file elem.C.

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

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

374 {
375  Real h_max=0;
376 
377  for (unsigned int n_outer=0; n_outer<this->n_vertices(); n_outer++)
378  for (unsigned int n_inner=n_outer+1; n_inner<this->n_vertices(); n_inner++)
379  {
380  const Point diff = (this->point(n_outer) - this->point(n_inner));
381 
382  h_max = std::max(h_max, diff.norm_sq());
383  }
384 
385  return std::sqrt(h_max);
386 }
long double max(long double a, double b)
virtual unsigned int n_vertices() const =0
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Point & point(const unsigned int i) const
Definition: elem.h:1892

◆ hmin()

Real libMesh::Elem::hmin ( ) const
virtualinherited
Returns
The minimum vertex separation for the element.

Definition at line 356 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< FEOutputType< T >::type >::compute_periodic_constraints(), libMesh::MeshTools::Modification::distort(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::Elem::get_info(), libMesh::FEMSystem::numerical_jacobian(), and libMesh::ReplicatedMesh::stitching_helper().

357 {
359 
360  for (unsigned int n_outer=0; n_outer<this->n_vertices(); n_outer++)
361  for (unsigned int n_inner=n_outer+1; n_inner<this->n_vertices(); n_inner++)
362  {
363  const Point diff = (this->point(n_outer) - this->point(n_inner));
364 
365  h_min = std::min(h_min, diff.norm_sq());
366  }
367 
368  return std::sqrt(h_min);
369 }
long double max(long double a, double b)
virtual unsigned int n_vertices() const =0
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
long double min(long double a, double b)
const Point & point(const unsigned int i) const
Definition: elem.h:1892

◆ id()

dof_id_type libMesh::DofObject::id ( ) const
inlineinherited
Returns
The id for this DofObject

Definition at line 655 of file dof_object.h.

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

Referenced by libMesh::UniformRefinementEstimator::_estimate_error(), libMesh::BoundaryInfo::_find_id_maps(), libMesh::MeshTools::Subdivision::add_boundary_ghosts(), libMesh::ReplicatedMesh::add_elem(), libMesh::DistributedMesh::add_elem(), libMesh::BoundaryInfo::add_elements(), libMesh::TopologyMap::add_node(), libMesh::ReplicatedMesh::add_node(), libMesh::DistributedMesh::add_node(), libMesh::DistributedMesh::add_point(), libMesh::UnstructuredMesh::all_first_order(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::Node::build(), libMesh::Partitioner::build_graph(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_periodic_constraints(), libMesh::FEMap::compute_single_point_map(), libMesh::MeshRefinement::create_parent_error_vector(), libMesh::ReplicatedMesh::delete_elem(), libMesh::DistributedMesh::delete_elem(), libMesh::ReplicatedMesh::delete_node(), libMesh::DistributedMesh::delete_node(), libMesh::MeshBase::detect_interior_parents(), libMesh::DistributedMesh::DistributedMesh(), libMesh::UNVIO::elements_out(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::AdjointRefinementEstimator::estimate_error(), libMesh::ExactErrorEstimator::estimate_error(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshTools::find_nodal_neighbors(), libMesh::MeshRefinement::flag_elements_by_elem_fraction(), libMesh::MeshRefinement::flag_elements_by_error_fraction(), libMesh::MeshRefinement::flag_elements_by_error_tolerance(), libMesh::MeshTools::Modification::flatten(), libMesh::Node::get_info(), libMesh::Elem::get_info(), libMesh::DofMap::get_local_constraints(), libMesh::ParmetisPartitioner::initialize(), libMesh::TreeNode< N >::insert(), libMesh::ReplicatedMesh::insert_elem(), libMesh::DistributedMesh::insert_elem(), libMesh::ReplicatedMesh::insert_node(), libMesh::FE< Dim, LAGRANGE_VEC >::inverse_map(), libMesh::MeshTools::libmesh_assert_valid_amr_elem_ids(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::Tri3Subdivision::local_node_number(), libMesh::Elem::node_id(), libMesh::VTKIO::nodes_to_vtk(), libMesh::CompareElemIdsByLevel::operator()(), libMesh::WeightedPatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::PatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::DistributedMesh::own_node(), libMesh::Parallel::Packing< T >::pack(), libMesh::MetisPartitioner::partition_range(), libMesh::DofObject::print_dof_info(), libMesh::DistributedMesh::query_elem_ptr(), libMesh::DistributedMesh::query_node_ptr(), libMesh::Nemesis_IO::read(), libMesh::ExodusII_IO::read(), libMesh::AbaqusIO::read_elements(), libMesh::DistributedMesh::renumber_elem(), libMesh::DistributedMesh::renumber_node(), libMesh::DistributedMesh::renumber_nodes_and_elements(), libMesh::DofMap::scatter_constraints(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::PetscDMWrapper::set_point_range_in_section(), libMesh::MeshTools::Modification::smooth(), 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_once(), libMesh::TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole(), libMesh::Parallel::Packing< T >::unpack(), libMesh::GmshIO::write_mesh(), and libMesh::ExodusII_IO_Helper::write_nodal_coordinates().

656 {
657  libmesh_assert (this->valid_id());
658  return _id;
659 }
dof_id_type _id
Definition: dof_object.h:442
bool valid_id() const
Definition: dof_object.h:697

◆ increment_constructor_count() [1/2]

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 181 of file reference_counter.h.

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

Referenced by libMesh::ReferenceCountedObject< RBParametrized >::ReferenceCountedObject().

182 {
183  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
184  std::pair<unsigned int, unsigned int> & p = _counts[name];
185 
186  p.first++;
187 }
std::string name(const ElemQuality q)
Definition: elem_quality.C:42
spin_mutex spin_mtx
Definition: threads.C:29

◆ increment_constructor_count() [2/2]

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 181 of file reference_counter.h.

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

Referenced by libMesh::ReferenceCountedObject< RBParametrized >::ReferenceCountedObject().

182 {
183  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
184  std::pair<unsigned int, unsigned int> & p = _counts[name];
185 
186  p.first++;
187 }
std::string name(const ElemQuality q)
Definition: elem_quality.C:42
spin_mutex spin_mtx
Definition: threads.C:29

◆ increment_destructor_count() [1/2]

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 194 of file reference_counter.h.

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

Referenced by libMesh::ReferenceCountedObject< RBParametrized >::~ReferenceCountedObject().

195 {
196  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
197  std::pair<unsigned int, unsigned int> & p = _counts[name];
198 
199  p.second++;
200 }
std::string name(const ElemQuality q)
Definition: elem_quality.C:42
spin_mutex spin_mtx
Definition: threads.C:29

◆ increment_destructor_count() [2/2]

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 194 of file reference_counter.h.

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

Referenced by libMesh::ReferenceCountedObject< RBParametrized >::~ReferenceCountedObject().

195 {
196  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
197  std::pair<unsigned int, unsigned int> & p = _counts[name];
198 
199  p.second++;
200 }
std::string name(const ElemQuality q)
Definition: elem_quality.C:42
spin_mutex spin_mtx
Definition: threads.C:29

◆ infinite()

virtual bool libMesh::Cell::infinite ( ) const
inlineoverridevirtualinherited
Returns
false. All classes derived from Cell are finite elements.

Implements libMesh::Elem.

Definition at line 75 of file cell.h.

75 { return false; }

◆ interior_parent() [1/2]

const Elem * libMesh::Elem::interior_parent ( ) const
inherited
Returns
The higher-dimensional Elem for which this Elem is a face.

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

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

Definition at line 804 of file elem.C.

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

Referenced by libMesh::Elem::find_interior_neighbors(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::BoundaryInfo::get_side_and_node_maps(), libMesh::MeshTools::libmesh_assert_valid_amr_interior_parents(), libMesh::Parallel::Packing< T >::pack(), and libMesh::Parallel::Packing< T >::unpack().

805 {
806  // interior parents make no sense for full-dimensional elements.
807  libmesh_assert_less (this->dim(), LIBMESH_DIM);
808 
809  // they USED TO BE only good for level-0 elements, but we now
810  // support keeping interior_parent() valid on refined boundary
811  // elements.
812  // if (this->level() != 0)
813  // return this->parent()->interior_parent();
814 
815  // We store the interior_parent pointer after both the parent
816  // neighbor and neighbor pointers
817  Elem * interior_p = _elemlinks[1+this->n_sides()];
818 
819  // If we have an interior_parent, we USED TO assume it was a
820  // one-higher-dimensional interior element, but we now allow e.g.
821  // edge elements to have a 3D interior_parent with no
822  // intermediate 2D element.
823  // libmesh_assert (!interior_p ||
824  // interior_p->dim() == (this->dim()+1));
825  libmesh_assert (!interior_p ||
826  (interior_p == remote_elem) ||
827  (interior_p->dim() > this->dim()));
828 
829  // We require consistency between AMR of interior and of boundary
830  // elements
831  if (interior_p && (interior_p != remote_elem))
832  libmesh_assert_less_equal (interior_p->level(), this->level());
833 
834  return interior_p;
835 }
Elem ** _elemlinks
Definition: elem.h:1701
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1811
virtual unsigned int n_sides() const =0
unsigned int level() const
Definition: elem.h:2521
virtual unsigned short dim() const =0
const RemoteElem * remote_elem
Definition: remote_elem.C:57

◆ interior_parent() [2/2]

Elem * libMesh::Elem::interior_parent ( )
inherited

Definition at line 839 of file elem.C.

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

840 {
841  // See the const version for comments
842  libmesh_assert_less (this->dim(), LIBMESH_DIM);
843  Elem * interior_p = _elemlinks[1+this->n_sides()];
844 
845  libmesh_assert (!interior_p ||
846  (interior_p == remote_elem) ||
847  (interior_p->dim() > this->dim()));
848  if (interior_p && (interior_p != remote_elem))
849  libmesh_assert_less_equal (interior_p->level(), this->level());
850 
851  return interior_p;
852 }
Elem ** _elemlinks
Definition: elem.h:1701
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1811
virtual unsigned int n_sides() const =0
unsigned int level() const
Definition: elem.h:2521
virtual unsigned short dim() const =0
const RemoteElem * remote_elem
Definition: remote_elem.C:57

◆ invalidate()

void libMesh::DofObject::invalidate ( )
inlineinherited

Invalidates all the indices for this DofObject

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

612 {
613  this->invalidate_dofs ();
614  this->invalidate_id ();
615  this->invalidate_processor_id ();
616 }
void invalidate_processor_id()
Definition: dof_object.h:603
void invalidate_dofs(const unsigned int sys_num=libMesh::invalid_uint)
Definition: dof_object.h:575

◆ invalidate_dofs()

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 575 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().

576 {
577  // If the user does not specify the system number...
578  if (sys_num >= this->n_systems())
579  {
580  for (unsigned int s=0; s<this->n_systems(); s++)
581  for (unsigned int vg=0; vg<this->n_var_groups(s); vg++)
582  if (this->n_comp_group(s,vg))
583  this->set_vg_dof_base(s,vg,invalid_id);
584  }
585  // ...otherwise invalidate the dofs for all systems
586  else
587  for (unsigned int vg=0; vg<this->n_var_groups(sys_num); vg++)
588  if (this->n_comp_group(sys_num,vg))
589  this->set_vg_dof_base(sys_num,vg,invalid_id);
590 }
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:758
void set_vg_dof_base(const unsigned int s, const unsigned int vg, const dof_id_type db)
Definition: dof_object.h:960
unsigned int n_systems() const
Definition: dof_object.h:749
static const dof_id_type invalid_id
Definition: dof_object.h:347
unsigned int n_comp_group(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:816

◆ invalidate_id()

void libMesh::DofObject::invalidate_id ( )
inlineinherited

Sets the id to invalid_id

Definition at line 595 of file dof_object.h.

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

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

596 {
597  this->set_id (invalid_id);
598 }
dof_id_type & set_id()
Definition: dof_object.h:664
static const dof_id_type invalid_id
Definition: dof_object.h:347

◆ invalidate_processor_id()

void libMesh::DofObject::invalidate_processor_id ( )
inlineinherited

Sets the processor id to invalid_processor_id

Definition at line 603 of file dof_object.h.

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

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

604 {
606 }
static const processor_id_type invalid_processor_id
Definition: dof_object.h:358
processor_id_type processor_id() const
Definition: dof_object.h:717

◆ is_ancestor_of()

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

References libMesh::Elem::parent().

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

2463 {
2464 #ifdef LIBMESH_ENABLE_AMR
2465  const Elem * e = descendant;
2466  while (e)
2467  {
2468  if (this == e)
2469  return true;
2470  e = e->parent();
2471  }
2472 #endif
2473  return false;
2474 }
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1811

◆ is_child_on_edge()

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 1518 of file elem.C.

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

Referenced by libMesh::FEGenericBase< FEOutputType< T >::type >::coarsened_dof_values(), and libMesh::BoundaryInfo::edge_boundary_ids().

1520 {
1521  libmesh_assert_less (c, this->n_children());
1522  libmesh_assert_less (e, this->n_edges());
1523 
1524  std::unique_ptr<const Elem> my_edge = this->build_edge_ptr(e);
1525  std::unique_ptr<const Elem> child_edge = this->build_edge_ptr(e);
1526 
1527  // We're assuming that an overlapping child edge has the same
1528  // number and orientation as its parent
1529  return (child_edge->node_id(0) == my_edge->node_id(0) ||
1530  child_edge->node_id(1) == my_edge->node_id(1));
1531 }
virtual unsigned int n_children() const =0
virtual unsigned int n_edges() const =0
virtual std::unique_ptr< Elem > build_edge_ptr(const unsigned int i)=0

◆ is_child_on_side()

bool libMesh::Pyramid::is_child_on_side ( const unsigned int  c,
const unsigned int  s 
) const
overridevirtual
Returns
true if the specified child is on the specified side.

Implements libMesh::Elem.

Definition at line 179 of file cell_pyramid.C.

References n_children(), n_sides(), and libMesh::Pyramid5::side_nodes_map.

181 {
182  libmesh_assert_less (c, this->n_children());
183  libmesh_assert_less (s, this->n_sides());
184 
185  for (unsigned int i = 0; i != 4; ++i)
186  if (Pyramid5::side_nodes_map[s][i] == c)
187  return true;
188  return false;
189 }
virtual unsigned int n_sides() const override
Definition: cell_pyramid.h:83
virtual unsigned int n_children() const override
Definition: cell_pyramid.h:103
static const unsigned int side_nodes_map[num_sides][nodes_per_side]

◆ is_edge()

◆ is_edge_on_side()

bool libMesh::Pyramid::is_edge_on_side ( const unsigned int  e,
const unsigned int  s 
) const
overridevirtual
Returns
true if the specified edge is on the specified side.

Implements libMesh::Elem.

Definition at line 193 of file cell_pyramid.C.

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

195 {
196  libmesh_assert_less (e, this->n_edges());
197  libmesh_assert_less (s, this->n_sides());
198 
199  return (is_node_on_side(Pyramid5::edge_nodes_map[e][0],s) &&
201 }
static const unsigned int edge_nodes_map[num_edges][nodes_per_edge]
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const =0
virtual unsigned int n_sides() const override
Definition: cell_pyramid.h:83
virtual unsigned int n_edges() const override
Definition: cell_pyramid.h:93

◆ is_face()

◆ is_linear()

virtual bool libMesh::Elem::is_linear ( ) const
inlinevirtualinherited
Returns
true if the Lagrange shape functions on this element are linear.

Reimplemented in libMesh::NodeElem, libMesh::Tet4, libMesh::Tri3, libMesh::Edge2, and libMesh::Tri3Subdivision.

Definition at line 994 of file elem.h.

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

994 { return false; }

◆ is_mid_infinite_edge_node()

virtual bool libMesh::Elem::is_mid_infinite_edge_node ( const unsigned int  ) const
inlinevirtualinherited
Returns
true if the specified (local) node number is a "mid-edge" node on an infinite element edge.

This is false for all nodes on non-infinite elements, so we won't make it pure virtual, to simplify their code.

Reimplemented in libMesh::InfEdge2, libMesh::InfQuad, libMesh::InfPrism, and libMesh::InfHex.

Definition at line 1544 of file elem.h.

References libMesh::Elem::infinite().

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

1545  { libmesh_assert (!this->infinite()); return false; }
virtual bool infinite() const =0

◆ is_node_on_edge()

◆ is_node_on_side()

◆ is_remote()

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 nullptr neighbor only if it lies on the physical boundary of the domain.

Reimplemented in libMesh::RemoteElem.

Definition at line 555 of file elem.h.

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

556  { return false; }

◆ is_semilocal()

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 451 of file elem.C.

References libMesh::Elem::find_point_neighbors().

452 {
453  std::set<const Elem *> point_neighbors;
454 
455  this->find_point_neighbors(point_neighbors);
456 
457  for (const auto & elem : point_neighbors)
458  if (elem->processor_id() == my_pid)
459  return true;
460 
461  return false;
462 }
void find_point_neighbors(const Point &p, std::set< const Elem *> &neighbor_set) const
Definition: elem.C:498

◆ is_vertex()

◆ is_vertex_on_child()

virtual unsigned int libMesh::Elem::is_vertex_on_child ( unsigned  int,
unsigned int  n 
) const
inlinevirtualinherited
Returns
true if the specified child has a vertex at the specified (child-local) node number. Except in odd cases like pyramid refinement the child will have the same local structure as the parent element.

Definition at line 694 of file elem.h.

References libMesh::Elem::is_vertex().

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

696  { return this->is_vertex(n); }
virtual bool is_vertex(const unsigned int i) const =0

◆ is_vertex_on_parent()

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 2879 of file elem.C.

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

2881 {
2882 #ifdef LIBMESH_ENABLE_AMR
2883 
2884  unsigned int my_n_vertices = this->n_vertices();
2885  for (unsigned int n_parent = 0; n_parent != my_n_vertices;
2886  ++n_parent)
2887  if (this->node_ptr(n_parent) == this->child_ptr(c)->node_ptr(n))
2888  return true;
2889  return false;
2890 
2891 #else
2892 
2893  // No AMR?
2894  libmesh_ignore(c,n);
2895  libmesh_error_msg("ERROR: AMR disabled, how did we get here?");
2896  return true;
2897 
2898 #endif
2899 }
void libmesh_ignore(const Args &...)
virtual unsigned int n_vertices() const =0
const Node * node_ptr(const unsigned int i) const
Definition: elem.h:1957
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2578

◆ key() [1/4]

dof_id_type libMesh::Elem::key

Don't hide Elem::key() defined in the base class.

Definition at line 401 of file elem.C.

402 {
403  const unsigned short n_n = this->n_nodes();
404 
405  std::array<dof_id_type, Elem::max_n_nodes> node_ids;
406 
407  for (unsigned short n=0; n != n_n; ++n)
408  node_ids[n] = this->node_id(n);
409 
410  // Always sort, so that different local node numberings hash to the
411  // same value.
412  std::sort (node_ids.begin(), node_ids.begin()+n_n);
413 
414  return Utility::hashword(node_ids.data(), n_n);
415 }
uint32_t hashword(const uint32_t *k, size_t length, uint32_t initval=0)
Definition: hashword.h:153
virtual unsigned int n_nodes() const override
Definition: cell_pyramid.h:78
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:1914

◆ key() [2/4]

virtual dof_id_type libMesh::Elem::key

Don't hide Elem::key() defined in the base class.

◆ key() [3/4]

dof_id_type libMesh::Pyramid::key ( const unsigned int  s) const
overridevirtual
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::Pyramid14.

Definition at line 57 of file cell_pyramid.C.

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

58 {
59  libmesh_assert_less (s, this->n_sides());
60 
61  switch (s)
62  {
63  case 0: // triangular face 1
64  case 1: // triangular face 2
65  case 2: // triangular face 3
66  case 3: // triangular face 4
67  return this->compute_key (this->node_id(Pyramid5::side_nodes_map[s][0]),
68  this->node_id(Pyramid5::side_nodes_map[s][1]),
69  this->node_id(Pyramid5::side_nodes_map[s][2]));
70 
71  case 4: // the quad face at z=0
72  return this->compute_key (this->node_id(Pyramid5::side_nodes_map[s][0]),
73  this->node_id(Pyramid5::side_nodes_map[s][1]),
74  this->node_id(Pyramid5::side_nodes_map[s][2]),
75  this->node_id(Pyramid5::side_nodes_map[s][3]));
76 
77  default:
78  libmesh_error_msg("Invalid side s = " << s);
79  }
80 }
virtual unsigned int n_sides() const override
Definition: cell_pyramid.h:83
static const unsigned int side_nodes_map[num_sides][nodes_per_side]
static dof_id_type compute_key(dof_id_type n0)
Definition: elem.h:2754
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:1914

◆ key() [4/4]

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::Quad9, libMesh::Quad, and libMesh::Tri.

Definition at line 401 of file elem.C.

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

Referenced by libMesh::InfQuad6::key(), libMesh::Prism18::key(), libMesh::Pyramid14::key(), and libMesh::InfHex18::key().

402 {
403  const unsigned short n_n = this->n_nodes();
404 
405  std::array<dof_id_type, Elem::max_n_nodes> node_ids;
406 
407  for (unsigned short n=0; n != n_n; ++n)
408  node_ids[n] = this->node_id(n);
409 
410  // Always sort, so that different local node numberings hash to the
411  // same value.
412  std::sort (node_ids.begin(), node_ids.begin()+n_n);
413 
414  return Utility::hashword(node_ids.data(), n_n);
415 }
uint32_t hashword(const uint32_t *k, size_t length, uint32_t initval=0)
Definition: hashword.h:153
virtual unsigned int n_nodes() const =0
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:1914

◆ length()

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 390 of file elem.C.

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

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

392 {
393  libmesh_assert_less ( n1, this->n_vertices() );
394  libmesh_assert_less ( n2, this->n_vertices() );
395 
396  return (this->point(n1) - this->point(n2)).norm();
397 }
virtual unsigned int n_vertices() const =0
const Point & point(const unsigned int i) const
Definition: elem.h:1892

◆ level()

unsigned int libMesh::Elem::level ( ) const
inlineinherited
Returns
The refinement level of the current element.

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

Definition at line 2521 of file elem.h.

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

Referenced by 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< FEOutputType< T >::type >::compute_periodic_constraints(), libMesh::FEAbstract::compute_periodic_node_constraints(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_proj_constraints(), libMesh::BoundaryInfo::edge_boundary_ids(), libMesh::MeshRefinement::enforce_mismatch_limit_prior_to_refinement(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::MeshTools::find_hanging_nodes_and_parents(), libMesh::Elem::find_interior_neighbors(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshRefinement::flag_elements_by_nelem_target(), libMesh::Elem::get_info(), libMesh::Elem::interior_parent(), libMesh::Elem::level(), libMesh::MeshTools::libmesh_assert_valid_amr_interior_parents(), libMesh::MeshRefinement::limit_overrefined_boundary(), libMesh::MeshRefinement::limit_underrefined_boundary(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::Elem::make_links_to_me_local(), libMesh::Elem::make_links_to_me_remote(), libMesh::MeshRefinement::make_refinement_compatible(), libMesh::Elem::nullify_neighbors(), libMesh::CompareElemIdsByLevel::operator()(), libMesh::Parallel::Packing< T >::pack(), libMesh::Parallel::Packing< T >::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< T >::unpack(), and libMesh::Elem::which_neighbor_am_i().

2522 {
2523 #ifdef LIBMESH_ENABLE_AMR
2524 
2525  // if I don't have a parent I was
2526  // created directly from file
2527  // or by the user, so I am a
2528  // level-0 element
2529  if (this->parent() == nullptr)
2530  return 0;
2531 
2532  // if the parent and this element are of different
2533  // dimensionality we are at the same level as
2534  // the parent (e.g. we are the 2D side of a
2535  // 3D element)
2536  if (this->dim() != this->parent()->dim())
2537  return this->parent()->level();
2538 
2539  // otherwise we are at a level one
2540  // higher than our parent
2541  return (this->parent()->level() + 1);
2542 
2543 #else
2544 
2545  // Without AMR all elements are
2546  // at level 0.
2547  return 0;
2548 
2549 #endif
2550 }
const Elem * parent() const
Definition: elem.h:2479
unsigned int level() const
Definition: elem.h:2521
virtual unsigned short dim() const =0

◆ libmesh_assert_valid_neighbors()

void libMesh::Elem::libmesh_assert_valid_neighbors ( ) const
inherited

Checks for consistent neighbor links on this element.

Definition at line 990 of file elem.C.

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

991 {
992  for (auto n : this->side_index_range())
993  {
994  const Elem * neigh = this->neighbor_ptr(n);
995 
996  // Any element might have a remote neighbor; checking
997  // to make sure that's not inaccurate is tough.
998  if (neigh == remote_elem)
999  continue;
1000 
1001  if (neigh)
1002  {
1003  // Only subactive elements have subactive neighbors
1004  libmesh_assert (this->subactive() || !neigh->subactive());
1005 
1006  const Elem * elem = this;
1007 
1008  // If we're subactive but our neighbor isn't, its
1009  // return neighbor link will be to our first active
1010  // ancestor OR to our inactive ancestor of the same
1011  // level as neigh,
1012  if (this->subactive() && !neigh->subactive())
1013  {
1014  for (elem = this; !elem->active();
1015  elem = elem->parent())
1016  libmesh_assert(elem);
1017  }
1018  else
1019  {
1020  unsigned int rev = neigh->which_neighbor_am_i(elem);
1021  libmesh_assert_less (rev, neigh->n_neighbors());
1022 
1023  if (this->subactive() && !neigh->subactive())
1024  {
1025  while (neigh->neighbor_ptr(rev) != elem)
1026  {
1027  libmesh_assert(elem->parent());
1028  elem = elem->parent();
1029  }
1030  }
1031  else
1032  {
1033  const Elem * nn = neigh->neighbor_ptr(rev);
1034  libmesh_assert(nn);
1035 
1036  for (; elem != nn; elem = elem->parent())
1037  libmesh_assert(elem);
1038  }
1039  }
1040  }
1041  // If we don't have a neighbor and we're not subactive, our
1042  // ancestors shouldn't have any neighbors in this same
1043  // direction.
1044  else if (!this->subactive())
1045  {
1046  const Elem * my_parent = this->parent();
1047  if (my_parent &&
1048  // A parent with a different dimension isn't really one of
1049  // our ancestors, it means we're on a boundary mesh and this
1050  // is an interior mesh element for which we're on a side.
1051  // Nothing to test for in that case.
1052  (my_parent->dim() == this->dim()))
1053  libmesh_assert (!my_parent->neighbor_ptr(n));
1054  }
1055  }
1056 }
const Elem * parent() const
Definition: elem.h:2479
IntRange< unsigned short > side_index_range() const
Definition: elem.h:2166
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1811
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:2050
virtual unsigned short dim() const =0
bool subactive() const
Definition: elem.h:2408
const RemoteElem * remote_elem
Definition: remote_elem.C:57

◆ libmesh_assert_valid_node_pointers()

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 978 of file elem.C.

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

979 {
980  libmesh_assert(this->valid_id());
981  for (unsigned int n=0; n != this->n_nodes(); ++n)
982  {
983  libmesh_assert(this->node_ptr(n));
984  libmesh_assert(this->node_ptr(n)->valid_id());
985  }
986 }
virtual unsigned int n_nodes() const =0
bool valid_id() const
Definition: dof_object.h:697
const Node * node_ptr(const unsigned int i) const
Definition: elem.h:1957

◆ local_node()

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 1937 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().

1938 {
1939  for (unsigned int n=0; n != this->n_nodes(); ++n)
1940  if (this->node_id(n) == i)
1941  return n;
1942 
1943  return libMesh::invalid_uint;
1944 }
const unsigned int invalid_uint
Definition: libmesh.h:245
virtual unsigned int n_nodes() const =0
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:1914

◆ loose_bounding_box()

BoundingBox libMesh::Cell::loose_bounding_box ( ) const
overridevirtualinherited
Returns
A bounding box (not necessarily the minimal bounding box) containing the geometric element.

Reimplemented from libMesh::Elem.

Reimplemented in libMesh::Hex8, libMesh::Prism6, and libMesh::Pyramid5.

Definition at line 26 of file cell.C.

References libMesh::Elem::build_side_ptr(), libMesh::Elem::n_sides(), libMesh::Elem::side_ptr(), and libMesh::BoundingBox::union_with().

27 {
28  // This might have curved sides, but it's definitely *not* curving
29  // through 4-D space, so the full bounding box is just the merger of
30  // the sides' bounding boxes.
31 
32  std::unique_ptr<const Elem> side_ptr { this->build_side_ptr(0, false) };
33  BoundingBox bbox = side_ptr->loose_bounding_box();
34  unsigned int my_n_sides = this->n_sides();
35  for (unsigned s=1; s < my_n_sides; ++s)
36  {
37  this->build_side_ptr(side_ptr, s);
38  bbox.union_with(side_ptr->loose_bounding_box());
39  }
40 
41  return bbox;
42 }
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int i, bool proxy=true)=0
virtual unsigned int n_sides() const =0
virtual std::unique_ptr< Elem > side_ptr(unsigned int i)=0

◆ make_links_to_me_local()

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 1062 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::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< T >::unpack().

1063 {
1064  Elem * neigh = this->neighbor_ptr(n);
1065 
1066  // Don't bother calling this function unless it's necessary
1067  libmesh_assert(neigh);
1068  libmesh_assert(!neigh->is_remote());
1069 
1070  // We never have neighbors more refined than us
1071  libmesh_assert_less_equal (neigh->level(), this->level());
1072 
1073  // We never have subactive neighbors of non subactive elements
1074  libmesh_assert(!neigh->subactive() || this->subactive());
1075 
1076  // If we have a neighbor less refined than us then it must not
1077  // have any more refined descendants we could have pointed to
1078  // instead.
1079  libmesh_assert((neigh->level() == this->level()) ||
1080  (neigh->active() && !this->subactive()) ||
1081  (!neigh->has_children() && this->subactive()));
1082 
1083  // If neigh is at our level, then its family might have
1084  // remote_elem neighbor links which need to point to us
1085  // instead, but if not, then we're done.
1086  if (neigh->level() != this->level())
1087  return;
1088 
1089  // What side of neigh are we on? We can't use the usual Elem
1090  // method because we're in the middle of restoring topology
1091  const std::unique_ptr<Elem> my_side = this->side_ptr(n);
1092  unsigned int nn = 0;
1093  for (; nn != neigh->n_sides(); ++nn)
1094  {
1095  const std::unique_ptr<Elem> neigh_side = neigh->side_ptr(nn);
1096  if (*my_side == *neigh_side)
1097  break;
1098  }
1099 
1100  // we had better be on *some* side of neigh
1101  libmesh_assert_less (nn, neigh->n_sides());
1102 
1103  // Find any elements that ought to point to elem
1104  std::vector<const Elem *> neigh_family;
1105 #ifdef LIBMESH_ENABLE_AMR
1106  if (this->active())
1107  neigh->family_tree_by_side(neigh_family, nn);
1108  else if (neigh->subactive())
1109 #endif
1110  neigh_family.push_back(neigh);
1111 
1112  // And point them to elem
1113  for (auto & const_elem : neigh_family)
1114  {
1115  // This const_cast is necessary until we have a version of
1116  // family_tree_by_side that returns a vector of non-constant
1117  // pointers when called on a non-constant Elem.
1118  Elem * neigh_family_member = const_cast<Elem *>(const_elem);
1119 
1120  // Only subactive elements point to other subactive elements
1121  if (this->subactive() && !neigh_family_member->subactive())
1122  continue;
1123 
1124  // Ideally, the neighbor link ought to either be correct
1125  // already or ought to be to remote_elem.
1126  //
1127  // However, if we're redistributing a newly created elem,
1128  // after an AMR step but before find_neighbors has fixed up
1129  // neighbor links, we might have an out of date neighbor
1130  // link to elem's parent instead.
1131 #ifdef LIBMESH_ENABLE_AMR
1132  libmesh_assert((neigh_family_member->neighbor_ptr(nn) &&
1133  (neigh_family_member->neighbor_ptr(nn)->active() ||
1134  neigh_family_member->neighbor_ptr(nn)->is_ancestor_of(this))) ||
1135  (neigh_family_member->neighbor_ptr(nn) == remote_elem) ||
1136  ((this->refinement_flag() == JUST_REFINED) &&
1137  (this->parent() != nullptr) &&
1138  (neigh_family_member->neighbor_ptr(nn) == this->parent())));
1139 #else
1140  libmesh_assert((neigh_family_member->neighbor_ptr(nn) == this) ||
1141  (neigh_family_member->neighbor_ptr(nn) == remote_elem));
1142 #endif
1143 
1144  neigh_family_member->set_neighbor(nn, this);
1145  }
1146 }
RefinementState refinement_flag() const
Definition: elem.h:2638
const Elem * parent() const
Definition: elem.h:2479
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1811
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:2050
unsigned int level() const
Definition: elem.h:2521
virtual std::unique_ptr< Elem > side_ptr(unsigned int i)=0
bool subactive() const
Definition: elem.h:2408
bool active() const
Definition: elem.h:2390
const RemoteElem * remote_elem
Definition: remote_elem.C:57

◆ make_links_to_me_remote()

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 1149 of file elem.C.

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

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

1150 {
1151  libmesh_assert_not_equal_to (this, remote_elem);
1152 
1153  // We need to have handled any children first
1154 #if defined(LIBMESH_ENABLE_AMR) && defined(DEBUG)
1155  if (this->has_children())
1156  for (auto & child : this->child_ref_range())
1157  libmesh_assert_equal_to (&child, remote_elem);
1158 #endif
1159 
1160  // Remotify any neighbor links
1161  for (auto neigh : this->neighbor_ptr_range())
1162  {
1163  if (neigh && neigh != remote_elem)
1164  {
1165  // My neighbor should never be more refined than me; my real
1166  // neighbor would have been its parent in that case.
1167  libmesh_assert_greater_equal (this->level(), neigh->level());
1168 
1169  if (this->level() == neigh->level() &&
1170  neigh->has_neighbor(this))
1171  {
1172 #ifdef LIBMESH_ENABLE_AMR
1173  // My neighbor may have descendants which also consider me a
1174  // neighbor
1175  std::vector<const Elem *> family;
1176  neigh->total_family_tree_by_neighbor (family, this);
1177 
1178  // FIXME - There's a lot of ugly const_casts here; we
1179  // may want to make remote_elem non-const and create
1180  // non-const versions of the family_tree methods
1181  for (auto & const_elem : family)
1182  {
1183  Elem * n = const_cast<Elem *>(const_elem);
1184  libmesh_assert (n);
1185  if (n == remote_elem)
1186  continue;
1187  unsigned int my_s = n->which_neighbor_am_i(this);
1188  libmesh_assert_less (my_s, n->n_neighbors());
1189  libmesh_assert_equal_to (n->neighbor_ptr(my_s), this);
1190  n->set_neighbor(my_s, const_cast<RemoteElem *>(remote_elem));
1191  }
1192 #else
1193  unsigned int my_s = neigh->which_neighbor_am_i(this);
1194  libmesh_assert_less (my_s, neigh->n_neighbors());
1195  libmesh_assert_equal_to (neigh->neighbor_ptr(my_s), this);
1196  neigh->set_neighbor(my_s, const_cast<RemoteElem *>(remote_elem));
1197 #endif
1198  }
1199 #ifdef LIBMESH_ENABLE_AMR
1200  // Even if my neighbor doesn't link back to me, it might
1201  // have subactive descendants which do
1202  else if (neigh->has_children())
1203  {
1204  // If my neighbor at the same level doesn't have me as a
1205  // neighbor, I must be subactive
1206  libmesh_assert(this->level() > neigh->level() ||
1207  this->subactive());
1208 
1209  // My neighbor must have some ancestor of mine as a
1210  // neighbor
1211  Elem * my_ancestor = this->parent();
1212  libmesh_assert(my_ancestor);
1213  while (!neigh->has_neighbor(my_ancestor))
1214  {
1215  my_ancestor = my_ancestor->parent();
1216  libmesh_assert(my_ancestor);
1217  }
1218 
1219  // My neighbor may have descendants which consider me a
1220  // neighbor
1221  std::vector<const Elem *> family;
1222  neigh->total_family_tree_by_subneighbor (family, my_ancestor, this);
1223 
1224  // FIXME - There's a lot of ugly const_casts here; we
1225  // may want to make remote_elem non-const and create
1226  // non-const versions of the family_tree methods
1227  for (auto & const_elem : family)
1228  {
1229  Elem * n = const_cast<Elem *>(const_elem);
1230  libmesh_assert (n);
1231  if (n == remote_elem)
1232  continue;
1233  unsigned int my_s = n->which_neighbor_am_i(this);
1234  libmesh_assert_less (my_s, n->n_neighbors());
1235  libmesh_assert_equal_to (n->neighbor_ptr(my_s), this);
1236  n->set_neighbor(my_s, const_cast<RemoteElem *>(remote_elem));
1237  }
1238  }
1239 #endif
1240  }
1241  }
1242 
1243 #ifdef LIBMESH_ENABLE_AMR
1244  // Remotify parent's child link
1245  Elem * my_parent = this->parent();
1246  if (my_parent &&
1247  // As long as it's not already remote
1248  my_parent != remote_elem &&
1249  // And it's a real parent, not an interior parent
1250  this->dim() == my_parent->dim())
1251  {
1252  unsigned int me = my_parent->which_child_am_i(this);
1253  libmesh_assert_equal_to (my_parent->child_ptr(me), this);
1254  my_parent->set_child(me, const_cast<RemoteElem *>(remote_elem));
1255  }
1256 #endif
1257 }
const Elem * parent() const
Definition: elem.h:2479
SimpleRange< ChildRefIter > child_ref_range()
Definition: elem.h:1779
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1811
Elem * child(const unsigned int i) const
Definition: elem.h:2598
unsigned int level() const
Definition: elem.h:2521
virtual unsigned short dim() const =0
bool subactive() const
Definition: elem.h:2408
SimpleRange< NeighborPtrIter > neighbor_ptr_range()
Definition: elem.h:2988
bool has_children() const
Definition: elem.h:2428
const RemoteElem * remote_elem
Definition: remote_elem.C:57

◆ master_point()

virtual Point libMesh::Pyramid::master_point ( const unsigned int  i) const
inlineoverridevirtual
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_pyramid.h.

References _master_points, and 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 override
Definition: cell_pyramid.h:78
static const Real _master_points[14][3]
Definition: cell_pyramid.h:156

◆ max_descendant_p_level()

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

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

Referenced by libMesh::FEGenericBase< FEOutputType< T >::type >::coarsened_dof_values().

2675 {
2676  // This is undefined for subactive elements,
2677  // which have no active descendants
2678  libmesh_assert (!this->subactive());
2679  if (this->active())
2680  return this->p_level();
2681 
2682  unsigned int max_p_level = _p_level;
2683  for (auto & c : child_ref_range())
2684  max_p_level = std::max(max_p_level,
2685  c.max_descendant_p_level());
2686  return max_p_level;
2687 }
unsigned char _p_level
Definition: elem.h:1736
unsigned int p_level() const
Definition: elem.h:2555
long double max(long double a, double b)
SimpleRange< ChildRefIter > child_ref_range()
Definition: elem.h:1779
bool subactive() const
Definition: elem.h:2408
bool active() const
Definition: elem.h:2390

◆ min_new_p_level_by_neighbor()

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 1899 of file elem.C.

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

1901 {
1902  libmesh_assert(!this->subactive());
1903  libmesh_assert(neighbor_in->active());
1904 
1905  // If we're an active element this is simple
1906  if (this->active())
1907  {
1908  unsigned int new_p_level = this->p_level();
1909  if (this->p_refinement_flag() == Elem::REFINE)
1910  new_p_level += 1;
1911  if (this->p_refinement_flag() == Elem::COARSEN)
1912  {
1913  libmesh_assert_greater (new_p_level, 0);
1914  new_p_level -= 1;
1915  }
1916  return std::min(current_min, new_p_level);
1917  }
1918 
1919  libmesh_assert(has_neighbor(neighbor_in));
1920 
1921  unsigned int min_p_level = current_min;
1922 
1923  for (auto & c : this->child_ref_range())
1924  if (&c != remote_elem && c.has_neighbor(neighbor_in))
1925  min_p_level =
1926  c.min_new_p_level_by_neighbor(neighbor_in, min_p_level);
1927 
1928  return min_p_level;
1929 }
bool has_neighbor(const Elem *elem) const
Definition: elem.h:2093
RefinementState p_refinement_flag() const
Definition: elem.h:2654
unsigned int p_level() const
Definition: elem.h:2555
SimpleRange< ChildRefIter > child_ref_range()
Definition: elem.h:1779
bool subactive() const
Definition: elem.h:2408
bool active() const
Definition: elem.h:2390
long double min(long double a, double b)
const RemoteElem * remote_elem
Definition: remote_elem.C:57

◆ min_p_level_by_neighbor()

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 1870 of file elem.C.

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

Referenced by libMesh::FEGenericBase< FEOutputType< T >::type >::compute_periodic_constraints(), and libMesh::FEGenericBase< FEOutputType< T >::type >::compute_proj_constraints().

1872 {
1873  libmesh_assert(!this->subactive());
1874  libmesh_assert(neighbor_in->active());
1875 
1876  // If we're an active element this is simple
1877  if (this->active())
1878  return std::min(current_min, this->p_level());
1879 
1880  libmesh_assert(has_neighbor(neighbor_in));
1881 
1882  // The p_level() of an ancestor element is already the minimum
1883  // p_level() of its children - so if that's high enough, we don't
1884  // need to examine any children.
1885  if (current_min <= this->p_level())
1886  return current_min;
1887 
1888  unsigned int min_p_level = current_min;
1889 
1890  for (auto & c : this->child_ref_range())
1891  if (&c != remote_elem && c.has_neighbor(neighbor_in))
1892  min_p_level =
1893  c.min_p_level_by_neighbor(neighbor_in, min_p_level);
1894 
1895  return min_p_level;
1896 }
bool has_neighbor(const Elem *elem) const
Definition: elem.h:2093
unsigned int p_level() const
Definition: elem.h:2555
SimpleRange< ChildRefIter > child_ref_range()
Definition: elem.h:1779
bool subactive() const
Definition: elem.h:2408
bool active() const
Definition: elem.h:2390
long double min(long double a, double b)
const RemoteElem * remote_elem
Definition: remote_elem.C:57

◆ n_children()

virtual unsigned int libMesh::Pyramid::n_children ( ) const
inlineoverridevirtual
Returns
10.

Implements libMesh::Elem.

Definition at line 103 of file cell_pyramid.h.

Referenced by is_child_on_side().

103 { return 10; }

◆ n_comp()

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 803 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::allgather_recursive_constraints(), libMesh::FEGenericBase< FEOutputType< T >::type >::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::DofObject::dof_number(), libMesh::DofObject::DofObject(), libMesh::OldSolutionValue< Output, point_output >::eval_at_node(), libMesh::OldSolutionCoefs< Output, point_output >::eval_at_node(), libMesh::Node::get_info(), libMesh::Elem::get_info(), libMesh::DofMap::local_variable_indices(), libMesh::DofObject::n_dofs(), libMesh::DofObject::operator=(), libMesh::DofObject::print_dof_info(), libMesh::DofObject::set_dof_number(), libMesh::DofObject::set_n_vars_per_group(), and libMesh::DofMap::set_nonlocal_dof_objects().

805 {
806  libmesh_assert_less (s, this->n_systems());
807  libmesh_assert_less (var, this->n_vars(s));
808 
809  return this->n_comp_group(s,this->var_to_vg(s,var));
810 }
unsigned int var_to_vg(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:1004
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:768
unsigned int n_systems() const
Definition: dof_object.h:749
unsigned int n_comp_group(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:816

◆ n_comp_group()

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 816 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::_dof_indices(), libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::DofMap::dof_indices(), libMesh::DofObject::dof_number(), libMesh::DofObject::invalidate_dofs(), libMesh::DofObject::n_comp(), libMesh::DofMap::old_dof_indices(), libMesh::BuildProjectionList::operator()(), libMesh::DofMap::reinit(), libMesh::DofObject::set_dof_number(), libMesh::DofObject::set_n_comp_group(), libMesh::DofObject::set_n_vars_per_group(), and libMesh::DofMap::set_nonlocal_dof_objects().

818 {
819  libmesh_assert_less (s, this->n_systems());
820  libmesh_assert_less (vg, this->n_var_groups(s));
821 
822  const unsigned int
823  start_idx_sys = this->start_idx(s);
824 
825  libmesh_assert_less ((start_idx_sys + 2*vg), _idx_buf.size());
826 
827  return (_idx_buf[start_idx_sys + 2*vg] % ncv_magic);
828 }
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:758
unsigned int n_systems() const
Definition: dof_object.h:749
unsigned int start_idx(const unsigned int s) const
Definition: dof_object.h:936
index_buffer_t _idx_buf
Definition: dof_object.h:508
static const index_t ncv_magic
Definition: dof_object.h:519

◆ n_dofs()

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 633 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::PetscDMWrapper::add_dofs_helper().

635 {
636  libmesh_assert_less (s, this->n_systems());
637 
638  unsigned int num = 0;
639 
640  // Count all variables
641  if (var == libMesh::invalid_uint)
642  for (unsigned int v=0; v<this->n_vars(s); v++)
643  num += this->n_comp(s,v);
644 
645  // Only count specified variable
646  else
647  num = this->n_comp(s,var);
648 
649  return num;
650 }
const unsigned int invalid_uint
Definition: libmesh.h:245
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:803
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:768
unsigned int n_systems() const
Definition: dof_object.h:749

◆ n_edges()

virtual unsigned int libMesh::Pyramid::n_edges ( ) const
inlineoverridevirtual

◆ n_faces()

virtual unsigned int libMesh::Pyramid::n_faces ( ) const
inlineoverridevirtual
Returns
5. All pyramids have 5 faces.

Implements libMesh::Elem.

Definition at line 98 of file cell_pyramid.h.

98 { return 5; }

◆ n_neighbors()

unsigned int libMesh::Elem::n_neighbors ( ) const
inlineinherited
Returns
The number of neighbors the element that has been derived from this class has.

Only face (or edge in 2D) neighbors are stored, so this method returns n_sides(). At one point we intended to allow derived classes to override this, but too much current libMesh code assumes n_neighbors==n_sides.

Definition at line 644 of file elem.h.

References libMesh::Elem::n_sides().

Referenced by libMesh::Elem::_last_side(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_proj_constraints(), libMesh::MeshTools::find_hanging_nodes_and_parents(), libMesh::Tri3Subdivision::get_ordered_valence(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::Elem::libmesh_assert_valid_neighbors(), libMesh::Elem::make_links_to_me_remote(), libMesh::Elem::neighbor_ptr(), libMesh::Elem::neighbor_ptr_range(), libMesh::Elem::nullify_neighbors(), libMesh::Elem::remove_links_to_me(), libMesh::Elem::set_neighbor(), and libMesh::Elem::topological_neighbor().

645  { return this->n_sides(); }
virtual unsigned int n_sides() const =0

◆ n_nodes()

virtual unsigned int libMesh::Pyramid::n_nodes ( ) const
inlineoverridevirtual
Returns
5. All pyramid-derivatives are guaranteed to have at least 5 nodes.

Implements libMesh::Elem.

Reimplemented in libMesh::Pyramid14, and libMesh::Pyramid13.

Definition at line 78 of file cell_pyramid.h.

Referenced by master_point().

78 { return 5; }

◆ n_nodes_in_child()

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

Definition at line 613 of file elem.h.

References libMesh::Elem::n_nodes().

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

614  { return this->n_nodes(); }
virtual unsigned int n_nodes() const =0

◆ n_objects() [1/2]

static unsigned int libMesh::ReferenceCounter::n_objects ( )
inlinestaticinherited

Prints the number of outstanding (created, but not yet destroyed) objects.

Definition at line 83 of file reference_counter.h.

References libMesh::ReferenceCounter::_n_objects.

84  { return _n_objects; }
static Threads::atomic< unsigned int > _n_objects

◆ n_objects() [2/2]

static unsigned int libMesh::ReferenceCounter::n_objects ( )
inlinestaticinherited

Prints the number of outstanding (created, but not yet destroyed) objects.

Definition at line 83 of file reference_counter.h.

References libMesh::ReferenceCounter::_n_objects.

84  { return _n_objects; }
static Threads::atomic< unsigned int > _n_objects

◆ n_second_order_adjacent_vertices()

unsigned int libMesh::Elem::n_second_order_adjacent_vertices ( const unsigned int  n) const
virtualinherited
Returns
The number of adjacent vertices that uniquely define the location of the $ n^{th} $ second-order node, or 0 for linear elements.

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

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

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

Definition at line 2558 of file elem.C.

Referenced by libMesh::MeshTools::Modification::smooth().

2559 {
2560  // for linear elements, always return 0
2561  return 0;
2562 }

◆ n_sides()

◆ n_sub_elem()

◆ n_systems()

◆ n_var_groups()

◆ n_vars() [1/2]

unsigned int libMesh::DofObject::n_vars ( const unsigned int  s,
const unsigned int  vg 
) const
inlineinherited
Returns
The number of Variable variables associated with VariableGroup vg in system s for this DofObject

Definition at line 768 of file dof_object.h.

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

Referenced by libMesh::DofObject::add_system(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::DofMap::distribute_dofs(), libMesh::DofObject::dof_number(), libMesh::DofObject::DofObject(), libMesh::OldSolutionValue< Output, point_output >::eval_at_node(), libMesh::OldSolutionCoefs< Output, point_output >::eval_at_node(), libMesh::Node::get_info(), libMesh::Elem::get_info(), libMesh::DofObject::has_dofs(), libMesh::DofObject::n_comp(), libMesh::DofObject::n_dofs(), libMesh::DofObject::n_vars(), libMesh::BuildProjectionList::operator()(), libMesh::DofObject::operator=(), libMesh::DofObject::print_dof_info(), libMesh::DofObject::set_dof_number(), libMesh::DofObject::set_n_comp(), libMesh::DofObject::set_n_comp_group(), libMesh::DofObject::set_n_systems(), libMesh::DofObject::set_n_vars_per_group(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::DofObject::system_var_to_vg_var(), libMesh::DofObject::var_to_vg(), and libMesh::DofObject::var_to_vg_and_offset().

770 {
771  libmesh_assert_less (s, this->n_systems());
772  libmesh_assert_less (vg, this->n_var_groups(s));
773 
774  const unsigned int start_idx_sys = this->start_idx(s);
775 
776  libmesh_assert_less ((start_idx_sys + 2*vg), _idx_buf.size());
777 
778  return (cast_int<unsigned int>
779  (_idx_buf[start_idx_sys + 2*vg]) >> ncv_magic_exp);
780 }
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:758
unsigned int n_systems() const
Definition: dof_object.h:749
unsigned int start_idx(const unsigned int s) const
Definition: dof_object.h:936
index_buffer_t _idx_buf
Definition: dof_object.h:508
static const index_t ncv_magic_exp
Definition: dof_object.h:520

◆ n_vars() [2/2]

unsigned int libMesh::DofObject::n_vars ( const unsigned int  s) const
inlineinherited
Returns
The number of Variable variables associated with system s for this DofObject

Definition at line 785 of file dof_object.h.

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

786 {
787  libmesh_assert_less (s, this->n_systems());
788 
789  const unsigned int nvg = this->n_var_groups(s);
790 
791  unsigned int val=0;
792 
793  for (unsigned int vg=0; vg<nvg; vg++)
794  val += this->n_vars(s,vg);
795 
796  return val;
797 }
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:758
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:768
unsigned int n_systems() const
Definition: dof_object.h:749

◆ n_vertices()

virtual unsigned int libMesh::Pyramid::n_vertices ( ) const
inlineoverridevirtual
Returns
5. All pyramids have 5 vertices.

Implements libMesh::Elem.

Definition at line 88 of file cell_pyramid.h.

Referenced by libMesh::Pyramid13::second_order_adjacent_vertex(), and libMesh::Pyramid14::second_order_adjacent_vertex().

88 { return 5; }

◆ neighbor()

Elem * libMesh::Elem::neighbor ( const unsigned int  i) const
inlineinherited
Deprecated:
Use the const-correct neighbor_ptr() function instead.

Definition at line 2071 of file elem.h.

References libMesh::Elem::neighbor_ptr().

2072 {
2073  // Support the deprecated interface by calling the new,
2074  // const-correct interface and casting the result to an Elem *.
2075  libmesh_deprecated();
2076  return const_cast<Elem *>(this->neighbor_ptr(i));
2077 }
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1811
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:2050

◆ neighbor_ptr() [1/2]

const Elem * libMesh::Elem::neighbor_ptr ( unsigned int  i) const
inlineinherited
Returns
A const pointer to the $ i^{th} $ neighbor of this element, or nullptr if MeshBase::find_neighbors() has not been called.
Note
If MeshBase::find_neighbors() has been called and this function still returns nullptr, then the side is on a boundary of the domain.

Definition at line 2050 of file elem.h.

References libMesh::Elem::_elemlinks, and libMesh::Elem::n_neighbors().

Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::MeshTools::Subdivision::add_boundary_ghosts(), libMesh::BoundaryInfo::add_elements(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::BoundaryInfo::boundary_ids(), libMesh::Partitioner::build_graph(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::FEAbstract::compute_node_constraints(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_periodic_constraints(), libMesh::FEAbstract::compute_periodic_node_constraints(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_proj_constraints(), libMesh::UnstructuredMesh::copy_nodes_and_elements(), libMesh::BoundaryInfo::edge_boundary_ids(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::MeshTools::find_hanging_nodes_and_parents(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshTools::Subdivision::find_one_ring(), libMesh::MeshTools::Modification::flatten(), libMesh::Elem::get_info(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::Elem::libmesh_assert_valid_neighbors(), libMesh::Elem::make_links_to_me_local(), libMesh::Elem::make_links_to_me_remote(), libMesh::Elem::neighbor(), libMesh::Elem::nullify_neighbors(), libMesh::DefaultCoupling::operator()(), libMesh::MetisPartitioner::partition_range(), libMesh::CheckpointIO::read_remote_elem(), libMesh::FE< Dim, LAGRANGE_VEC >::reinit(), libMesh::Elem::remove_links_to_me(), libMesh::FE< Dim, LAGRANGE_VEC >::side_map(), libMesh::Elem::SideIter::side_on_boundary(), libMesh::BoundaryInfo::side_with_boundary_id(), libMesh::MeshTools::Modification::smooth(), libMesh::ReplicatedMesh::stitching_helper(), libMesh::Elem::topological_neighbor(), libMesh::MeshRefinement::topological_neighbor(), libMesh::Parallel::Packing< T >::unpack(), libMesh::Elem::which_neighbor_am_i(), and libMesh::CheckpointIO::write_remote_elem().

2051 {
2052  libmesh_assert_less (i, this->n_neighbors());
2053 
2054  return _elemlinks[i+1];
2055 }
Elem ** _elemlinks
Definition: elem.h:1701
unsigned int n_neighbors() const
Definition: elem.h:644

◆ neighbor_ptr() [2/2]

Elem * libMesh::Elem::neighbor_ptr ( unsigned int  i)
inlineinherited
Returns
A non-const pointer to the $ i^{th} $ neighbor of this element.

Definition at line 2060 of file elem.h.

References libMesh::Elem::_elemlinks, and libMesh::Elem::n_neighbors().

2061 {
2062  libmesh_assert_less (i, this->n_neighbors());
2063 
2064  return _elemlinks[i+1];
2065 }
Elem ** _elemlinks
Definition: elem.h:1701
unsigned int n_neighbors() const
Definition: elem.h:644

◆ neighbor_ptr_range() [1/2]

SimpleRange< Elem::NeighborPtrIter > libMesh::Elem::neighbor_ptr_range ( )
inlineinherited

Returns a range with all neighbors of an element, usable in range-based for loops. The exact type of the return value here may be subject to change in future libMesh releases, but the iterators will always dereference to produce a pointer to a neighbor element (or a null pointer, for sides which have no neighbors).

Definition at line 2988 of file elem.h.

References libMesh::Elem::_elemlinks, and libMesh::Elem::n_neighbors().

Referenced by libMesh::Elem::child_neighbor(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::Elem::has_neighbor(), libMesh::Elem::make_links_to_me_remote(), libMesh::Parallel::Packing< T >::pack(), and libMesh::Elem::remove_links_to_me().

2989 {
2990  return {_elemlinks+1, _elemlinks + 1 + this->n_neighbors()};
2991 }
Elem ** _elemlinks
Definition: elem.h:1701
unsigned int n_neighbors() const
Definition: elem.h:644

◆ neighbor_ptr_range() [2/2]

SimpleRange< Elem::ConstNeighborPtrIter > libMesh::Elem::neighbor_ptr_range ( ) const
inlineinherited

Definition at line 2995 of file elem.h.

References libMesh::Elem::_elemlinks, and libMesh::Elem::n_neighbors().

2996 {
2997  return {_elemlinks+1, _elemlinks + 1 + this->n_neighbors()};
2998 }
Elem ** _elemlinks
Definition: elem.h:1701
unsigned int n_neighbors() const
Definition: elem.h:644

◆ node()

dof_id_type libMesh::Elem::node ( const unsigned int  i) const
inlineinherited
Returns
The global id number of local Node i.
Deprecated:
Use the less ambiguously named node_id() instead.

Definition at line 1927 of file elem.h.

References libMesh::Elem::node_id().

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

1928 {
1929  libmesh_deprecated();
1930  return this->node_id(i);
1931 }
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:1914

◆ node_id()

dof_id_type libMesh::Elem::node_id ( const unsigned int  i) const
inlineinherited
Returns
The global id number of local Node i.

Definition at line 1914 of file elem.h.

References libMesh::Elem::_nodes, libMesh::DofObject::id(), libMesh::DofObject::invalid_id, and libMesh::Elem::n_nodes().

Referenced by libMesh::UnstructuredMesh::all_first_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::Elem::bracketing_nodes(), libMesh::FEMap::compute_face_map(), libMesh::InfEdge2::connectivity(), libMesh::Edge2::connectivity(), libMesh::Edge3::connectivity(), libMesh::Edge4::connectivity(), libMesh::Quad4::connectivity(), libMesh::InfQuad4::connectivity(), libMesh::Pyramid5::connectivity(), libMesh::Tri3::connectivity(), libMesh::Prism6::connectivity(), libMesh::Hex8::connectivity(), libMesh::InfHex8::connectivity(), libMesh::InfPrism6::connectivity(), libMesh::InfQuad6::connectivity(), libMesh::Quad8::connectivity(), libMesh::Tet4::connectivity(), libMesh::InfPrism12::connectivity(), libMesh::Tri6::connectivity(), libMesh::Quad9::connectivity(), libMesh::Tet10::connectivity(), libMesh::Hex20::connectivity(), libMesh::InfHex16::connectivity(), libMesh::Prism15::connectivity(), libMesh::Hex27::connectivity(), libMesh::Prism18::connectivity(), libMesh::InfHex18::connectivity(), libMesh::MeshBase::detect_interior_parents(), libMesh::MeshTools::find_hanging_nodes_and_parents(), libMesh::MeshTools::find_nodal_neighbors(), libMesh::Tri3Subdivision::get_ordered_node(), libMesh::Tri3Subdivision::get_ordered_valence(), libMesh::Tet::key(), libMesh::Prism::key(), libMesh::Tri::key(), key(), libMesh::Hex::key(), libMesh::Edge::key(), libMesh::InfPrism::key(), libMesh::InfQuad6::key(), libMesh::InfHex::key(), libMesh::Quad::key(), libMesh::Quad8::key(), libMesh::Quad9::key(), libMesh::Tri6::key(), libMesh::InfQuad::key(), libMesh::Edge2::key(), libMesh::Hex27::key(), libMesh::Prism18::key(), libMesh::Pyramid14::key(), libMesh::Edge4::key(), libMesh::InfHex18::key(), libMesh::Edge3::key(), libMesh::Tet4::key(), libMesh::Elem::key(), libMesh::Elem::local_node(), libMesh::Tri3Subdivision::local_node_number(), libMesh::Elem::node(), libMesh::Elem::operator==(), libMesh::Parallel::Packing< T >::pack(), libMesh::XdrIO::pack_element(), libMesh::CheckpointIO::read_connectivity(), libMesh::DistributedMesh::renumber_nodes_and_elements(), libMesh::FE< Dim, LAGRANGE_VEC >::side_map(), libMesh::Parallel::Packing< T >::unpack(), libMesh::Elem::write_connectivity(), and libMesh::ExodusII_IO_Helper::write_elements().

1915 {
1916  libmesh_assert_less (i, this->n_nodes());
1917  libmesh_assert(_nodes[i]);
1918  libmesh_assert_not_equal_to (_nodes[i]->id(), Node::invalid_id);
1919 
1920  return _nodes[i]->id();
1921 }
Node ** _nodes
Definition: elem.h:1695
dof_id_type id() const
Definition: dof_object.h:655
virtual unsigned int n_nodes() const =0
static const dof_id_type invalid_id
Definition: dof_object.h:347

◆ node_index_range()

IntRange< unsigned short > libMesh::Elem::node_index_range ( ) const
inlineinherited
Returns
An integer range from 0 up to (but not including) the number of nodes this element contains.

Definition at line 2148 of file elem.h.

References libMesh::Elem::n_nodes().

Referenced by libMesh::MeshRefinement::add_node(), libMesh::MeshTools::Modification::flatten(), libMesh::XdrIO::pack_element(), libMesh::MeshTools::Modification::smooth(), and libMesh::Elem::write_connectivity().

2149 {
2150  return {0, cast_int<unsigned short>(this->n_nodes())};
2151 }
virtual unsigned int n_nodes() const =0

◆ node_ptr() [1/2]

const Node * libMesh::Elem::node_ptr ( const unsigned int  i) const
inlineinherited
Returns
A const pointer to local Node i.

Definition at line 1957 of file elem.h.

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

Referenced by libMesh::MeshTools::Subdivision::add_boundary_ghosts(), libMesh::BoundaryInfo::add_elements(), libMesh::MeshRefinement::add_node(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::Quad4::build_side_ptr(), libMesh::InfQuad4::build_side_ptr(), libMesh::Prism6::build_side_ptr(), libMesh::Pyramid5::build_side_ptr(), libMesh::InfHex8::build_side_ptr(), libMesh::Hex8::build_side_ptr(), libMesh::Tri3::build_side_ptr(), libMesh::InfPrism6::build_side_ptr(), libMesh::InfPrism12::build_side_ptr(), libMesh::InfHex18::build_side_ptr(), libMesh::Tet4::build_side_ptr(), libMesh::InfQuad6::build_side_ptr(), libMesh::Quad8::build_side_ptr(), libMesh::InfHex16::build_side_ptr(), libMesh::Tet10::build_side_ptr(), libMesh::Tri6::build_side_ptr(), libMesh::Hex20::build_side_ptr(), libMesh::Pyramid13::build_side_ptr(), libMesh::Prism15::build_side_ptr(), libMesh::Edge::build_side_ptr(), libMesh::Quad9::build_side_ptr(), libMesh::Hex27::build_side_ptr(), libMesh::Prism18::build_side_ptr(), libMesh::Pyramid14::build_side_ptr(), libMesh::FEMap::compute_affine_map(), libMesh::FEMap::compute_map(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_periodic_constraints(), libMesh::MeshTools::find_nodal_neighbors(), libMesh::MeshTools::Subdivision::find_one_ring(), libMesh::MeshTools::Modification::flatten(), libMesh::Elem::get_node(), libMesh::Elem::get_node_index(), libMesh::Elem::is_vertex_on_parent(), libMesh::MeshTools::libmesh_assert_consistent_distributed_nodes(), libMesh::MeshTools::libmesh_assert_parallel_consistent_new_node_procids(), libMesh::MeshTools::libmesh_assert_valid_boundary_ids(), libMesh::Elem::libmesh_assert_valid_node_pointers(), libMesh::Elem::node_ref(), libMesh::Tri3Subdivision::prepare_subdivision_properties(), libMesh::Tet::side_ptr(), libMesh::Prism::side_ptr(), side_ptr(), libMesh::Hex::side_ptr(), libMesh::Tri::side_ptr(), libMesh::Edge::side_ptr(), libMesh::InfPrism::side_ptr(), libMesh::InfHex::side_ptr(), libMesh::Quad::side_ptr(), libMesh::InfQuad::side_ptr(), libMesh::Elem::simple_build_side_ptr(), libMesh::MeshTools::Modification::smooth(), and libMesh::ReplicatedMesh::stitching_helper().

1958 {
1959  libmesh_assert_less (i, this->n_nodes());
1960  libmesh_assert(_nodes[i]);
1961 
1962  return _nodes[i];
1963 }
Node ** _nodes
Definition: elem.h:1695
virtual unsigned int n_nodes() const =0

◆ node_ptr() [2/2]

Node * libMesh::Elem::node_ptr ( const unsigned int  i)
inlineinherited
Returns
A non-const pointer to local Node i.

Definition at line 1968 of file elem.h.

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

1969 {
1970  libmesh_assert_less (i, this->n_nodes());
1971  libmesh_assert(_nodes[i]);
1972 
1973  return _nodes[i];
1974 }
Node ** _nodes
Definition: elem.h:1695
virtual unsigned int n_nodes() const =0

◆ node_ref() [1/2]

const Node & libMesh::Elem::node_ref ( const unsigned int  i) const
inlineinherited

◆ node_ref() [2/2]

Node & libMesh::Elem::node_ref ( const unsigned int  i)
inlineinherited
Returns
A writable reference to local Node i.

Definition at line 1987 of file elem.h.

References libMesh::Elem::node_ptr().

1988 {
1989  return *this->node_ptr(i);
1990 }
const Node * node_ptr(const unsigned int i) const
Definition: elem.h:1957

◆ node_ref_range() [1/2]

SimpleRange< Elem::NodeRefIter > libMesh::Elem::node_ref_range ( )
inlineinherited

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

Definition at line 2130 of file elem.h.

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

Referenced by libMesh::MeshTools::Modification::distort(), libMesh::Elem::find_interior_neighbors(), libMesh::MeshCommunication::make_new_node_proc_ids_parallel_consistent(), libMesh::Elem::point_test(), libMesh::reconnect_nodes(), and libMesh::ReplicatedMesh::renumber_nodes_and_elements().

2131 {
2132  return {_nodes, _nodes+this->n_nodes()};
2133 }
Node ** _nodes
Definition: elem.h:1695
virtual unsigned int n_nodes() const =0

◆ node_ref_range() [2/2]

SimpleRange< Elem::ConstNodeRefIter > libMesh::Elem::node_ref_range ( ) const
inlineinherited

Definition at line 2139 of file elem.h.

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

2140 {
2141  return {_nodes, _nodes+this->n_nodes()};
2142 }
Node ** _nodes
Definition: elem.h:1695
virtual unsigned int n_nodes() const =0

◆ nodes_on_side()

◆ nullify_neighbors()

void libMesh::Elem::nullify_neighbors ( )
inherited

Replaces this element with nullptr for all of its neighbors. This is useful when deleting an element.

Definition at line 2532 of file elem.C.

References libMesh::Elem::level(), libMesh::Elem::n_neighbors(), libMesh::Elem::neighbor_ptr(), libMesh::remote_elem, libMesh::Elem::set_neighbor(), libMesh::Elem::side_index_range(), and libMesh::Elem::which_neighbor_am_i().

2533 {
2534  // Tell any of my neighbors about my death...
2535  // Looks strange, huh?
2536  for (auto n : this->side_index_range())
2537  {
2538  Elem * current_neighbor = this->neighbor_ptr(n);
2539  if (current_neighbor && current_neighbor != remote_elem)
2540  {
2541  // Note: it is possible that I see the neighbor
2542  // (which is coarser than me)
2543  // but they don't see me, so avoid that case.
2544  if (current_neighbor->level() == this->level())
2545  {
2546  const unsigned int w_n_a_i = current_neighbor->which_neighbor_am_i(this);
2547  libmesh_assert_less (w_n_a_i, current_neighbor->n_neighbors());
2548  current_neighbor->set_neighbor(w_n_a_i, nullptr);
2549  this->set_neighbor(n, nullptr);
2550  }
2551  }
2552  }
2553 }
IntRange< unsigned short > side_index_range() const
Definition: elem.h:2166
void set_neighbor(const unsigned int i, Elem *n)
Definition: elem.h:2083
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1811
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:2050
unsigned int level() const
Definition: elem.h:2521
const RemoteElem * remote_elem
Definition: remote_elem.C:57

◆ on_boundary()

bool libMesh::Elem::on_boundary ( ) const
inlineinherited
Returns
true if this element has a side coincident with a boundary (indicated by a nullptr neighbor), false otherwise.

Definition at line 2304 of file elem.h.

References libMesh::Elem::has_neighbor().

2305 {
2306  // By convention, the element is on the boundary
2307  // if it has a nullptr neighbor.
2308  return this->has_neighbor(nullptr);
2309 }
bool has_neighbor(const Elem *elem) const
Definition: elem.h:2093

◆ operator=() [1/2]

Pyramid& libMesh::Pyramid::operator= ( const Pyramid )
delete

◆ operator=() [2/2]

Pyramid& libMesh::Pyramid::operator= ( Pyramid &&  )
delete

◆ operator==()

bool libMesh::Elem::operator== ( const Elem rhs) const
inherited
Returns
true if two elements are identical, false otherwise. This is true if the elements are connected to identical global nodes, regardless of how those nodes might be numbered local to the elements.

Definition at line 419 of file elem.C.

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

420 {
421  // If the elements aren't the same type, they aren't equal
422  if (this->type() != rhs.type())
423  return false;
424 
425  const unsigned short n_n = this->n_nodes();
426  libmesh_assert_equal_to(n_n, rhs.n_nodes());
427 
428  // Make two sorted arrays of global node ids and compare them for
429  // equality.
430  std::array<dof_id_type, Elem::max_n_nodes> this_ids, rhs_ids;
431 
432  for (unsigned short n = 0; n != n_n; n++)
433  {
434  this_ids[n] = this->node_id(n);
435  rhs_ids[n] = rhs.node_id(n);
436  }
437 
438  // Sort the vectors to rule out different local node numberings.
439  std::sort(this_ids.begin(), this_ids.begin()+n_n);
440  std::sort(rhs_ids.begin(), rhs_ids.begin()+n_n);
441 
442  // If the node ids match, the elements are equal!
443  for (unsigned short n = 0; n != n_n; ++n)
444  if (this_ids[n] != rhs_ids[n])
445  return false;
446  return true;
447 }
virtual unsigned int n_nodes() const =0
virtual ElemType type() const =0
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:1914

◆ opposite_node()

unsigned int libMesh::Elem::opposite_node ( const unsigned int  n,
const unsigned int  s 
) const
virtualinherited
Returns
The local node number for the node opposite to node n on side opposite_side(s) (for a tensor product element), or throws an error otherwise.

Reimplemented in libMesh::Quad, libMesh::Edge, and libMesh::Hex.

Definition at line 2911 of file elem.C.

2913 {
2914  // If the subclass didn't rederive this, using it is an error
2915  libmesh_not_implemented();
2916 }

◆ opposite_side()

unsigned int libMesh::Elem::opposite_side ( const unsigned int  s) const
virtualinherited
Returns
The side number opposite to s (for a tensor product element), or throws an error otherwise.

Reimplemented in libMesh::Quad, libMesh::Edge, and libMesh::Hex.

Definition at line 2903 of file elem.C.

2904 {
2905  // If the subclass didn't rederive this, using it is an error
2906  libmesh_not_implemented();
2907 }

◆ origin()

virtual Point libMesh::Elem::origin ( ) const
inlinevirtualinherited
Returns
The origin for an infinite element.

Currently, all infinite elements used in a mesh share the same origin. Override this in infinite element classes.

Reimplemented in libMesh::InfQuad, libMesh::InfEdge2, and libMesh::InfCell.

Definition at line 1553 of file elem.h.

Referenced by libMesh::InfFE< Dim, T_radial, T_map >::combine_base_radial(), libMesh::InfFE< Dim, T_radial, T_map >::compute_data(), libMesh::Elem::get_info(), libMesh::InfFE< Dim, T_radial, T_map >::inverse_map(), and libMesh::InfFE< Dim, T_radial, T_map >::map().

1553 { libmesh_not_implemented(); return Point(); }

◆ p_level()

unsigned int libMesh::Elem::p_level ( ) const
inlineinherited
Returns
The value of the p refinement level of an active element, or the minimum value of the p refinement levels of an ancestor element's descendants.

Definition at line 2555 of file elem.h.

References libMesh::Elem::_p_level.

Referenced by libMesh::FEGenericBase< FEOutputType< T >::type >::coarsened_dof_values(), libMesh::FEInterface::compute_data(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_periodic_constraints(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_proj_constraints(), libMesh::DofMap::constrain_p_dofs(), libMesh::DofMap::dof_indices(), libMesh::FE< Dim, LAGRANGE_VEC >::dofs_on_edge(), libMesh::FE< Dim, LAGRANGE_VEC >::dofs_on_side(), libMesh::FE< Dim, LAGRANGE_VEC >::edge_reinit(), libMesh::Elem::Elem(), libMesh::MeshRefinement::enforce_mismatch_limit_prior_to_refinement(), libMesh::Elem::get_info(), libMesh::InfFE< Dim, T_radial, T_map >::init_face_shape_functions(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_p_levels(), libMesh::MeshRefinement::limit_overrefined_boundary(), libMesh::MeshRefinement::limit_underrefined_boundary(), libMesh::MeshRefinement::make_coarsening_compatible(), 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::WeightedPatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::PatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::Parallel::Packing< T >::pack(), libMesh::XdrIO::pack_element(), libMesh::Elem::refine(), libMesh::FE< Dim, LAGRANGE_VEC >::reinit(), libMesh::InfFE< Dim, T_radial, T_map >::reinit(), libMesh::FEXYZ< Dim >::reinit(), libMesh::HPCoarsenTest::select_refinement(), libMesh::Elem::set_p_level(), libMesh::Elem::set_p_refinement_flag(), libMesh::FE< Dim, LAGRANGE_VEC >::shape(), libMesh::FE< Dim, LAGRANGE_VEC >::shape_deriv(), libMesh::FE< Dim, LAGRANGE_VEC >::shape_second_deriv(), libMesh::FE< Dim, LAGRANGE_VEC >::side_map(), libMesh::MeshRefinement::test_level_one(), and libMesh::Parallel::Packing< T >::unpack().

2556 {
2557 #ifdef LIBMESH_ENABLE_AMR
2558  return _p_level;
2559 #else
2560  return 0;
2561 #endif
2562 }
unsigned char _p_level
Definition: elem.h:1736

◆ p_refinement_flag()

◆ pack_indexing()

void libMesh::DofObject::pack_indexing ( std::back_insert_iterator< std::vector< largest_id_type >>  target) const
inherited

A method for creating packed data from our index buffer - basically a copy with prepended size with our current implementation.

Definition at line 520 of file dof_object.C.

References libMesh::DofObject::_idx_buf, libMesh::DofObject::old_dof_object, and libMesh::DofObject::pack_indexing().

Referenced by libMesh::Parallel::Packing< T >::pack(), and libMesh::DofObject::pack_indexing().

521 {
522 #ifdef LIBMESH_ENABLE_AMR
523  // We might need to pack old_dof_object too
524  *target++ = (old_dof_object == nullptr) ? 0 : 1;
525 #endif
526 
527  *target++ = _idx_buf.size();
528  std::copy(_idx_buf.begin(), _idx_buf.end(), target);
529 
530 #ifdef LIBMESH_ENABLE_AMR
531  if (old_dof_object)
532  old_dof_object->pack_indexing(target);
533 #endif
534 }
DofObject * old_dof_object
Definition: dof_object.h:79
void pack_indexing(std::back_insert_iterator< std::vector< largest_id_type >> target) const
Definition: dof_object.C:520
index_buffer_t _idx_buf
Definition: dof_object.h:508

◆ packed_indexing_size()

unsigned int libMesh::DofObject::packed_indexing_size ( ) const
inherited

If we pack our indices into an buffer for communications, how many ints do we need?

Definition at line 445 of file dof_object.C.

References libMesh::DofObject::_idx_buf, libMesh::DofObject::old_dof_object, and libMesh::DofObject::packed_indexing_size().

Referenced by libMesh::Parallel::Packing< T >::packable_size(), libMesh::DofObject::packed_indexing_size(), libMesh::Node::packed_size(), and libMesh::Parallel::Packing< T >::unpack().

446 {
447  return
448  cast_int<unsigned int> (
449 #ifdef LIBMESH_ENABLE_AMR
450  ((old_dof_object == nullptr) ? 0 : old_dof_object->packed_indexing_size()) + 2 +
451 #else
452  1 +
453 #endif
454  _idx_buf.size());
455 }
DofObject * old_dof_object
Definition: dof_object.h:79
unsigned int packed_indexing_size() const
Definition: dof_object.C:445
index_buffer_t _idx_buf
Definition: dof_object.h:508

◆ parent() [1/2]

const Elem * libMesh::Elem::parent ( ) const
inlineinherited
Returns
A const pointer to the element's parent, or nullptr if the element was not created via refinement.

Definition at line 2479 of file elem.h.

References libMesh::Elem::_elemlinks.

Referenced by libMesh::UniformRefinementEstimator::_estimate_error(), libMesh::Elem::add_child(), libMesh::BoundaryInfo::add_elements(), libMesh::UnstructuredMesh::all_first_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::BoundaryInfo::boundary_ids(), libMesh::OldSolutionBase< Output, point_output >::check_old_context(), libMesh::FEAbstract::compute_node_constraints(), libMesh::connect_families(), libMesh::UnstructuredMesh::contract(), libMesh::UnstructuredMesh::copy_nodes_and_elements(), libMesh::MeshRefinement::create_parent_error_vector(), libMesh::BoundaryInfo::edge_boundary_ids(), libMesh::Elem::Elem(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::AdjointRefinementEstimator::estimate_error(), libMesh::ExactErrorEstimator::estimate_error(), libMesh::MeshTools::find_hanging_nodes_and_parents(), 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::Elem::get_info(), libMesh::Elem::is_ancestor_of(), libMesh::Elem::level(), libMesh::MeshTools::libmesh_assert_topology_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_valid_amr_elem_ids(), libMesh::MeshTools::libmesh_assert_valid_amr_interior_parents(), libMesh::Elem::libmesh_assert_valid_neighbors(), libMesh::MeshTools::libmesh_assert_valid_remote_elems(), libMesh::MeshRefinement::limit_level_mismatch_at_edge(), libMesh::Elem::make_links_to_me_local(), libMesh::Elem::make_links_to_me_remote(), libMesh::MeshRefinement::make_refinement_compatible(), libMesh::SiblingCoupling::operator()(), libMesh::BuildProjectionList::operator()(), libMesh::Parallel::Packing< T >::pack(), libMesh::BoundaryInfo::raw_boundary_ids(), libMesh::BoundaryInfo::raw_edge_boundary_ids(), libMesh::BoundaryInfo::raw_shellface_boundary_ids(), libMesh::CheckpointIO::read_connectivity(), libMesh::Elem::refine(), libMesh::Elem::remove_links_to_me(), libMesh::HPCoarsenTest::select_refinement(), libMesh::Elem::set_p_level(), libMesh::Partitioner::set_parent_processor_ids(), libMesh::BoundaryInfo::shellface_boundary_ids(), libMesh::BoundaryInfo::side_with_boundary_id(), libMesh::MeshTools::Modification::smooth(), libMesh::Elem::subactive(), libMesh::Parallel::sync_element_data_by_parent_id(), libMesh::Elem::top_parent(), libMesh::Elem::topological_neighbor(), libMesh::Parallel::Packing< T >::unpack(), and libMesh::Elem::which_neighbor_am_i().

2480 {
2481  return _elemlinks[0];
2482 }
Elem ** _elemlinks
Definition: elem.h:1701

◆ parent() [2/2]

Elem * libMesh::Elem::parent ( )
inlineinherited
Returns
A pointer to the element's parent, or nullptr if the element was not created via refinement.

Definition at line 2487 of file elem.h.

References libMesh::Elem::_elemlinks.

2488 {
2489  return _elemlinks[0];
2490 }
Elem ** _elemlinks
Definition: elem.h:1701

◆ parent_bracketing_nodes()

const std::vector< std::pair< unsigned char, unsigned char > > & libMesh::Elem::parent_bracketing_nodes ( unsigned int  c,
unsigned int  n 
) const
virtualinherited
Returns
All the pairs of nodes (indexed by local node id) which should bracket node n of child c.

Definition at line 2001 of file elem.C.

References libMesh::Elem::_get_bracketing_node_cache(), libMesh::TypeVector< T >::absolute_fuzzy_equals(), libMesh::TypeVector< T >::add_scaled(), libMesh::Elem::as_parent_node(), libMesh::Elem::build(), libMesh::Elem::child(), libMesh::Elem::default_order(), libMesh::Elem::embedding_matrix(), libMesh::Elem::embedding_matrix_version(), libMesh::FIRST, libMesh::invalid_uint, libMesh::Elem::is_mid_infinite_edge_node(), libMesh::Elem::is_vertex_on_child(), libMesh::Elem::master_point(), libMesh::Elem::n_children(), libMesh::Elem::n_nodes(), libMesh::Elem::n_nodes_in_child(), libMesh::parent_bracketing_nodes_mutex, libMesh::Elem::second_order_equivalent_type(), and libMesh::Elem::type().

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

2003 {
2004  // Indexed first by embedding matrix type, then by child id, then by
2005  // child node, then by bracketing pair
2006  std::vector<std::vector<std::vector<std::vector<std::pair<unsigned char, unsigned char>>>>> &
2007  cached_bracketing_nodes = this->_get_bracketing_node_cache();
2008 
2009  const unsigned int em_vers = this->embedding_matrix_version();
2010 
2011  // We may be updating the cache on one thread, and while that
2012  // happens we can't safely access the cache from other threads.
2013  Threads::spin_mutex::scoped_lock lock(parent_bracketing_nodes_mutex);
2014 
2015  if (cached_bracketing_nodes.size() <= em_vers)
2016  cached_bracketing_nodes.resize(em_vers+1);
2017 
2018  const unsigned int nc = this->n_children();
2019 
2020  // If we haven't cached the bracketing nodes corresponding to this
2021  // embedding matrix yet, let's do so now.
2022  if (cached_bracketing_nodes[em_vers].size() < nc)
2023  {
2024  // If we're a second-order element but we're not a full-order
2025  // element, then some of our bracketing nodes may not exist
2026  // except on the equivalent full-order element. Let's build an
2027  // equivalent full-order element and make a copy of its cache to
2028  // use.
2029  if (this->default_order() != FIRST &&
2030  second_order_equivalent_type(this->type(), /*full_ordered=*/ true) != this->type())
2031  {
2032  // Check that we really are the non-full-order type
2033  libmesh_assert_equal_to
2034  (second_order_equivalent_type (this->type(), false),
2035  this->type());
2036 
2037  // Build the full-order type
2038  ElemType full_type =
2039  second_order_equivalent_type(this->type(), /*full_ordered=*/ true);
2040  std::unique_ptr<Elem> full_elem = Elem::build(full_type);
2041 
2042  // This won't work for elements with multiple
2043  // embedding_matrix versions, but every such element is full
2044  // order anyways.
2045  libmesh_assert_equal_to(em_vers, 0);
2046 
2047  // Make sure its cache has been built. We temporarily
2048  // release our mutex lock so that the inner call can
2049  // re-acquire it.
2050  lock.release();
2051  full_elem->parent_bracketing_nodes(0,0);
2052 
2053  // And then we need to lock again, so that if someone *else*
2054  // grabbed our lock before we did we don't risk accessing
2055  // cached_bracketing_nodes while they're working on it.
2056  // Threading is hard.
2057  lock.acquire(parent_bracketing_nodes_mutex);
2058 
2059  // Copy its cache
2060  cached_bracketing_nodes =
2061  full_elem->_get_bracketing_node_cache();
2062 
2063  // Now we don't need to build the cache ourselves.
2064  return cached_bracketing_nodes[em_vers][child][child_node];
2065  }
2066 
2067  cached_bracketing_nodes[em_vers].resize(nc);
2068 
2069  const unsigned int nn = this->n_nodes();
2070 
2071  // We have to examine each child
2072  for (unsigned int c = 0; c != nc; ++c)
2073  {
2074  const unsigned int ncn = this->n_nodes_in_child(c);
2075 
2076  cached_bracketing_nodes[em_vers][c].resize(ncn);
2077 
2078  // We have to examine each node in that child
2079  for (unsigned int n = 0; n != ncn; ++n)
2080  {
2081  // If this child node isn't a vertex or an infinite
2082  // child element's mid-infinite-edge node, then we need
2083  // to find bracketing nodes on the child.
2084  if (!this->is_vertex_on_child(c, n)
2085 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
2086  && !this->is_mid_infinite_edge_node(n)
2087 #endif
2088  )
2089  {
2090  // Use the embedding matrix to find the child node
2091  // location in parent master element space
2092  Point bracketed_pt;
2093 
2094  for (unsigned int pn = 0; pn != nn; ++pn)
2095  {
2096  const float em_val =
2097  this->embedding_matrix(c,n,pn);
2098 
2099  libmesh_assert_not_equal_to (em_val, 1);
2100  if (em_val != 0.)
2101  bracketed_pt.add_scaled(this->master_point(pn), em_val);
2102  }
2103 
2104  // Check each pair of nodes on the child which are
2105  // also both parent nodes
2106  for (unsigned int n1 = 0; n1 != ncn; ++n1)
2107  {
2108  if (n1 == n)
2109  continue;
2110 
2111  unsigned int parent_n1 =
2112  this->as_parent_node(c,n1);
2113 
2114  if (parent_n1 == libMesh::invalid_uint)
2115  continue;
2116 
2117  Point p1 = this->master_point(parent_n1);
2118 
2119  for (unsigned int n2 = n1+1; n2 < nn; ++n2)
2120  {
2121  if (n2 == n)
2122  continue;
2123 
2124  unsigned int parent_n2 =
2125  this->as_parent_node(c,n2);
2126 
2127  if (parent_n2 == libMesh::invalid_uint)
2128  continue;
2129 
2130  Point p2 = this->master_point(parent_n2);
2131 
2132  Point pmid = (p1 + p2)/2;
2133 
2134  if (pmid == bracketed_pt)
2135  {
2136  cached_bracketing_nodes[em_vers][c][n].push_back
2137  (std::make_pair(parent_n1,parent_n2));
2138  break;
2139  }
2140  else
2141  libmesh_assert(!pmid.absolute_fuzzy_equals(bracketed_pt));
2142  }
2143  }
2144  }
2145  // If this child node is a parent node, we need to
2146  // find bracketing nodes on the parent.
2147  else
2148  {
2149  unsigned int parent_node = this->as_parent_node(c,n);
2150 
2151  Point bracketed_pt;
2152 
2153  // If we're not a parent node, use the embedding
2154  // matrix to find the child node location in parent
2155  // master element space
2156  if (parent_node == libMesh::invalid_uint)
2157  {
2158  for (unsigned int pn = 0; pn != nn; ++pn)
2159  {
2160  const float em_val =
2161  this->embedding_matrix(c,n,pn);
2162 
2163  libmesh_assert_not_equal_to (em_val, 1);
2164  if (em_val != 0.)
2165  bracketed_pt.add_scaled(this->master_point(pn), em_val);
2166  }
2167  }
2168  // If we're a parent node then we need no arithmetic
2169  else
2170  bracketed_pt = this->master_point(parent_node);
2171 
2172  for (unsigned int n1 = 0; n1 != nn; ++n1)
2173  {
2174  if (n1 == parent_node)
2175  continue;
2176 
2177  Point p1 = this->master_point(n1);
2178 
2179  for (unsigned int n2 = n1+1; n2 < nn; ++n2)
2180  {
2181  if (n2 == parent_node)
2182  continue;
2183 
2184  Point pmid = (p1 + this->master_point(n2))/2;
2185 
2186  if (pmid == bracketed_pt)
2187  {
2188  cached_bracketing_nodes[em_vers][c][n].push_back
2189  (std::make_pair(n1,n2));
2190  break;
2191  }
2192  else
2193  libmesh_assert(!pmid.absolute_fuzzy_equals(bracketed_pt));
2194  }
2195  }
2196  }
2197  }
2198  }
2199  }
2200 
2201  return cached_bracketing_nodes[em_vers][child][child_node];
2202 }
const unsigned int invalid_uint
Definition: libmesh.h:245
virtual unsigned int embedding_matrix_version() const
Definition: elem.h:1609
virtual float embedding_matrix(const unsigned int child_num, const unsigned int child_node_num, const unsigned int parent_node_num) const =0
virtual unsigned int n_children() const =0
virtual unsigned int n_nodes() const =0
virtual unsigned int as_parent_node(unsigned int c, unsigned int n) const
Definition: elem.C:1933
static std::unique_ptr< Elem > build(const ElemType type, Elem *p=nullptr)
Definition: elem.C:245
Threads::spin_mutex parent_bracketing_nodes_mutex
Definition: elem.C:86
static ElemType second_order_equivalent_type(const ElemType et, const bool full_ordered=true)
Definition: elem.C:2643
Elem * child(const unsigned int i) const
Definition: elem.h:2598
virtual unsigned int is_vertex_on_child(unsigned int, unsigned int n) const
Definition: elem.h:694
virtual Point master_point(const unsigned int i) const =0
virtual Order default_order() const =0
virtual std::vector< std::vector< std::vector< std::vector< std::pair< unsigned char, unsigned char > > > > > & _get_bracketing_node_cache() const
Definition: elem.h:1659
virtual ElemType type() const =0
virtual unsigned int n_nodes_in_child(unsigned int) const
Definition: elem.h:613
virtual bool is_mid_infinite_edge_node(const unsigned int) const
Definition: elem.h:1544

◆ point() [1/2]

const Point & libMesh::Elem::point ( const unsigned int  i) const
inlineinherited
Returns
The Point associated with local Node i.

Definition at line 1892 of file elem.h.

References libMesh::Elem::_nodes, libMesh::DofObject::invalid_id, and libMesh::Elem::n_nodes().

Referenced by libMesh::PostscriptIO::_compute_edge_bezier_coeffs(), libMesh::MeshTools::Subdivision::add_boundary_ghosts(), libMesh::BoundaryInfo::add_elements(), libMesh::MeshRefinement::add_node(), libMesh::MeshTools::Modification::all_tri(), libMesh::Tet::choose_diagonal(), libMesh::Elem::coarsen(), libMesh::InfFE< Dim, T_radial, T_map >::compute_data(), libMesh::FEMap::compute_edge_map(), libMesh::Elem::contains_edge_of(), libMesh::InfQuad4::contains_point(), libMesh::InfPrism::contains_point(), libMesh::InfHex::contains_point(), libMesh::Tri3::contains_point(), libMesh::Tet4::contains_point(), libMesh::Elem::contains_vertex_of(), libMesh::ElemCutter::cut_2D(), libMesh::ElemCutter::cut_3D(), libMesh::FEMContext::elem_position_get(), libMesh::Quad4::has_affine_map(), libMesh::Prism6::has_affine_map(), libMesh::Edge3::has_affine_map(), libMesh::Edge4::has_affine_map(), libMesh::Quad8::has_affine_map(), libMesh::Quad9::has_affine_map(), libMesh::Hex8::has_affine_map(), libMesh::Tri6::has_affine_map(), libMesh::Tet10::has_affine_map(), libMesh::Hex27::has_affine_map(), libMesh::Hex20::has_affine_map(), libMesh::Prism15::has_affine_map(), libMesh::Prism18::has_affine_map(), libMesh::Elem::hmax(), libMesh::Elem::hmin(), libMesh::Elem::length(), libMesh::Edge4::loose_bounding_box(), libMesh::Edge3::loose_bounding_box(), libMesh::Quad8::loose_bounding_box(), libMesh::Tri6::loose_bounding_box(), libMesh::Quad9::loose_bounding_box(), libMesh::Elem::loose_bounding_box(), libMesh::InfFE< Dim, T_radial, T_map >::map(), libMesh::FE< Dim, LAGRANGE_VEC >::map(), libMesh::FE< Dim, LAGRANGE_VEC >::map_eta(), libMesh::FE< Dim, LAGRANGE_VEC >::map_xi(), libMesh::FE< Dim, LAGRANGE_VEC >::map_zeta(), libMesh::Tri3::min_and_max_angle(), libMesh::Tet4::min_and_max_angle(), libMesh::FEMSystem::numerical_jacobian(), libMesh::InfCell::origin(), libMesh::InfEdge2::origin(), libMesh::InfQuad::origin(), libMesh::PostscriptIO::plot_linear_elem(), libMesh::Tri::quality(), libMesh::Quad::quality(), libMesh::FE< Dim, LAGRANGE_VEC >::reinit(), libMesh::FE< Dim, LAGRANGE_VEC >::shape(), libMesh::FE< Dim, LAGRANGE_VEC >::shape_deriv(), libMesh::FE< Dim, LAGRANGE_VEC >::shape_second_deriv(), libMesh::MeshTools::Modification::smooth(), libMesh::Edge2::volume(), libMesh::Quad4::volume(), libMesh::Edge3::volume(), libMesh::Tri3::volume(), libMesh::Pyramid5::volume(), libMesh::Prism6::volume(), libMesh::Edge4::volume(), libMesh::Hex8::volume(), libMesh::Tet4::volume(), libMesh::Quad8::volume(), libMesh::Tri6::volume(), libMesh::Quad9::volume(), libMesh::Pyramid13::volume(), libMesh::Tet10::volume(), libMesh::Prism15::volume(), libMesh::Hex20::volume(), libMesh::Pyramid14::volume(), libMesh::Prism18::volume(), libMesh::Hex27::volume(), and libMesh::Elem::which_side_am_i().

1893 {
1894  libmesh_assert_less (i, this->n_nodes());
1895  libmesh_assert(_nodes[i]);
1896  libmesh_assert_not_equal_to (_nodes[i]->id(), Node::invalid_id);
1897 
1898  return *_nodes[i];
1899 }
Node ** _nodes
Definition: elem.h:1695
virtual unsigned int n_nodes() const =0
static const dof_id_type invalid_id
Definition: dof_object.h:347

◆ point() [2/2]

Point & libMesh::Elem::point ( const unsigned int  i)
inlineinherited
Returns
The Point associated with local Node i as a writable reference.

Definition at line 1904 of file elem.h.

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

1905 {
1906  libmesh_assert_less (i, this->n_nodes());
1907 
1908  return *_nodes[i];
1909 }
Node ** _nodes
Definition: elem.h:1695
virtual unsigned int n_nodes() const =0

◆ print_dof_info()

void libMesh::DofObject::print_dof_info ( ) const
inherited

Print out info for debugging.

Definition at line 548 of file dof_object.C.

References libMesh::DofObject::dof_number(), libMesh::DofObject::id(), libMesh::DofObject::n_comp(), libMesh::DofObject::n_systems(), libMesh::DofObject::n_vars(), and libMesh::out.

549 {
550  libMesh::out << this->id() << " [ ";
551 
552  for (unsigned int s=0; s<this->n_systems(); s++)
553  {
554  libMesh::out << "s:" << s << " ";
555  for (unsigned int var=0; var<this->n_vars(s); var++)
556  {
557  libMesh::out << "v:" << var << " ";
558  for (unsigned int comp=0; comp<this->n_comp(s,var); comp++)
559  {
560  libMesh::out << "c:" << comp << " dof:" << this->dof_number(s,var,comp) << " ";
561  }
562  }
563  }
564 
565  libMesh::out << "]\n";
566 }
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
Definition: dof_object.h:833
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:803
dof_id_type id() const
Definition: dof_object.h:655
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:768
unsigned int n_systems() const
Definition: dof_object.h:749
OStreamProxy out(std::cout)

◆ print_info() [1/3]

void libMesh::ReferenceCounter::print_info ( std::ostream &  out = libMesh::out)
staticinherited

Prints the reference information, by default to libMesh::out.

Definition at line 87 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter, and libMesh::ReferenceCounter::get_info().

88 {
90  out_stream << ReferenceCounter::get_info();
91 }
static std::string get_info()

◆ print_info() [2/3]

void libMesh::ReferenceCounter::print_info ( std::ostream &  out = libMesh::out)
staticinherited

Prints the reference information, by default to libMesh::out.

Definition at line 87 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter, and libMesh::ReferenceCounter::get_info().

88 {
90  out_stream << ReferenceCounter::get_info();
91 }
static std::string get_info()

◆ print_info() [3/3]

void libMesh::Elem::print_info ( std::ostream &  os = libMesh::out) const
inherited

Prints relevant information about the element.

Definition at line 2440 of file elem.C.

References libMesh::Elem::get_info().

Referenced by libMesh::FEMap::compute_single_point_map(), libMesh::FE< Dim, LAGRANGE_VEC >::inverse_map(), and libMesh::operator<<().

2441 {
2442  os << this->get_info()
2443  << std::endl;
2444 }
std::string get_info() const
Definition: elem.C:2448

◆ processor_id() [1/3]

processor_id_type libMesh::DofObject::processor_id ( ) const
inlineinherited
Returns
The processor that this DofObject belongs to.

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

Definition at line 717 of file dof_object.h.

References libMesh::DofObject::_processor_id.

Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::DistributedMesh::add_elem(), libMesh::BoundaryInfo::add_elements(), libMesh::DofMap::add_neighbors_to_send_list(), libMesh::DistributedMesh::add_node(), libMesh::MeshRefinement::add_node(), libMesh::ReplicatedMesh::add_point(), libMesh::DistributedMesh::add_point(), libMesh::UnstructuredMesh::all_first_order(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::Patch::build_around_element(), libMesh::MeshTools::Generation::build_extrusion(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::Nemesis_IO_Helper::compute_num_global_nodesets(), libMesh::Nemesis_IO_Helper::compute_num_global_sidesets(), libMesh::UnstructuredMesh::copy_nodes_and_elements(), libMesh::UnstructuredMesh::create_submesh(), libMesh::DistributedMesh::delete_elem(), libMesh::DistributedMesh::delete_node(), libMesh::DofMap::distribute_dofs(), libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::Elem::Elem(), libMesh::MeshFunction::find_element(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshTools::Modification::flatten(), libMesh::Node::get_info(), libMesh::Elem::get_info(), libMesh::DofMap::get_info(), libMesh::DofMap::get_local_constraints(), libMesh::DistributedMesh::insert_elem(), libMesh::DofObject::invalidate_processor_id(), libMesh::MeshTools::libmesh_assert_consistent_distributed(), libMesh::MeshTools::libmesh_assert_consistent_distributed_nodes(), libMesh::MeshTools::libmesh_assert_parallel_consistent_new_node_procids(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_topology_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_valid_amr_elem_ids(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::DofMap::local_variable_indices(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::MeshCommunication::make_new_node_proc_ids_parallel_consistent(), libMesh::DistributedMesh::own_node(), libMesh::Parallel::Packing< T >::pack(), libMesh::XdrIO::pack_element(), libMesh::LinearPartitioner::partition_range(), libMesh::SFCPartitioner::partition_range(), libMesh::CentroidPartitioner::partition_range(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), libMesh::DofObject::processor_id(), libMesh::Nemesis_IO::read(), libMesh::CheckpointIO::read_connectivity(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::MeshBase::recalculate_n_partitions(), libMesh::Elem::refine(), libMesh::DofMap::scatter_constraints(), libMesh::Partitioner::set_node_processor_ids(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::Partitioner::set_parent_processor_ids(), libMesh::Parallel::sync_dofobject_data_by_id(), libMesh::Parallel::sync_element_data_by_parent_id(), libMesh::Parallel::sync_node_data_by_element_id_once(), libMesh::Parallel::Packing< T >::unpack(), libMesh::GmshIO::write_mesh(), and libMesh::Nemesis_IO_Helper::write_sidesets().

718 {
719  return _processor_id;
720 }
processor_id_type _processor_id
Definition: dof_object.h:453

◆ processor_id() [2/3]

processor_id_type & libMesh::DofObject::processor_id ( )
inlineinherited
Returns
The processor that this DofObject belongs to as a writable reference.

Definition at line 725 of file dof_object.h.

References libMesh::DofObject::_processor_id.

726 {
727  return _processor_id;
728 }
processor_id_type _processor_id
Definition: dof_object.h:453

◆ processor_id() [3/3]

void libMesh::DofObject::processor_id ( const processor_id_type  pid)
inlineinherited

Sets the processor_id for this DofObject.

Definition at line 733 of file dof_object.h.

References libMesh::DofObject::processor_id().

734 {
735  this->processor_id() = pid;
736 }
processor_id_type processor_id() const
Definition: dof_object.h:717

◆ qual_bounds()

virtual std::pair<Real,Real> libMesh::Elem::qual_bounds ( const ElemQuality  ) const
inlinevirtualinherited
Returns
The suggested quality bounds for the Elem based on quality measure q.

These are the values suggested by the CUBIT User's Manual. Since this function can have no possible meaning for an abstract Elem, it is an error in the base class.

Reimplemented in libMesh::InfQuad, libMesh::Quad, libMesh::InfHex, libMesh::Tri, libMesh::Hex, and libMesh::Tet.

Definition at line 948 of file elem.h.

949  { libmesh_not_implemented(); return std::make_pair(0.,0.); }

◆ quality()

Real libMesh::Elem::quality ( const ElemQuality  q) const
virtualinherited
Returns
A quantitative assessment of element quality based on the quality metric q specified by the user.

I don't know what to do for this metric.

Reimplemented in libMesh::InfQuad, libMesh::Quad, libMesh::InfHex, libMesh::Tri, libMesh::Hex, and libMesh::Tet.

Definition at line 1403 of file elem.C.

References libMesh::Utility::enum_to_string(), and libMesh::err.

Referenced by libMesh::Tet::quality(), libMesh::Hex::quality(), libMesh::Tri::quality(), libMesh::InfHex::quality(), and libMesh::Quad::quality().

1404 {
1405  switch (q)
1406  {
1410  default:
1411  {
1412  libmesh_do_once( libmesh_here();
1413 
1414  libMesh::err << "ERROR: unknown quality metric: "
1416  << std::endl
1417  << "Cowardly returning 1."
1418  << std::endl; );
1419 
1420  return 1.;
1421  }
1422  }
1423 }
OStreamProxy err(std::cerr)
std::string enum_to_string(const T e)

◆ raw_child_ptr()

const Elem * libMesh::Elem::raw_child_ptr ( unsigned int  i) const
inlineinherited
Returns
A constant pointer to the $ i^{th} $ child for this element. For internal use only - skips assertions about null pointers.

Definition at line 2569 of file elem.h.

References libMesh::Elem::_children.

Referenced by libMesh::CheckpointIO::read_remote_elem().

2570 {
2571  if (!_children)
2572  return nullptr;
2573 
2574  return _children[i];
2575 }
Elem ** _children
Definition: elem.h:1707

◆ reference_elem()

const Elem * libMesh::Elem::reference_elem ( ) const
inherited
Returns
A pointer to the "reference element" associated with this element. The reference element is the image of this element in reference parametric space. Importantly, it is not an actual element in the mesh, but rather a Singleton-type object, so for example all Quad4 elements share the same reference_elem().

Definition at line 337 of file elem.C.

References libMesh::ReferenceElem::get(), and libMesh::Elem::type().

Referenced by libMesh::QComposite< QSubCell >::init().

338 {
339  return &(ReferenceElem::get(this->type()));
340 }
virtual ElemType type() const =0
const Elem & get(const ElemType type_in)

◆ refine()

void libMesh::Elem::refine ( MeshRefinement mesh_refinement)
virtualinherited

Refine the element.

The following functions only apply when AMR is enabled and thus are not present otherwise.

Definition at line 41 of file elem_refinement.C.

References libMesh::Elem::_children, libMesh::Elem::active(), libMesh::MeshRefinement::add_elem(), libMesh::MeshRefinement::add_node(), libMesh::Elem::ancestor(), libMesh::Elem::build(), libMesh::Elem::child_ptr(), libMesh::Elem::INACTIVE, libMesh::Elem::JUST_REFINED, libMesh::Elem::n_children(), libMesh::Elem::n_nodes(), libMesh::DofObject::n_systems(), libMesh::Elem::node(), libMesh::Elem::p_level(), libMesh::Elem::p_refinement_flag(), libMesh::Elem::parent(), libMesh::DofObject::processor_id(), libMesh::Elem::REFINE, libMesh::Elem::refinement_flag(), libMesh::DofObject::set_n_systems(), libMesh::Elem::set_node(), libMesh::Elem::set_p_level(), libMesh::Elem::set_p_refinement_flag(), libMesh::Elem::set_refinement_flag(), libMesh::Elem::subactive(), and libMesh::Elem::type().

42 {
43  libmesh_assert_equal_to (this->refinement_flag(), Elem::REFINE);
44  libmesh_assert (this->active());
45 
46  const unsigned int nc = this->n_children();
47 
48  // Create my children if necessary
49  if (!_children)
50  {
51  _children = new Elem *[nc];
52 
53  unsigned int parent_p_level = this->p_level();
54  for (unsigned int c = 0; c != nc; c++)
55  {
56  _children[c] = Elem::build(this->type(), this).release();
57  Elem * current_child = this->child_ptr(c);
58 
59  current_child->set_refinement_flag(Elem::JUST_REFINED);
60  current_child->set_p_level(parent_p_level);
61  current_child->set_p_refinement_flag(this->p_refinement_flag());
62 
63  for (unsigned int cnode=0; cnode != current_child->n_nodes(); ++cnode)
64  {
65  Node * node =
66  mesh_refinement.add_node(*this, c, cnode,
67  current_child->processor_id());
68  node->set_n_systems (this->n_systems());
69  current_child->set_node(cnode) = node;
70  }
71 
72  mesh_refinement.add_elem (current_child);
73  current_child->set_n_systems(this->n_systems());
74  }
75  }
76  else
77  {
78  unsigned int parent_p_level = this->p_level();
79  for (unsigned int c = 0; c != nc; c++)
80  {
81  Elem * current_child = this->child_ptr(c);
82  libmesh_assert(current_child->subactive());
83  current_child->set_refinement_flag(Elem::JUST_REFINED);
84  current_child->set_p_level(parent_p_level);
85  current_child->set_p_refinement_flag(this->p_refinement_flag());
86  }
87  }
88 
89  // Un-set my refinement flag now
91 
92  // Leave the p refinement flag set - we will need that later to get
93  // projection operations correct
94  // this->set_p_refinement_flag(Elem::INACTIVE);
95 
96  for (unsigned int c = 0; c != nc; c++)
97  {
98  libmesh_assert_equal_to (this->child_ptr(c)->parent(), this);
99  libmesh_assert(this->child_ptr(c)->active());
100  }
101  libmesh_assert (this->ancestor());
102 }
RefinementState refinement_flag() const
Definition: elem.h:2638
const Elem * parent() const
Definition: elem.h:2479
RefinementState p_refinement_flag() const
Definition: elem.h:2654
void set_refinement_flag(const RefinementState rflag)
Definition: elem.h:2646
virtual unsigned int n_children() const =0
unsigned int p_level() const
Definition: elem.h:2555
dof_id_type node(const unsigned int i) const
Definition: elem.h:1927
bool ancestor() const
Definition: elem.C:1427
static std::unique_ptr< Elem > build(const ElemType type, Elem *p=nullptr)
Definition: elem.C:245
unsigned int n_systems() const
Definition: dof_object.h:749
Elem ** _children
Definition: elem.h:1707
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1811
bool active() const
Definition: elem.h:2390
virtual ElemType type() const =0
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2578

◆ refinement_flag()

◆ remove_links_to_me()

void libMesh::Elem::remove_links_to_me ( )
inherited

Resets this element's neighbors' appropriate neighbor pointers and its parent's and children's appropriate pointers to point to null instead of to this.

Used by the library before an element is deleted from a mesh.

Definition at line 1260 of file elem.C.

References libMesh::Elem::has_children(), libMesh::Elem::level(), libMesh::Elem::n_neighbors(), libMesh::Elem::neighbor_ptr(), libMesh::Elem::neighbor_ptr_range(), libMesh::Elem::parent(), libMesh::remote_elem, libMesh::Elem::set_neighbor(), libMesh::Elem::subactive(), and libMesh::Elem::which_neighbor_am_i().

1261 {
1262  libmesh_assert_not_equal_to (this, remote_elem);
1263 
1264  // We need to have handled any children first
1265 #ifdef LIBMESH_ENABLE_AMR
1266  libmesh_assert (!this->has_children());
1267 #endif
1268 
1269  // Nullify any neighbor links
1270  for (auto neigh : this->neighbor_ptr_range())
1271  {
1272  if (neigh && neigh != remote_elem)
1273  {
1274  // My neighbor should never be more refined than me; my real
1275  // neighbor would have been its parent in that case.
1276  libmesh_assert_greater_equal (this->level(), neigh->level());
1277 
1278  if (this->level() == neigh->level() &&
1279  neigh->has_neighbor(this))
1280  {
1281 #ifdef LIBMESH_ENABLE_AMR
1282  // My neighbor may have descendants which also consider me a
1283  // neighbor
1284  std::vector<const Elem *> family;
1285  neigh->total_family_tree_by_neighbor (family, this);
1286 
1287  // FIXME - There's a lot of ugly const_casts here; we
1288  // may want to make remote_elem non-const and create
1289  // non-const versions of the family_tree methods
1290  for (auto & const_elem : family)
1291  {
1292  Elem * n = const_cast<Elem *>(const_elem);
1293  libmesh_assert (n);
1294  if (n == remote_elem)
1295  continue;
1296  unsigned int my_s = n->which_neighbor_am_i(this);
1297  libmesh_assert_less (my_s, n->n_neighbors());
1298  libmesh_assert_equal_to (n->neighbor_ptr(my_s), this);
1299  n->set_neighbor(my_s, nullptr);
1300  }
1301 #else
1302  unsigned int my_s = neigh->which_neighbor_am_i(this);
1303  libmesh_assert_less (my_s, neigh->n_neighbors());
1304  libmesh_assert_equal_to (neigh->neighbor(my_s), this);
1305  neigh->set_neighbor(my_s, nullptr);
1306 #endif
1307  }
1308 #ifdef LIBMESH_ENABLE_AMR
1309  // Even if my neighbor doesn't link back to me, it might
1310  // have subactive descendants which do
1311  else if (neigh->has_children())
1312  {
1313  // If my neighbor at the same level doesn't have me as a
1314  // neighbor, I must be subactive
1315  libmesh_assert(this->level() > neigh->level() ||
1316  this->subactive());
1317 
1318  // My neighbor must have some ancestor of mine as a
1319  // neighbor
1320  Elem * my_ancestor = this->parent();
1321  libmesh_assert(my_ancestor);
1322  while (!neigh->has_neighbor(my_ancestor))
1323  {
1324  my_ancestor = my_ancestor->parent();
1325  libmesh_assert(my_ancestor);
1326  }
1327 
1328  // My neighbor may have descendants which consider me a
1329  // neighbor
1330  std::vector<const Elem *> family;
1331  neigh->total_family_tree_by_subneighbor (family, my_ancestor, this);
1332 
1333  // FIXME - There's a lot of ugly const_casts here; we
1334  // may want to make remote_elem non-const and create
1335  // non-const versions of the family_tree methods
1336  for (auto & const_elem : family)
1337  {
1338  Elem * n = const_cast<Elem *>(const_elem);
1339  libmesh_assert (n);
1340  if (n == remote_elem)
1341  continue;
1342  unsigned int my_s = n->which_neighbor_am_i(this);
1343  libmesh_assert_less (my_s, n->n_neighbors());
1344  libmesh_assert_equal_to (n->neighbor_ptr(my_s), this);
1345  n->set_neighbor(my_s, nullptr);
1346  }
1347  }
1348 #endif
1349  }
1350  }
1351 
1352 #ifdef LIBMESH_ENABLE_AMR
1353  // We can't currently delete a child with a parent!
1354  libmesh_assert (!this->parent());
1355 #endif
1356 }
const Elem * parent() const
Definition: elem.h:2479
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1811
unsigned int level() const
Definition: elem.h:2521
bool subactive() const
Definition: elem.h:2408
SimpleRange< NeighborPtrIter > neighbor_ptr_range()
Definition: elem.h:2988
bool has_children() const
Definition: elem.h:2428
const RemoteElem * remote_elem
Definition: remote_elem.C:57

◆ replace_child()

void libMesh::Elem::replace_child ( Elem elem,
unsigned int  c 
)
inherited

Replaces the child pointer at the specified index in the child array.

Definition at line 1507 of file elem.C.

References libMesh::Elem::child_ptr(), libMesh::Elem::has_children(), and libMesh::Elem::set_child().

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

1508 {
1509  libmesh_assert(this->has_children());
1510 
1511  libmesh_assert(this->child_ptr(c));
1512 
1513  this->set_child(c, elem);
1514 }
void set_child(unsigned int c, Elem *elem)
Definition: elem.h:2610
bool has_children() const
Definition: elem.h:2428
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2578

◆ second_order_adjacent_vertex()

unsigned short int libMesh::Elem::second_order_adjacent_vertex ( const unsigned int  n,
const unsigned int  v 
) const
virtualinherited
Returns
The element-local number of the $ v^{th} $ vertex that defines the $ n^{th} $ second-order node, or 0 for linear elements.
Note
The value is always less than this->n_vertices(), while n has to be greater than or equal to this->n_vertices().

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

Definition at line 2566 of file elem.C.

Referenced by libMesh::MeshTools::Modification::smooth().

2568 {
2569  // for linear elements, always return 0
2570  return 0;
2571 }

◆ second_order_child_vertex()

std::pair< unsigned short int, unsigned short int > libMesh::Elem::second_order_child_vertex ( const unsigned int  n) const
virtualinherited
Returns
A pair (c,v), where c == child index, and v == element-local index of the $ n^{th} $ second-order node on the parent element. For linear elements, (0,0) is returned.
Note
The return values are always less than this->n_children() and this->child_ptr(c)->n_vertices().
n has to be greater than or equal to this->n_vertices().
On refined second-order elements, the return value will satisfy this->node_ptr(n) == this->child_ptr(c)->node_ptr(v).

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

Definition at line 2576 of file elem.C.

2577 {
2578  // for linear elements, always return 0
2579  return std::pair<unsigned short int, unsigned short int>(0,0);
2580 }

◆ second_order_equivalent_type()

ElemType libMesh::Elem::second_order_equivalent_type ( const ElemType  et,
const bool  full_ordered = true 
)
staticinherited
Returns
The element type of the associated second-order element, or INVALID_ELEM for second-order or other elements that cannot be converted into higher order equivalents.

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

For some elements, there exist two second-order equivalents, e.g. for Quad4 there is Quad8 and Quad9. When the optional full_ordered is true, then QUAD9 is returned. When full_ordered is false, then QUAD8 is returned.

Definition at line 2643 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::INVALID_ELEM, libMesh::PRISM15, libMesh::PRISM18, libMesh::PRISM6, libMesh::PYRAMID13, libMesh::PYRAMID14, libMesh::PYRAMID5, libMesh::QUAD4, libMesh::QUAD8, libMesh::QUAD9, libMesh::QUADSHELL4, libMesh::QUADSHELL8, libMesh::TET10, libMesh::TET4, libMesh::TRI3, and libMesh::TRI6.

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

2645 {
2646  /* for second-order elements, always return \p INVALID_ELEM
2647  * since second-order elements should not be converted
2648  * into something else. Only linear elements should
2649  * return something sensible here
2650  */
2651  switch (et)
2652  {
2653  case EDGE2:
2654  case EDGE3:
2655  {
2656  // full_ordered not relevant
2657  return EDGE3;
2658  }
2659 
2660  case EDGE4:
2661  {
2662  // full_ordered not relevant
2663  return EDGE4;
2664  }
2665 
2666  case TRI3:
2667  case TRI6:
2668  {
2669  // full_ordered not relevant
2670  return TRI6;
2671  }
2672 
2673  case QUAD4:
2674  case QUAD8:
2675  {
2676  if (full_ordered)
2677  return QUAD9;
2678  else
2679  return QUAD8;
2680  }
2681 
2682  case QUADSHELL4:
2683  case QUADSHELL8:
2684  {
2685  if (full_ordered)
2686  libmesh_error();
2687  else
2688  return QUADSHELL8;
2689  }
2690 
2691  case QUAD9:
2692  {
2693  // full_ordered not relevant
2694  return QUAD9;
2695  }
2696 
2697  case TET4:
2698  case TET10:
2699  {
2700  // full_ordered not relevant
2701  return TET10;
2702  }
2703 
2704  case HEX8:
2705  case HEX20:
2706  {
2707  // see below how this correlates with INFHEX8
2708  if (full_ordered)
2709  return HEX27;
2710  else
2711  return HEX20;
2712  }
2713 
2714  case HEX27:
2715  {
2716  // full_ordered not relevant
2717  return HEX27;
2718  }
2719 
2720  case PRISM6:
2721  case PRISM15:
2722  {
2723  if (full_ordered)
2724  return PRISM18;
2725  else
2726  return PRISM15;
2727  }
2728 
2729  case PRISM18:
2730  {
2731  // full_ordered not relevant
2732  return PRISM18;
2733  }
2734 
2735  case PYRAMID5:
2736  case PYRAMID13:
2737  {
2738  if (full_ordered)
2739  return PYRAMID14;
2740  else
2741  return PYRAMID13;
2742  }
2743 
2744  case PYRAMID14:
2745  {
2746  // full_ordered not relevant
2747  return PYRAMID14;
2748  }
2749 
2750 
2751 
2752 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
2753 
2754  // infinite elements
2755  case INFEDGE2:
2756  {
2757  return INVALID_ELEM;
2758  }
2759 
2760  case INFQUAD4:
2761  case INFQUAD6:
2762  {
2763  // full_ordered not relevant
2764  return INFQUAD6;
2765  }
2766 
2767  case INFHEX8:
2768  case INFHEX16:
2769  {
2770  /*
2771  * Note that this matches with \p Hex8:
2772  * For full-ordered, \p InfHex18 and \p Hex27
2773  * belong together, and for not full-ordered,
2774  * \p InfHex16 and \p Hex20 belong together.
2775  */
2776  if (full_ordered)
2777  return INFHEX18;
2778  else
2779  return INFHEX16;
2780  }
2781 
2782  case INFHEX18:
2783  {
2784  // full_ordered not relevant
2785  return INFHEX18;
2786  }
2787 
2788  case INFPRISM6:
2789  case INFPRISM12:
2790  {
2791  // full_ordered not relevant
2792  return INFPRISM12;
2793  }
2794 
2795 #endif
2796 
2797 
2798  default:
2799  {
2800  // what did we miss?
2801  libmesh_error();
2802  }
2803  }
2804 }

◆ set_buffer()

void libMesh::DofObject::set_buffer ( const std::vector< dof_id_type > &  buf)
inlineinherited

Definition at line 535 of file dof_object.h.

References libMesh::DofObject::_idx_buf.

536  { _idx_buf = buf; }
index_buffer_t _idx_buf
Definition: dof_object.h:508

◆ set_dof_number()

void libMesh::DofObject::set_dof_number ( const unsigned int  s,
const unsigned int  var,
const unsigned int  comp,
const dof_id_type  dn 
)
inherited

Sets the global degree of freedom number for variable var, component comp for system s associated with this DofObject

Definition at line 409 of file dof_object.C.

References libMesh::DofObject::_idx_buf, libMesh::DofObject::dof_number(), 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().

413 {
414  libmesh_assert_less (s, this->n_systems());
415  libmesh_assert_less (var, this->n_vars(s));
416  libmesh_assert_less (comp, this->n_comp(s,var));
417 
418  const unsigned int
419  vg = this->var_to_vg(s,var),
420 #ifndef NDEBUG
421  ncg = this->n_comp_group(s,vg),
422 #endif
423  vig = this->system_var_to_vg_var(s,vg,var),
424  start_idx_sys = this->start_idx(s);
425 
426  libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());
427 
428  dof_id_type & base_idx = _idx_buf[start_idx_sys + 2*vg + 1];
429 
430  // We intend to change all dof numbers together or not at all
431  if (comp || vig)
432  libmesh_assert ((dn == invalid_id && base_idx == invalid_id) ||
433  (dn == base_idx + vig*ncg + comp));
434 
435  // only explicitly store the base index for vig==0, comp==0
436  else
437  base_idx = dn;
438 
439  libmesh_assert_equal_to (this->dof_number(s, var, comp), dn);
440 }
unsigned int system_var_to_vg_var(const unsigned int s, const unsigned int vg, const unsigned int var) const
Definition: dof_object.h:1022
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
Definition: dof_object.h:833
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:803
unsigned int var_to_vg(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:1004
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:768
unsigned int n_systems() const
Definition: dof_object.h:749
static const dof_id_type invalid_id
Definition: dof_object.h:347
unsigned int start_idx(const unsigned int s) const
Definition: dof_object.h:936
index_buffer_t _idx_buf
Definition: dof_object.h:508
unsigned int n_comp_group(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:816
uint8_t dof_id_type
Definition: id_types.h:64

◆ set_id() [1/2]

dof_id_type & libMesh::DofObject::set_id ( )
inlineinherited
Returns
The id for this DofObject as a writable reference.

Definition at line 664 of file dof_object.h.

References libMesh::DofObject::_id.

Referenced by libMesh::GMVIO::_read_one_cell(), libMesh::ReplicatedMesh::add_elem(), libMesh::DistributedMesh::add_elem(), libMesh::ReplicatedMesh::add_node(), libMesh::DistributedMesh::add_node(), libMesh::UnstructuredMesh::all_first_order(), libMesh::MeshTools::Subdivision::all_subdivision(), libMesh::MeshTools::Generation::build_cube(), libMesh::MeshTools::Generation::build_extrusion(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::UnstructuredMesh::create_submesh(), libMesh::UNVIO::elements_in(), libMesh::MeshTools::Modification::flatten(), libMesh::DofObject::invalidate_id(), libMesh::Node::Node(), libMesh::DistributedMesh::own_node(), libMesh::Nemesis_IO::read(), libMesh::ExodusII_IO::read(), libMesh::VTKIO::read(), libMesh::CheckpointIO::read_connectivity(), libMesh::UCDIO::read_implementation(), libMesh::GmshIO::read_mesh(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::OFFIO::read_stream(), libMesh::MatlabIO::read_stream(), libMesh::RemoteElem::RemoteElem(), libMesh::ReplicatedMesh::renumber_elem(), libMesh::DistributedMesh::renumber_elem(), libMesh::ReplicatedMesh::renumber_node(), libMesh::DistributedMesh::renumber_node(), libMesh::ReplicatedMesh::renumber_nodes_and_elements(), libMesh::DofObject::set_id(), and libMesh::Parallel::Packing< T >::unpack().

665 {
666  return _id;
667 }
dof_id_type _id
Definition: dof_object.h:442

◆ set_id() [2/2]

void libMesh::DofObject::set_id ( const dof_id_type  dofid)
inlineinherited

Sets the id for this DofObject

Definition at line 151 of file dof_object.h.

References libMesh::DofObject::set_id().

152  { this->set_id() = dofid; }
dof_id_type & set_id()
Definition: dof_object.h:664

◆ set_interior_parent()

void libMesh::Elem::set_interior_parent ( Elem p)
inherited

Sets the pointer to the element's interior_parent. Dangerous! Only use this if you know what you are doing!

Definition at line 856 of file elem.C.

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

Referenced by libMesh::BoundaryInfo::add_elements(), libMesh::Edge::Edge(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::Hex::Hex(), libMesh::InfHex::InfHex(), libMesh::InfQuad::InfQuad(), libMesh::NodeElem::NodeElem(), libMesh::Prism::Prism(), Pyramid(), libMesh::Quad::Quad(), libMesh::Tet::Tet(), libMesh::Tri::Tri(), and libMesh::Parallel::Packing< T >::unpack().

857 {
858  // interior parents make no sense for full-dimensional elements.
859  libmesh_assert_less (this->dim(), LIBMESH_DIM);
860 
861  // If we have an interior_parent, we USED TO assume it was a
862  // one-higher-dimensional interior element, but we now allow e.g.
863  // edge elements to have a 3D interior_parent with no
864  // intermediate 2D element.
865  // libmesh_assert (!p ||
866  // p->dim() == (this->dim()+1));
867  libmesh_assert (!p ||
868  (p == remote_elem) ||
869  (p->dim() > this->dim()));
870 
871  _elemlinks[1+this->n_sides()] = p;
872 }
Elem ** _elemlinks
Definition: elem.h:1701
virtual unsigned int n_sides() const =0
virtual unsigned short dim() const =0
const RemoteElem * remote_elem
Definition: remote_elem.C:57

◆ set_n_comp()

void libMesh::DofObject::set_n_comp ( const unsigned int  s,
const unsigned int  var,
const unsigned int  ncomp 
)
inherited

Sets the number of components for Variable var of system s associated with this DofObject

Definition at line 340 of file dof_object.C.

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

343 {
344  libmesh_assert_less (s, this->n_systems());
345  libmesh_assert_less (var, this->n_vars(s));
346 
347  this->set_n_comp_group(s, this->var_to_vg(s,var), ncomp);
348 }
unsigned int var_to_vg(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:1004
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:768
unsigned int n_systems() const
Definition: dof_object.h:749
void set_n_comp_group(const unsigned int s, const unsigned int vg, const unsigned int ncomp)
Definition: dof_object.C:352

◆ set_n_comp_group()

void libMesh::DofObject::set_n_comp_group ( const unsigned int  s,
const unsigned int  vg,
const unsigned int  ncomp 
)
inherited

Sets the number of components for VariableGroup vg of system s associated with this DofObject

Definition at line 352 of file dof_object.C.

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

Referenced by libMesh::DofMap::reinit(), libMesh::DofObject::set_n_comp(), libMesh::DofObject::set_n_vars_per_group(), and libMesh::DofMap::set_nonlocal_dof_objects().

355 {
356  libmesh_assert_less (s, this->n_systems());
357  libmesh_assert_less (vg, this->n_var_groups(s));
358 
359  // Check for trivial return
360  if (ncomp == this->n_comp_group(s,vg)) return;
361 
362 #ifndef NDEBUG
363  if (ncomp >= ncv_magic)
364  {
365  const index_t ncvm = ncv_magic;
366  libmesh_error_msg("ERROR: ncomp must be less than DofObject::ncv_magic!\n" \
367  << "ncomp = " \
368  << ncomp \
369  << ", ncv_magic = " \
370  << ncvm \
371  << "\nrecompile and try again!");
372  }
373 #endif
374 
375  const unsigned int
376  start_idx_sys = this->start_idx(s),
377  n_vars_group = this->n_vars(s,vg),
378  base_offset = start_idx_sys + 2*vg;
379 
380  libmesh_assert_less ((base_offset + 1), _idx_buf.size());
381 
382  // if (ncomp)
383  // libMesh::out << "s,vg,ncomp="
384  // << s << ","
385  // << vg << ","
386  // << ncomp << '\n';
387 
388  // set the number of components, maintaining the number
389  // of variables in the group
390  _idx_buf[base_offset] = ncv_magic*n_vars_group + ncomp;
391 
392  // We use (invalid_id - 1) to signify no
393  // components for this object
394  _idx_buf[base_offset + 1] = (ncomp == 0) ? invalid_id - 1 : invalid_id;
395 
396  // this->debug_buffer();
397  // libMesh::out << "s,vg = " << s << "," << vg << '\n'
398  // << "base_offset=" << base_offset << '\n'
399  // << "this->n_comp(s,vg)=" << this->n_comp(s,vg) << '\n'
400  // << "this->n_comp_group(s,vg)=" << this->n_comp_group(s,vg) << '\n'
401  // << "this->n_vars(s,vg)=" << this->n_vars(s,vg) << '\n'
402  // << "this->n_var_groups(s)=" << this->n_var_groups(s) << '\n';
403 
404  libmesh_assert_equal_to (ncomp, this->n_comp_group(s,vg));
405 }
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:758
dof_id_type index_t
Definition: dof_object.h:506
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:768
unsigned int n_systems() const
Definition: dof_object.h:749
static const dof_id_type invalid_id
Definition: dof_object.h:347
unsigned int start_idx(const unsigned int s) const
Definition: dof_object.h:936
index_buffer_t _idx_buf
Definition: dof_object.h:508
unsigned int n_comp_group(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:816
static const index_t ncv_magic
Definition: dof_object.h:519

◆ set_n_systems()

void libMesh::DofObject::set_n_systems ( const unsigned int  s)
inherited

Sets the number of systems for this DofObject

Definition at line 165 of file dof_object.C.

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

Referenced by libMesh::DofObject::add_system(), and libMesh::Elem::refine().

166 {
167  // Check for trivial return
168  if (ns == this->n_systems())
169  return;
170 
171  // Clear any existing data. This is safe to call
172  // even if we don't have any data.
173  this->clear_dofs();
174 
175  // Set the new number of systems
176  _idx_buf.resize(ns, ns);
177  _idx_buf[0] = ns;
178 
179 
180 #ifdef DEBUG
181 
182  // check that all systems now exist and that they have 0 size
183  libmesh_assert_equal_to (ns, this->n_systems());
184  for (unsigned int s=0; s<this->n_systems(); s++)
185  {
186  libmesh_assert_equal_to (this->n_vars(s), 0);
187  libmesh_assert_equal_to (this->n_var_groups(s), 0);
188  }
189 
190 #endif
191 }
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:758
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:768
unsigned int n_systems() const
Definition: dof_object.h:749
index_buffer_t _idx_buf
Definition: dof_object.h:508

◆ set_n_vars_per_group()

void libMesh::DofObject::set_n_vars_per_group ( const unsigned int  s,
const std::vector< unsigned int > &  nvpg 
)
inherited

Sets number of variables in each group associated with system s for this DofObject. Implicit in this is also setting the number of VariableGroup variable groups for the system. Has the effect of setting the number of components to 0 even when called even with (nvg == this->n_var_groups(s)).

Definition at line 227 of file dof_object.C.

References libMesh::DofObject::_idx_buf, end, libMesh::DofObject::end_idx(), libMesh::DofObject::invalid_id, libMesh::DofObject::n_comp(), libMesh::DofObject::n_comp_group(), libMesh::DofObject::n_systems(), libMesh::DofObject::n_var_groups(), libMesh::DofObject::n_vars(), libMesh::DofObject::ncv_magic, libMesh::DofObject::set_n_comp_group(), and libMesh::DofObject::start_idx().

229 {
230 
231  libmesh_assert_less (s, this->n_systems());
232 
233  // number of variable groups for this system - inferred
234  const unsigned int nvg = cast_int<unsigned int>(nvpg.size());
235 
236  // BSK - note that for compatibility with the previous implementation
237  // calling this method when (nvars == this->n_vars()) requires that
238  // we invalidate the DOF indices and set the number of components to 0.
239  // Note this was a bit of a surprise to me - there was no quick return in
240  // the old method, which caused removal and readdition of the DOF indices
241  // even in the case of (nvars == this->n_vars()), resulting in n_comp(s,v)
242  // implicitly becoming 0 regardless of any previous value.
243  // quick return?
244  if (nvg == this->n_var_groups(s))
245  {
246  for (unsigned int vg=0; vg<nvg; vg++)
247  {
248  this->set_n_comp_group(s,vg,0);
249  libmesh_assert_equal_to (this->n_vars(s,vg), nvpg[vg]);
250  }
251  return;
252  }
253 
254  // since there is ample opportunity to screw up other systems, let us
255  // cache their current sizes and later assert that they are unchanged.
256 #ifdef DEBUG
257  DofObject::index_buffer_t old_system_sizes;
258  old_system_sizes.reserve(this->n_systems());
259 
260  for (unsigned int s_ctr=0; s_ctr<this->n_systems(); s_ctr++)
261  old_system_sizes.push_back(this->n_var_groups(s_ctr));
262 #endif
263 
264  // remove current indices if we have some
265  if (this->n_var_groups(s) != 0)
266  {
267  const unsigned int old_nvg_s = this->n_var_groups(s);
268 
269  DofObject::index_buffer_t::iterator
270  it = _idx_buf.begin(),
271  end = _idx_buf.begin();
272 
273  std::advance(it, this->start_idx(s));
274  std::advance(end, this->end_idx(s));
275  _idx_buf.erase(it,end);
276 
277  for (unsigned int ctr=(s+1); ctr<this->n_systems(); ctr++)
278  _idx_buf[ctr] -= 2*old_nvg_s;
279  }
280 
281  // better not have any now!
282  libmesh_assert_equal_to (this->n_var_groups(s), 0);
283 
284  // Make sure we didn't screw up any of our sizes!
285 #ifdef DEBUG
286  for (unsigned int s_ctr=0; s_ctr<this->n_systems(); s_ctr++)
287  if (s_ctr != s)
288  libmesh_assert_equal_to (this->n_var_groups(s_ctr), old_system_sizes[s_ctr]);
289 #endif
290 
291  // OK, if the user requested 0 that is what we have
292  if (nvg == 0)
293  return;
294 
295  {
296  // array to hold new indices
297  DofObject::index_buffer_t var_idxs(2*nvg);
298  for (unsigned int vg=0; vg<nvg; vg++)
299  {
300  var_idxs[2*vg ] = ncv_magic*nvpg[vg] + 0;
301  var_idxs[2*vg + 1] = invalid_id - 1;
302  }
303 
304  DofObject::index_buffer_t::iterator it = _idx_buf.begin();
305  std::advance(it, this->end_idx(s));
306  _idx_buf.insert(it, var_idxs.begin(), var_idxs.end());
307 
308  for (unsigned int ctr=(s+1); ctr<this->n_systems(); ctr++)
309  _idx_buf[ctr] += 2*nvg;
310 
311  // resize _idx_buf to fit so no memory is wasted.
313  }
314 
315  libmesh_assert_equal_to (nvg, this->n_var_groups(s));
316 
317 #ifdef DEBUG
318 
319  libmesh_assert_equal_to (this->n_var_groups(s), nvpg.size());
320 
321  for (unsigned int vg=0; vg<this->n_var_groups(s); vg++)
322  {
323  libmesh_assert_equal_to (this->n_vars(s,vg), nvpg[vg]);
324  libmesh_assert_equal_to (this->n_comp_group(s,vg), 0);
325  }
326 
327  for (unsigned int v=0; v<this->n_vars(s); v++)
328  libmesh_assert_equal_to (this->n_comp(s,v), 0);
329 
330  // again, all other system sizes should be unchanged!
331  for (unsigned int s_ctr=0; s_ctr<this->n_systems(); s_ctr++)
332  if (s_ctr != s)
333  libmesh_assert_equal_to (this->n_var_groups(s_ctr), old_system_sizes[s_ctr]);
334 
335 #endif
336 }
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:803
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:758
IterBase * end
unsigned int end_idx(const unsigned int s) const
Definition: dof_object.h:947
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:768
unsigned int n_systems() const
Definition: dof_object.h:749
static const dof_id_type invalid_id
Definition: dof_object.h:347
std::vector< index_t > index_buffer_t
Definition: dof_object.h:507
void set_n_comp_group(const unsigned int s, const unsigned int vg, const unsigned int ncomp)
Definition: dof_object.C:352
unsigned int start_idx(const unsigned int s) const
Definition: dof_object.h:936
index_buffer_t _idx_buf
Definition: dof_object.h:508
unsigned int n_comp_group(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:816
static const index_t ncv_magic
Definition: dof_object.h:519

◆ set_neighbor()

◆ set_node()

Node *& libMesh::Elem::set_node ( const unsigned int  i)
inlinevirtualinherited

◆ set_old_dof_object()

void libMesh::DofObject::set_old_dof_object ( )
inherited

Sets the old_dof_object to a copy of this

Definition at line 150 of file dof_object.C.

References libMesh::DofObject::clear_old_dof_object(), libMesh::DofObject::DofObject(), and libMesh::DofObject::old_dof_object.

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

151 {
152  this->clear_old_dof_object();
153 
154  libmesh_assert (!this->old_dof_object);
155 
156  // Make a new DofObject, assign a copy of \p this.
157  // Make sure the copy ctor for DofObject works!!
158  this->old_dof_object = new DofObject(*this);
159 }
void clear_old_dof_object()
Definition: dof_object.C:142
DofObject * old_dof_object
Definition: dof_object.h:79

◆ set_p_level()

void libMesh::Elem::set_p_level ( const unsigned int  p)
inlineinherited

Sets the value of the p-refinement level for the element.

Note
The maximum p-refinement level is currently 255.

Definition at line 2692 of file elem.h.

References libMesh::Elem::_p_level, libMesh::Elem::child_ref_range(), libMesh::Elem::JUST_COARSENED, libMesh::Elem::JUST_REFINED, std::min(), libMesh::Elem::p_level(), libMesh::Elem::parent(), libMesh::Elem::set_p_level(), and libMesh::Elem::set_p_refinement_flag().

Referenced by libMesh::UnstructuredMesh::all_first_order(), libMesh::Elem::coarsen(), libMesh::Elem::Elem(), libMesh::Elem::refine(), libMesh::Elem::set_p_level(), and libMesh::Parallel::Packing< T >::unpack().

2693 {
2694  // Maintain the parent's p level as the minimum of it's children
2695  if (this->parent() != nullptr)
2696  {
2697  unsigned int parent_p_level = this->parent()->p_level();
2698 
2699  // If our new p level is less than our parents, our parents drops
2700  if (parent_p_level > p)
2701  {
2702  this->parent()->set_p_level(p);
2703 
2704  // And we should keep track of the drop, in case we need to
2705  // do a projection later.
2707  }
2708  // If we are the lowest p level and it increases, so might
2709  // our parent's, but we have to check every other child to see
2710  else if (parent_p_level == _p_level && _p_level < p)
2711  {
2712  _p_level = cast_int<unsigned char>(p);
2713  parent_p_level = cast_int<unsigned char>(p);
2714  for (auto & c : this->parent()->child_ref_range())
2715  parent_p_level = std::min(parent_p_level,
2716  c.p_level());
2717 
2718  // When its children all have a higher p level, the parent's
2719  // should rise
2720  if (parent_p_level > this->parent()->p_level())
2721  {
2722  this->parent()->set_p_level(parent_p_level);
2723 
2724  // And we should keep track of the rise, in case we need to
2725  // do a projection later.
2727  }
2728 
2729  return;
2730  }
2731  }
2732 
2733  _p_level = cast_int<unsigned char>(p);
2734 }
void set_p_level(const unsigned int p)
Definition: elem.h:2692
const Elem * parent() const
Definition: elem.h:2479
unsigned char _p_level
Definition: elem.h:1736
unsigned int p_level() const
Definition: elem.h:2555
SimpleRange< ChildRefIter > child_ref_range()
Definition: elem.h:1779
void set_p_refinement_flag(const RefinementState pflag)
Definition: elem.h:2662
long double min(long double a, double b)

◆ set_p_refinement_flag()

◆ set_parent()

void libMesh::Elem::set_parent ( Elem p)
inlineinherited

Sets the pointer to the element's parent. Dangerous! Only use this if you know what you are doing!

Definition at line 2495 of file elem.h.

References libMesh::Elem::_elemlinks.

Referenced by libMesh::BoundaryInfo::add_elements(), and libMesh::UnstructuredMesh::all_first_order().

2496 {
2497  _elemlinks[0] = p;
2498 }
Elem ** _elemlinks
Definition: elem.h:1701

◆ set_refinement_flag()

◆ set_unique_id()

◆ set_vg_dof_base()

void libMesh::DofObject::set_vg_dof_base ( const unsigned int  s,
const unsigned int  vg,
const dof_id_type  db 
)
inlineinherited

VariableGroup DoF indices are indexed as id = base + var_in_vg*ncomp + comp This method allows for direct access to the base.

Definition at line 960 of file dof_object.h.

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

Referenced by libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::DofObject::invalidate_dofs(), libMesh::DofMap::reinit(), and libMesh::DofMap::set_nonlocal_dof_objects().

963 {
964  libmesh_assert_less (s, this->n_systems());
965  libmesh_assert_less (vg, this->n_var_groups(s));
966 
967  const unsigned int
968  start_idx_sys = this->start_idx(s);
969 
970  libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());
971 
972  _idx_buf[start_idx_sys + 2*vg + 1] = db;
973 
974  libmesh_assert_equal_to (this->vg_dof_base(s,vg), db);
975 }
dof_id_type vg_dof_base(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:980
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:758
unsigned int n_systems() const
Definition: dof_object.h:749
unsigned int start_idx(const unsigned int s) const
Definition: dof_object.h:936
index_buffer_t _idx_buf
Definition: dof_object.h:508

◆ side()

std::unique_ptr< Elem > libMesh::Elem::side ( const unsigned int  i) 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 side_ptr() function instead.

Definition at line 2202 of file elem.h.

References libMesh::Elem::side_ptr().

Referenced by libMesh::Quad4::build_side_ptr(), libMesh::InfQuad4::build_side_ptr(), libMesh::Hex8::build_side_ptr(), libMesh::Tri3::build_side_ptr(), libMesh::InfPrism12::build_side_ptr(), libMesh::Tet4::build_side_ptr(), libMesh::InfHex18::build_side_ptr(), libMesh::InfQuad6::build_side_ptr(), libMesh::Quad8::build_side_ptr(), libMesh::InfHex16::build_side_ptr(), libMesh::Tet10::build_side_ptr(), libMesh::Hex20::build_side_ptr(), libMesh::Tri6::build_side_ptr(), libMesh::Prism15::build_side_ptr(), libMesh::Pyramid13::build_side_ptr(), libMesh::Quad9::build_side_ptr(), libMesh::Hex27::build_side_ptr(), libMesh::Prism18::build_side_ptr(), libMesh::Pyramid14::build_side_ptr(), libMesh::Tet::side_ptr(), libMesh::Prism::side_ptr(), side_ptr(), libMesh::Hex::side_ptr(), libMesh::Tri::side_ptr(), libMesh::Edge::side_ptr(), libMesh::InfPrism::side_ptr(), libMesh::InfHex::side_ptr(), libMesh::Quad::side_ptr(), libMesh::InfQuad::side_ptr(), libMesh::Elem::simple_build_side_ptr(), libMesh::Tet::which_node_am_i(), libMesh::Prism::which_node_am_i(), libMesh::InfPrism12::which_node_am_i(), which_node_am_i(), libMesh::Hex::which_node_am_i(), libMesh::Tri::which_node_am_i(), libMesh::Edge::which_node_am_i(), libMesh::InfPrism::which_node_am_i(), libMesh::InfQuad6::which_node_am_i(), libMesh::InfHex16::which_node_am_i(), libMesh::InfHex::which_node_am_i(), libMesh::Tet10::which_node_am_i(), libMesh::Quad8::which_node_am_i(), libMesh::Hex20::which_node_am_i(), libMesh::Pyramid13::which_node_am_i(), libMesh::Prism15::which_node_am_i(), libMesh::Tri6::which_node_am_i(), libMesh::Quad::which_node_am_i(), libMesh::Quad9::which_node_am_i(), libMesh::InfQuad::which_node_am_i(), libMesh::Hex27::which_node_am_i(), libMesh::Prism18::which_node_am_i(), libMesh::Pyramid14::which_node_am_i(), and libMesh::InfHex18::which_node_am_i().

2203 {
2204  // Call the const version of side_ptr(), and const_cast the result.
2205  libmesh_deprecated();
2206  Elem * s = const_cast<Elem *>(this->side_ptr(i).release());
2207  return std::unique_ptr<Elem>(s);
2208 }
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1811
virtual std::unique_ptr< Elem > side_ptr(unsigned int i)=0

◆ side_children_matrix()

unsigned int libMesh::Pyramid::side_children_matrix ( const unsigned  int,
const unsigned  int 
) const
inlineprotected

Matrix that allows children to inherit boundary conditions.

Definition at line 163 of file cell_pyramid.h.

165  { libmesh_not_implemented(); return 0; }

◆ side_index_range()

IntRange< unsigned short > libMesh::Elem::side_index_range ( ) const
inlineinherited

◆ side_ptr() [1/4]

std::unique_ptr< Elem > libMesh::Pyramid::side_ptr ( const unsigned int  i)
overridevirtual
Returns
A primitive triangle or quad for face i.

Implements libMesh::Elem.

Definition at line 100 of file cell_pyramid.C.

References n_sides(), libMesh::Elem::node_ptr(), and libMesh::Pyramid5::side_nodes_map.

Referenced by libMesh::Pyramid5::build_side_ptr(), and side_ptr().

101 {
102  libmesh_assert_less (i, this->n_sides());
103 
104  // Return value
105  std::unique_ptr<Elem> face;
106 
107  // Set up the type of element
108  switch (i)
109  {
110  case 0: // triangular face 1
111  case 1: // triangular face 2
112  case 2: // triangular face 3
113  case 3: // triangular face 4
114  {
115  face = libmesh_make_unique<Tri3>();
116  break;
117  }
118  case 4: // the quad face at z=0
119  {
120  face = libmesh_make_unique<Quad4>();
121  break;
122  }
123  default:
124  libmesh_error_msg("Invalid side i = " << i);
125  }
126 
127  // Set the nodes
128  for (unsigned n=0; n<face->n_nodes(); ++n)
129  face->set_node(n) = this->node_ptr(Pyramid5::side_nodes_map[i][n]);
130 
131  return face;
132 }
virtual unsigned int n_sides() const override
Definition: cell_pyramid.h:83
const Node * node_ptr(const unsigned int i) const
Definition: elem.h:1957
static const unsigned int side_nodes_map[num_sides][nodes_per_side]

◆ side_ptr() [2/4]

void libMesh::Pyramid::side_ptr ( std::unique_ptr< Elem > &  side,
const unsigned int  i 
)
overridevirtual

Rebuilds a primitive triangle or quad for face i.

Implements libMesh::Elem.

Definition at line 136 of file cell_pyramid.C.

References n_sides(), libMesh::Elem::node_ptr(), libMesh::QUAD4, libMesh::Elem::side(), libMesh::Pyramid5::side_nodes_map, side_ptr(), libMesh::Elem::subdomain_id(), and libMesh::TRI3.

138 {
139  libmesh_assert_less (i, this->n_sides());
140 
141  switch (i)
142  {
143  case 0: // triangular face 1
144  case 1: // triangular face 2
145  case 2: // triangular face 3
146  case 3: // triangular face 4
147  {
148  if (!side.get() || side->type() != TRI3)
149  {
150  side = this->side_ptr(i);
151  return;
152  }
153  break;
154  }
155 
156  case 4: // the quad face at z=0
157  {
158  if (!side.get() || side->type() != QUAD4)
159  {
160  side = this->side_ptr(i);
161  return;
162  }
163  break;
164  }
165 
166  default:
167  libmesh_error_msg("Invalid side i = " << i);
168  }
169 
170  side->subdomain_id() = this->subdomain_id();
171 
172  // Set the nodes
173  for (auto n : side->node_index_range())
174  side->set_node(n) = this->node_ptr(Pyramid5::side_nodes_map[i][n]);
175 }
virtual unsigned int n_sides() const override
Definition: cell_pyramid.h:83
virtual std::unique_ptr< Elem > side_ptr(const unsigned int i) override
Definition: cell_pyramid.C:100
subdomain_id_type subdomain_id() const
Definition: elem.h:2034
const Node * node_ptr(const unsigned int i) const
Definition: elem.h:1957
static const unsigned int side_nodes_map[num_sides][nodes_per_side]
std::unique_ptr< Elem > side(const unsigned int i) const
Definition: elem.h:2202

◆ side_ptr() [3/4]

std::unique_ptr< const Elem > libMesh::Elem::side_ptr ( unsigned int  i) const
inlineinherited

Definition at line 2175 of file elem.h.

References libMesh::Elem::side_ptr().

2176 {
2177  // Call the non-const version of this function, return the result as
2178  // a std::unique_ptr<const Elem>.
2179  Elem * me = const_cast<Elem *>(this);
2180  const Elem * s = const_cast<const Elem *>(me->side_ptr(i).release());
2181  return std::unique_ptr<const Elem>(s);
2182 }
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1811

◆ side_ptr() [4/4]

void libMesh::Elem::side_ptr ( std::unique_ptr< const Elem > &  side,
const unsigned int  i 
) const
inlineinherited

Definition at line 2188 of file elem.h.

References libMesh::Elem::side_ptr().

2190 {
2191  // Hand off to the non-const version of this function
2192  Elem * me = const_cast<Elem *>(this);
2193  std::unique_ptr<Elem> e {const_cast<Elem *>(elem.release())};
2194  me->side_ptr(e, i);
2195  elem.reset(e.release());
2196 }
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1811

◆ simple_build_side_ptr()

template<typename Subclass >
void libMesh::Elem::simple_build_side_ptr ( std::unique_ptr< Elem > &  side,
const unsigned int  i,
ElemType  sidetype 
)
inlineprotectedinherited

An implementation for simple (all sides equal) elements

Definition at line 2257 of file elem.h.

References libMesh::Elem::build_side_ptr(), libMesh::Elem::n_sides(), libMesh::Elem::node_ptr(), libMesh::Elem::side(), and libMesh::Elem::subdomain_id().

2260 {
2261  libmesh_assert_less (i, this->n_sides());
2262 
2263  if (!side.get() || side->type() != sidetype)
2264  side = this->build_side_ptr(i, false);
2265  else
2266  {
2267  side->subdomain_id() = this->subdomain_id();
2268 
2269  for (auto n : side->node_index_range())
2270  side->set_node(n) = this->node_ptr(Subclass::side_nodes_map[i][n]);
2271  }
2272 }
virtual std::unique_ptr< Elem > build_side_ptr(const unsigned int i, bool proxy=true)=0
virtual unsigned int n_sides() const =0
subdomain_id_type subdomain_id() const
Definition: elem.h:2034
const Node * node_ptr(const unsigned int i) const
Definition: elem.h:1957
std::unique_ptr< Elem > side(const unsigned int i) const
Definition: elem.h:2202

◆ subactive()

bool libMesh::Elem::subactive ( ) const
inlineinherited
Returns
true if the element is subactive (i.e. has no active descendants), false otherwise or if AMR is disabled.

Definition at line 2408 of file elem.h.

References libMesh::Elem::active(), libMesh::Elem::has_children(), and libMesh::Elem::parent().

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::HPCoarsenTest::add_projection(), libMesh::Elem::ancestor(), libMesh::FEAbstract::compute_node_constraints(), libMesh::UnstructuredMesh::contract(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::Elem::family_tree(), libMesh::Elem::family_tree_by_neighbor(), libMesh::Elem::family_tree_by_side(), libMesh::Elem::family_tree_by_subneighbor(), libMesh::Elem::find_interior_neighbors(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::Elem::get_info(), libMesh::Elem::libmesh_assert_valid_neighbors(), libMesh::Elem::make_links_to_me_local(), libMesh::Elem::make_links_to_me_remote(), libMesh::Elem::max_descendant_p_level(), libMesh::Elem::min_new_p_level_by_neighbor(), libMesh::Elem::min_p_level_by_neighbor(), libMesh::Elem::refine(), libMesh::Elem::remove_links_to_me(), libMesh::ReplicatedMesh::stitching_helper(), and libMesh::Parallel::Packing< T >::unpack().

2409 {
2410 #ifdef LIBMESH_ENABLE_AMR
2411  if (this->active())
2412  return false;
2413  if (!this->has_children())
2414  return true;
2415  for (const Elem * my_ancestor = this->parent();
2416  my_ancestor != nullptr;
2417  my_ancestor = my_ancestor->parent())
2418  if (my_ancestor->active())
2419  return true;
2420 #endif
2421 
2422  return false;
2423 }
const Elem * parent() const
Definition: elem.h:2479
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1811
bool active() const
Definition: elem.h:2390
bool has_children() const
Definition: elem.h:2428

◆ subdomain_id() [1/2]

subdomain_id_type libMesh::Elem::subdomain_id ( ) const
inlineinherited
Returns
The subdomain that this element belongs to.

Definition at line 2034 of file elem.h.

References libMesh::Elem::_sbd_id.

Referenced by libMesh::DofMap::_dof_indices(), libMesh::BoundaryInfo::_find_id_maps(), libMesh::UnstructuredMesh::all_first_order(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::AbaqusIO::assign_subdomain_ids(), libMesh::MeshTools::Generation::build_extrusion(), libMesh::Quad4::build_side_ptr(), libMesh::InfQuad4::build_side_ptr(), libMesh::Prism6::build_side_ptr(), libMesh::Pyramid5::build_side_ptr(), libMesh::InfHex8::build_side_ptr(), libMesh::Tri3::build_side_ptr(), libMesh::Hex8::build_side_ptr(), libMesh::InfPrism6::build_side_ptr(), libMesh::InfPrism12::build_side_ptr(), libMesh::InfHex18::build_side_ptr(), libMesh::Tet4::build_side_ptr(), libMesh::InfQuad6::build_side_ptr(), libMesh::Quad8::build_side_ptr(), libMesh::InfHex16::build_side_ptr(), libMesh::Tet10::build_side_ptr(), libMesh::Tri6::build_side_ptr(), libMesh::Hex20::build_side_ptr(), libMesh::Pyramid13::build_side_ptr(), libMesh::Prism15::build_side_ptr(), libMesh::Quad9::build_side_ptr(), libMesh::Hex27::build_side_ptr(), libMesh::Prism18::build_side_ptr(), libMesh::Pyramid14::build_side_ptr(), libMesh::MeshTools::Modification::change_subdomain_id(), libMesh::UnstructuredMesh::copy_nodes_and_elements(), libMesh::UnstructuredMesh::create_submesh(), libMesh::DofMap::dof_indices(), libMesh::Elem::Elem(), libMesh::MeshTools::Modification::flatten(), libMesh::UNVIO::groups_in(), libMesh::DofMap::old_dof_indices(), libMesh::Parallel::Packing< T >::pack(), libMesh::XdrIO::pack_element(), libMesh::Nemesis_IO::read(), libMesh::ExodusII_IO::read(), libMesh::CheckpointIO::read_connectivity(), libMesh::UCDIO::read_implementation(), libMesh::GmshIO::read_mesh(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::Prism::side_ptr(), side_ptr(), libMesh::Edge::side_ptr(), libMesh::InfPrism::side_ptr(), libMesh::InfHex::side_ptr(), libMesh::InfQuad::side_ptr(), libMesh::Elem::simple_build_side_ptr(), libMesh::MeshBase::subdomain_ids(), and libMesh::Parallel::Packing< T >::unpack().

2035 {
2036  return _sbd_id;
2037 }
subdomain_id_type _sbd_id
Definition: elem.h:1713

◆ subdomain_id() [2/2]

subdomain_id_type & libMesh::Elem::subdomain_id ( )
inlineinherited
Returns
The subdomain that this element belongs to as a writable reference.

Definition at line 2042 of file elem.h.

References libMesh::Elem::_sbd_id.

2043 {
2044  return _sbd_id;
2045 }
subdomain_id_type _sbd_id
Definition: elem.h:1713

◆ top_parent()

const Elem * libMesh::Elem::top_parent ( ) const
inlineinherited
Returns
A pointer to the element's top-most (i.e. level-0) parent.

That is, this if this is a level-0 element, this element's parent if this is a level-1 element, this element's grandparent if this is a level-2 element, etc...

Definition at line 2503 of file elem.h.

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

Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::BoundaryInfo::add_elements(), libMesh::BoundaryInfo::boundary_ids(), libMesh::BoundaryInfo::edge_boundary_ids(), libMesh::MeshTools::libmesh_assert_valid_amr_interior_parents(), libMesh::ExodusII_IO::read_elemental_variable(), and libMesh::BoundaryInfo::side_with_boundary_id().

2504 {
2505  const Elem * tp = this;
2506 
2507  // Keep getting the element's parent
2508  // until that parent is at level-0
2509  while (tp->parent() != nullptr)
2510  tp = tp->parent();
2511 
2512  libmesh_assert(tp);
2513  libmesh_assert_equal_to (tp->level(), 0);
2514 
2515  return tp;
2516 }
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1811

◆ topological_neighbor() [1/2]

const Elem * libMesh::Elem::topological_neighbor ( const unsigned int  i,
const MeshBase mesh,
const PointLocatorBase point_locator,
const PeriodicBoundaries pb 
) const
inherited
Returns
A pointer to the $ i^{th} $ neighbor of this element for interior elements. If an element is on a periodic boundary, it will return a corresponding element on the opposite side.

Definition at line 920 of file elem.C.

References libMesh::PeriodicBoundaries::boundary(), libMesh::Elem::level(), mesh, libMesh::Elem::n_neighbors(), libMesh::PeriodicBoundaries::neighbor(), libMesh::Elem::neighbor_ptr(), and libMesh::Elem::parent().

Referenced by libMesh::Elem::has_topological_neighbor(), libMesh::DefaultCoupling::operator()(), and libMesh::MeshRefinement::topological_neighbor().

924 {
925  libmesh_assert_less (i, this->n_neighbors());
926 
927  const Elem * neighbor_i = this->neighbor_ptr(i);
928  if (neighbor_i != nullptr)
929  return neighbor_i;
930 
931  if (pb)
932  {
933  // Since the neighbor is nullptr it must be on a boundary. We need
934  // see if this is a periodic boundary in which case it will have a
935  // topological neighbor
936  std::vector<boundary_id_type> bc_ids;
937  mesh.get_boundary_info().boundary_ids(this, cast_int<unsigned short>(i), bc_ids);
938  for (const auto & id : bc_ids)
939  if (pb->boundary(id))
940  {
941  neighbor_i = pb->neighbor(id, point_locator, this, i);
942 
943  // Since coarse elements do not have more refined
944  // neighbors we need to make sure that we don't return one
945  // of these types of neighbors.
946  if (neighbor_i)
947  while (level() < neighbor_i->level())
948  neighbor_i = neighbor_i->parent();
949  return neighbor_i;
950  }
951  }
952 
953  return nullptr;
954 }
MeshBase & mesh
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1811
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:2050
unsigned int level() const
Definition: elem.h:2521
unsigned int n_neighbors() const
Definition: elem.h:644

◆ topological_neighbor() [2/2]

Elem * libMesh::Elem::topological_neighbor ( const unsigned int  i,
MeshBase mesh,
const PointLocatorBase point_locator,
const PeriodicBoundaries pb 
)
inherited
Returns
A writable pointer to the $ i^{th} $ neighbor of this element for interior elements. If an element is on a periodic boundary, it will return a corresponding element on the opposite side.

Definition at line 878 of file elem.C.

References libMesh::PeriodicBoundaries::boundary(), libMesh::Elem::level(), mesh, libMesh::Elem::n_neighbors(), libMesh::PeriodicBoundaries::neighbor(), libMesh::Elem::neighbor_ptr(), and libMesh::Elem::parent().

882 {
883  libmesh_assert_less (i, this->n_neighbors());
884 
885  Elem * neighbor_i = this->neighbor_ptr(i);
886  if (neighbor_i != nullptr)
887  return neighbor_i;
888 
889  if (pb)
890  {
891  // Since the neighbor is nullptr it must be on a boundary. We need
892  // see if this is a periodic boundary in which case it will have a
893  // topological neighbor
894  std::vector<boundary_id_type> bc_ids;
895  mesh.get_boundary_info().boundary_ids(this, cast_int<unsigned short>(i), bc_ids);
896  for (const auto & id : bc_ids)
897  if (pb->boundary(id))
898  {
899  // Since the point locator inside of periodic boundaries
900  // returns a const pointer we will retrieve the proper
901  // pointer directly from the mesh object.
902  const Elem * const cn = pb->neighbor(id, point_locator, this, i);
903  neighbor_i = const_cast<Elem *>(cn);
904 
905  // Since coarse elements do not have more refined
906  // neighbors we need to make sure that we don't return one
907  // of these types of neighbors.
908  if (neighbor_i)
909  while (level() < neighbor_i->level())
910  neighbor_i = neighbor_i->parent();
911  return neighbor_i;
912  }
913  }
914 
915  return nullptr;
916 }
MeshBase & mesh
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1811
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:2050
unsigned int level() const
Definition: elem.h:2521
unsigned int n_neighbors() const
Definition: elem.h:644

◆ total_family_tree()

void libMesh::Elem::total_family_tree ( std::vector< const Elem *> &  active_family,
const bool  reset = true 
) const
inherited

Same as the family_tree() member, but also adds any subactive descendants.

Definition at line 1557 of file elem.C.

References libMesh::Elem::child_ref_range(), and libMesh::Elem::has_children().

Referenced by libMesh::connect_families(), and libMesh::Partitioner::set_parent_processor_ids().

1559 {
1560  // Clear the vector if the flag reset tells us to.
1561  if (reset)
1562  family.clear();
1563 
1564  // Add this element to the family tree.
1565  family.push_back(this);
1566 
1567  // Recurse into the elements children, if it has them.
1568  // Do not clear the vector any more.
1569  if (this->has_children())
1570  for (auto & c : this->child_ref_range())
1571  if (!c.is_remote())
1572  c.total_family_tree (family, false);
1573 }
SimpleRange< ChildRefIter > child_ref_range()
Definition: elem.h:1779
bool has_children() const
Definition: elem.h:2428

◆ total_family_tree_by_neighbor()

void libMesh::Elem::total_family_tree_by_neighbor ( std::vector< const Elem *> &  family,
const Elem neighbor,
const bool  reset = true 
) const
inherited

Same as the family_tree_by_neighbor() member, but also adds any subactive descendants.

Definition at line 1688 of file elem.C.

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

1691 {
1692  // Clear the vector if the flag reset tells us to.
1693  if (reset)
1694  family.clear();
1695 
1696  // This only makes sense if we're already a neighbor
1697  libmesh_assert (this->has_neighbor(neighbor_in));
1698 
1699  // Add this element to the family tree.
1700  family.push_back(this);
1701 
1702  // Recurse into the elements children, if it has any.
1703  // Do not clear the vector any more.
1704  if (this->has_children())
1705  for (auto & c : this->child_ref_range())
1706  if (&c != remote_elem && c.has_neighbor(neighbor_in))
1707  c.total_family_tree_by_neighbor (family, neighbor_in, false);
1708 }
bool has_neighbor(const Elem *elem) const
Definition: elem.h:2093
SimpleRange< ChildRefIter > child_ref_range()
Definition: elem.h:1779
bool has_children() const
Definition: elem.h:2428
const RemoteElem * remote_elem
Definition: remote_elem.C:57

◆ total_family_tree_by_subneighbor()

void libMesh::Elem::total_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_by_subneighbor() member, but also adds any subactive descendants.

Definition at line 1754 of file elem.C.

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

1758 {
1759  // Clear the vector if the flag reset tells us to.
1760  if (reset)
1761  family.clear();
1762 
1763  // To simplify this function we need an existing neighbor
1764  libmesh_assert (neighbor_in);
1765  libmesh_assert_not_equal_to (neighbor_in, remote_elem);
1766  libmesh_assert (this->has_neighbor(neighbor_in));
1767 
1768  // This only makes sense if subneighbor descends from neighbor
1769  libmesh_assert (subneighbor);
1770  libmesh_assert_not_equal_to (subneighbor, remote_elem);
1771  libmesh_assert (neighbor_in->is_ancestor_of(subneighbor));
1772 
1773  // Add this element to the family tree if applicable.
1774  if (neighbor_in == subneighbor)
1775  family.push_back(this);
1776 
1777  // Recurse into the elements children, if it has any.
1778  // Do not clear the vector any more.
1779  if (this->has_children())
1780  for (auto & c : this->child_ref_range())
1781  if (&c != remote_elem)
1782  for (auto child_neigh : c.neighbor_ptr_range())
1783  if (child_neigh &&
1784  (child_neigh == neighbor_in ||
1785  (child_neigh->parent() == neighbor_in &&
1786  child_neigh->is_ancestor_of(subneighbor))))
1787  c.total_family_tree_by_subneighbor
1788  (family, child_neigh, subneighbor, false);
1789 }
bool has_neighbor(const Elem *elem) const
Definition: elem.h:2093
SimpleRange< ChildRefIter > child_ref_range()
Definition: elem.h:1779
bool has_children() const
Definition: elem.h:2428
const RemoteElem * remote_elem
Definition: remote_elem.C:57

◆ type()

virtual ElemType libMesh::Elem::type ( ) const
pure virtualinherited
Returns
The type of element that has been derived from this base class.

Implemented in libMesh::NodeElem, libMesh::Edge4, libMesh::Edge3, libMesh::Edge2, libMesh::InfEdge2, libMesh::RemoteElem, libMesh::Pyramid14, libMesh::InfHex16, libMesh::InfHex18, libMesh::Pyramid13, libMesh::Prism15, libMesh::Prism18, libMesh::Hex20, libMesh::Hex27, libMesh::InfPrism12, libMesh::InfPrism6, libMesh::InfHex8, libMesh::Tet10, libMesh::InfQuad6, libMesh::InfQuad4, libMesh::Tri3, libMesh::Tri6, libMesh::Hex8, libMesh::Tet4, libMesh::Prism6, libMesh::Pyramid5, libMesh::Quad4, libMesh::Quad8, libMesh::Quad9, libMesh::Tri3Subdivision, libMesh::QuadShell4, libMesh::QuadShell8, and libMesh::TriShell3.

Referenced by libMesh::PostscriptIO::_compute_edge_bezier_coeffs(), libMesh::DofMap::_dof_indices(), libMesh::MeshTools::Subdivision::add_boundary_ghosts(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::AbaqusIO::assign_sideset_ids(), libMesh::AbaqusIO::assign_subdomain_ids(), libMesh::Elem::bracketing_nodes(), libMesh::Elem::build(), libMesh::Nemesis_IO_Helper::build_element_and_node_maps(), libMesh::FEGenericBase< FEOutputType< T >::type >::coarsened_dof_values(), libMesh::InfFE< Dim, T_radial, T_map >::combine_base_radial(), libMesh::InfFE< Dim, T_radial, T_map >::compute_data(), libMesh::FEInterface::compute_data(), libMesh::FEMap::compute_map(), libMesh::DofMap::constrain_p_dofs(), libMesh::InfPrism::contains_point(), libMesh::InfHex::contains_point(), libMesh::DofMap::dof_indices(), libMesh::FE< Dim, LAGRANGE_VEC >::dofs_on_edge(), libMesh::FE< Dim, LAGRANGE_VEC >::dofs_on_side(), libMesh::FE< Dim, LAGRANGE_VEC >::edge_reinit(), libMesh::MeshTools::find_nodal_neighbors(), libMesh::MeshTools::Modification::flatten(), libMesh::Elem::get_info(), libMesh::QComposite< QSubCell >::init(), libMesh::QBase::init(), libMesh::FE< Dim, LAGRANGE_VEC >::init_base_shape_functions(), libMesh::FEMap::init_edge_shape_functions(), libMesh::InfFE< Dim, T_radial, T_map >::init_face_shape_functions(), libMesh::FEMap::init_reference_to_physical_map(), libMesh::InfFE< Dim, T_radial, T_map >::init_shape_functions(), libMesh::FESubdivision::init_shape_functions(), libMesh::FEInterface::inverse_map(), libMesh::FE< Dim, LAGRANGE_VEC >::inverse_map(), libMesh::FEInterface::map(), libMesh::FE< Dim, LAGRANGE_VEC >::map(), libMesh::FE< Dim, LAGRANGE_VEC >::map_eta(), libMesh::FE< Dim, LAGRANGE_VEC >::map_xi(), libMesh::FE< Dim, LAGRANGE_VEC >::map_zeta(), libMesh::FEInterface::nodal_soln(), libMesh::FE< Dim, LAGRANGE_VEC >::nodal_soln(), libMesh::DofMap::old_dof_indices(), libMesh::Elem::operator==(), libMesh::Parallel::Packing< T >::pack(), libMesh::XdrIO::pack_element(), libMesh::Elem::parent_bracketing_nodes(), libMesh::Elem::point_test(), libMesh::Nemesis_IO::read(), libMesh::CheckpointIO::read_connectivity(), libMesh::Elem::reference_elem(), libMesh::Elem::refine(), libMesh::FE< Dim, LAGRANGE_VEC >::reinit(), libMesh::InfFE< Dim, T_radial, T_map >::reinit(), libMesh::FEXYZ< Dim >::reinit(), libMesh::FE< Dim, LAGRANGE_VEC >::shape(), libMesh::FEInterface::shape(), libMesh::InfFE< Dim, T_radial, T_map >::shape(), libMesh::FE< Dim, LAGRANGE_VEC >::shape_deriv(), libMesh::FE< Dim, LAGRANGE_VEC >::shape_second_deriv(), libMesh::FE< Dim, LAGRANGE_VEC >::side_map(), libMesh::Tri3Subdivision::Tri3Subdivision(), libMesh::Parallel::Packing< T >::unpack(), libMesh::ExodusII_IO_Helper::write_elements(), and libMesh::Nemesis_IO_Helper::write_sidesets().

◆ unique_id()

◆ unpack_indexing()

void libMesh::DofObject::unpack_indexing ( std::vector< largest_id_type >::const_iterator  begin)
inherited

A method for creating our index buffer from packed data - basically with our current implementation we investigate the size term and then copy.

Definition at line 482 of file dof_object.C.

References libMesh::DofObject::_idx_buf, libMesh::DofObject::clear_old_dof_object(), libMesh::DofObject::DofObject(), libMesh::DofObject::old_dof_object, and libMesh::DofObject::unpack_indexing().

Referenced by libMesh::Parallel::Packing< T >::unpack(), and libMesh::DofObject::unpack_indexing().

483 {
484  _idx_buf.clear();
485 
486 #ifdef LIBMESH_ENABLE_AMR
487  this->clear_old_dof_object();
488  const bool has_old_dof_object = cast_int<bool>(*begin++);
489 #endif
490 
491  const largest_id_type size = *begin++;
492  _idx_buf.reserve(size);
493  std::copy(begin, begin+size, back_inserter(_idx_buf));
494 
495  // Check as best we can for internal consistency now
496  libmesh_assert(_idx_buf.empty() ||
497  (_idx_buf[0] <= _idx_buf.size()));
498 #ifdef DEBUG
499  if (!_idx_buf.empty())
500  for (unsigned int i=1; i < _idx_buf[0]; ++i)
501  {
502  libmesh_assert_greater_equal (_idx_buf[i], _idx_buf[i-1]);
503  libmesh_assert_equal_to ((_idx_buf[i] - _idx_buf[i-1])%2, 0);
504  libmesh_assert_less_equal (_idx_buf[i], _idx_buf.size());
505  }
506 #endif
507 
508 #ifdef LIBMESH_ENABLE_AMR
509  if (has_old_dof_object)
510  {
511  this->old_dof_object = new DofObject();
512  this->old_dof_object->unpack_indexing(begin+size);
513  }
514 #endif
515 }
uint64_t largest_id_type
Definition: id_types.h:139
void clear_old_dof_object()
Definition: dof_object.C:142
DofObject * old_dof_object
Definition: dof_object.h:79
void unpack_indexing(std::vector< largest_id_type >::const_iterator begin)
Definition: dof_object.C:482
index_buffer_t _idx_buf
Definition: dof_object.h:508

◆ unpackable_indexing_size()

unsigned int libMesh::DofObject::unpackable_indexing_size ( std::vector< largest_id_type >::const_iterator  begin)
staticinherited

If we have indices packed into an buffer for communications, how much of that buffer applies to this dof object?

Definition at line 461 of file dof_object.C.

Referenced by libMesh::Parallel::Packing< T >::packed_size(), and libMesh::Parallel::Packing< T >::unpack().

462 {
463 #ifdef LIBMESH_ENABLE_AMR
464  const bool has_old_dof_object = cast_int<bool>(*begin++);
465 
466  static const int dof_header_size = 2;
467 #else
468  static const bool has_old_dof_object = false;
469  static const int dof_header_size = 1;
470 #endif
471 
472  const largest_id_type this_indexing_size = *begin++;
473 
474  return cast_int<unsigned int>
475  (dof_header_size + this_indexing_size +
476  (has_old_dof_object ?
477  unpackable_indexing_size(begin+this_indexing_size) : 0));
478 }
static unsigned int unpackable_indexing_size(std::vector< largest_id_type >::const_iterator begin)
Definition: dof_object.C:461
uint64_t largest_id_type
Definition: id_types.h:139

◆ valid_id()

bool libMesh::DofObject::valid_id ( ) const
inlineinherited

◆ valid_processor_id()

bool libMesh::DofObject::valid_processor_id ( ) const
inlineinherited
Returns
true if this DofObject has a valid id set, false otherwise.

Definition at line 741 of file dof_object.h.

References libMesh::DofObject::_processor_id, and libMesh::DofObject::invalid_processor_id.

742 {
744 }
static const processor_id_type invalid_processor_id
Definition: dof_object.h:358
processor_id_type _processor_id
Definition: dof_object.h:453

◆ valid_unique_id()

bool libMesh::DofObject::valid_unique_id ( ) const
inlineinherited

◆ var_to_vg_and_offset()

std::pair< unsigned int, unsigned int > libMesh::DofObject::var_to_vg_and_offset ( const unsigned int  s,
const unsigned int  var 
) const
inlineinherited
Returns
A pair consisting of the variable group number and the offset index from the start of that group for variable var on system s associated with this DofObject

Definition at line 887 of file dof_object.h.

References libMesh::DofObject::n_var_groups(), and libMesh::DofObject::n_vars().

Referenced by libMesh::DofMap::_dof_indices(), and libMesh::DofObject::dof_number().

889 {
890  std::pair<unsigned int, unsigned int> returnval(0,0);
891 
892  unsigned int & vg = returnval.first;
893  unsigned int & offset = returnval.second;
894 
895  unsigned int vg_start = 0;
896  for (; ; vg++)
897  {
898  libmesh_assert_less(vg, this->n_var_groups(s));
899 
900  const unsigned int vg_end = vg_start + this->n_vars(s,vg);
901  if (var < vg_end)
902  {
903  offset = var - vg_start;
904  return returnval;
905  }
906  vg_start = vg_end;
907  }
908 }
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:758
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:768

◆ vg_dof_base()

dof_id_type libMesh::DofObject::vg_dof_base ( const unsigned int  s,
const unsigned int  vg 
) const
inlineinherited

VariableGroup DoF indices are indexed as id = base + var_in_vg*ncomp + comp This method allows for direct access to the base.

Definition at line 980 of file dof_object.h.

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

Referenced by libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::DofMap::reinit(), libMesh::DofMap::set_nonlocal_dof_objects(), and libMesh::DofObject::set_vg_dof_base().

982 {
983  libmesh_assert_less (s, this->n_systems());
984  libmesh_assert_less (vg, this->n_var_groups(s));
985 
986  const unsigned int
987  start_idx_sys = this->start_idx(s);
988 
989  libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());
990 
991  // #ifdef DEBUG
992  // std::cout << " [ ";
993  // for (std:size_t i=0; i<_idx_buf.size(); i++)
994  // std::cout << _idx_buf[i] << " ";
995  // std::cout << "]\n";
996  // #endif
997 
998  return _idx_buf[start_idx_sys + 2*vg + 1];
999 }
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:758
unsigned int n_systems() const
Definition: dof_object.h:749
unsigned int start_idx(const unsigned int s) const
Definition: dof_object.h:936
index_buffer_t _idx_buf
Definition: dof_object.h:508

◆ volume()

Real libMesh::Elem::volume ( ) const
virtualinherited
Returns
The (length/area/volume) of the geometric element.

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

Definition at line 2826 of file elem.C.

References libMesh::FEGenericBase< OutputType >::build(), libMesh::Elem::default_order(), libMesh::FEType::default_quadrature_order(), libMesh::Elem::dim(), libMesh::LAGRANGE, and libMesh::Real.

Referenced by libMesh::ElemCutter::cut_3D(), and libMesh::Elem::get_info().

2827 {
2828  // The default implementation builds a finite element of the correct
2829  // order and sums up the JxW contributions. This can be expensive,
2830  // so the various element types can overload this method and compute
2831  // the volume more efficiently.
2832  FEType fe_type (this->default_order() , LAGRANGE);
2833 
2834  std::unique_ptr<FEBase> fe (FEBase::build(this->dim(),
2835  fe_type));
2836 
2837  const std::vector<Real> & JxW = fe->get_JxW();
2838 
2839  // The default quadrature rule should integrate the mass matrix,
2840  // thus it should be plenty to compute the area
2841  QGauss qrule (this->dim(), fe_type.default_quadrature_order());
2842 
2843  fe->attach_quadrature_rule(&qrule);
2844 
2845  fe->reinit(this);
2846 
2847  Real vol=0.;
2848  for (unsigned int qp=0; qp<qrule.n_points(); ++qp)
2849  vol += JxW[qp];
2850 
2851  return vol;
2852 
2853 }
static std::unique_ptr< FEGenericBase > build(const unsigned int dim, const FEType &type)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual unsigned short dim() const =0
virtual Order default_order() const =0

◆ which_child_am_i()

unsigned int libMesh::Elem::which_child_am_i ( const Elem e) const
inlineinherited
Returns
The child index which e corresponds to.

I.e. if c = a->which_child_am_i(e); then a->child_ptr(c) will be e.

Definition at line 2620 of file elem.h.

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

Referenced by libMesh::BoundaryInfo::boundary_ids(), libMesh::BoundaryInfo::edge_boundary_ids(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::Elem::make_links_to_me_remote(), libMesh::Parallel::Packing< T >::pack(), libMesh::BoundaryInfo::side_with_boundary_id(), libMesh::MeshTools::Modification::smooth(), and libMesh::Parallel::sync_element_data_by_parent_id().

2621 {
2622  libmesh_assert(e);
2623  libmesh_assert (this->has_children());
2624 
2625  unsigned int nc = this->n_children();
2626  for (unsigned int c=0; c != nc; c++)
2627  if (this->child_ptr(c) == e)
2628  return c;
2629 
2630  libmesh_error_msg("ERROR: which_child_am_i() was called with a non-child!");
2631 
2632  return libMesh::invalid_uint;
2633 }
const unsigned int invalid_uint
Definition: libmesh.h:245
virtual unsigned int n_children() const =0
bool has_children() const
Definition: elem.h:2428
const Elem * child_ptr(unsigned int i) const
Definition: elem.h:2578

◆ which_neighbor_am_i()

unsigned int libMesh::Elem::which_neighbor_am_i ( const Elem e) const
inlineinherited

This function tells you which neighbor e is. I.e. if s = a->which_neighbor_am_i(e); then a->neighbor(s) will be an ancestor of e.

Definition at line 2314 of file elem.h.

References libMesh::invalid_uint, libMesh::Elem::level(), libMesh::Elem::n_sides(), libMesh::Elem::neighbor_ptr(), and libMesh::Elem::parent().

Referenced by libMesh::FEGenericBase< FEOutputType< T >::type >::compute_proj_constraints(), libMesh::MeshTools::find_hanging_nodes_and_parents(), libMesh::Elem::libmesh_assert_valid_neighbors(), libMesh::Elem::make_links_to_me_remote(), libMesh::Elem::nullify_neighbors(), and libMesh::Elem::remove_links_to_me().

2315 {
2316  libmesh_assert(e);
2317 
2318  const Elem * eparent = e;
2319 
2320  while (eparent->level() > this->level())
2321  {
2322  eparent = eparent->parent();
2323  libmesh_assert(eparent);
2324  }
2325 
2326  for (unsigned int s=0, n_s = this->n_sides(); s != n_s; ++s)
2327  if (this->neighbor_ptr(s) == eparent)
2328  return s;
2329 
2330  return libMesh::invalid_uint;
2331 }
const unsigned int invalid_uint
Definition: libmesh.h:245
Elem(const unsigned int n_nodes, const unsigned int n_sides, Elem *parent, Elem **elemlinkdata, Node **nodelinkdata)
Definition: elem.h:1811
virtual unsigned int n_sides() const =0
const Elem * neighbor_ptr(unsigned int i) const
Definition: elem.h:2050
unsigned int level() const
Definition: elem.h:2521

◆ which_node_am_i()

unsigned int libMesh::Pyramid::which_node_am_i ( unsigned int  side,
unsigned int  side_node 
) const
overridevirtual
Returns
Pyramid5::side_nodes_map[side][side_node] after doing some range checking.

Implements libMesh::Elem.

Reimplemented in libMesh::Pyramid14, and libMesh::Pyramid13.

Definition at line 84 of file cell_pyramid.C.

References n_sides(), libMesh::Elem::side(), and libMesh::Pyramid5::side_nodes_map.

86 {
87  libmesh_assert_less (side, this->n_sides());
88 
89  // Never more than 4 nodes per side.
90  libmesh_assert_less(side_node, 4);
91 
92  // Some sides have 3 nodes.
93  libmesh_assert(side == 4 || side_node < 3);
94 
95  return Pyramid5::side_nodes_map[side][side_node];
96 }
virtual unsigned int n_sides() const override
Definition: cell_pyramid.h:83
static const unsigned int side_nodes_map[num_sides][nodes_per_side]
std::unique_ptr< Elem > side(const unsigned int i) const
Definition: elem.h:2202

◆ which_side_am_i()

unsigned int libMesh::Elem::which_side_am_i ( const Elem e) const
inlineinherited

This function tells you which side the boundary element e is. I.e. if e = a->build_side_ptr(s) or e = a->side_ptr(s); then a->which_side_am_i(e) will be s.

Note
An exact floating point comparison of the nodal positions of e is made with the nodal positions of this in order to perform this test. The idea is that the test will return a valid side id if e either directly shares Node pointers with this, or was created by exactly copying some of the nodes of this (e.g. through BoundaryMesh::sync()). In these circumstances, non-fuzzy floating point equality is expected.
Returns
The side of this the element which e is, otherwise invalid_uint.

Definition at line 2336 of file elem.h.

References libMesh::invalid_uint, libMesh::Elem::is_node_on_side(), libMesh::Elem::n_nodes(), libMesh::Elem::n_sides(), and libMesh::Elem::point().

2337 {
2338  libmesh_assert(e);
2339 
2340  const unsigned int ns = this->n_sides();
2341  const unsigned int nn = this->n_nodes();
2342 
2343  const unsigned int en = e->n_nodes();
2344 
2345  // e might be on any side until proven otherwise
2346  std::vector<bool> might_be_side(ns, true);
2347 
2348  for (unsigned int i=0; i != en; ++i)
2349  {
2350  Point side_point = e->point(i);
2351  unsigned int local_node_id = libMesh::invalid_uint;
2352 
2353  // Look for a node of this that's contiguous with node i of
2354  // e. Note that the exact floating point comparison of Point
2355  // positions is intentional, see the class documentation for
2356  // this function.
2357  for (unsigned int j=0; j != nn; ++j)
2358  if (this->point(j) == side_point)
2359  local_node_id = j;
2360 
2361  // If a node of e isn't contiguous with some node of this, then
2362  // e isn't a side of this.
2363  if (local_node_id == libMesh::invalid_uint)
2364  return libMesh::invalid_uint;
2365 
2366  // If a node of e isn't contiguous with some node on side s of
2367  // this, then e isn't on side s.
2368  for (unsigned int s=0; s != ns; ++s)
2369  if (!this->is_node_on_side(local_node_id, s))
2370  might_be_side[s] = false;
2371  }
2372 
2373  for (unsigned int s=0; s != ns; ++s)
2374  if (might_be_side[s])
2375  {
2376 #ifdef DEBUG
2377  for (unsigned int s2=s+1; s2 < ns; ++s2)
2378  libmesh_assert (!might_be_side[s2]);
2379 #endif
2380  return s;
2381  }
2382 
2383  // Didn't find any matching side
2384  return libMesh::invalid_uint;
2385 }
const unsigned int invalid_uint
Definition: libmesh.h:245
virtual bool is_node_on_side(const unsigned int n, const unsigned int s) const =0
virtual unsigned int n_nodes() const =0
virtual unsigned int n_sides() const =0
const Point & point(const unsigned int i) const
Definition: elem.h:1892

◆ write_connectivity()

void libMesh::Elem::write_connectivity ( std::ostream &  out,
const IOPackage  iop 
) const
inherited

Writes the element connectivity for various IO packages to the passed ostream "out". Not virtual, since it is implemented in the base class.

Definition at line 1360 of file elem.C.

References libMesh::Elem::_nodes, libMesh::Elem::connectivity(), libMesh::INVALID_IO_PACKAGE, libMesh::Elem::n_sub_elem(), libMesh::Elem::node_id(), libMesh::Elem::node_index_range(), libMesh::TECPLOT, and libMesh::UCD.

1362 {
1363  libmesh_assert (out_stream.good());
1364  libmesh_assert(_nodes);
1365  libmesh_assert_not_equal_to (iop, INVALID_IO_PACKAGE);
1366 
1367  switch (iop)
1368  {
1369  case TECPLOT:
1370  {
1371  // This connectivity vector will be used repeatedly instead
1372  // of being reconstructed inside the loop.
1373  std::vector<dof_id_type> conn;
1374  for (unsigned int sc=0; sc <this->n_sub_elem(); sc++)
1375  {
1376  this->connectivity(sc, TECPLOT, conn);
1377 
1378  std::copy(conn.begin(),
1379  conn.end(),
1380  std::ostream_iterator<dof_id_type>(out_stream, " "));
1381 
1382  out_stream << '\n';
1383  }
1384  return;
1385  }
1386 
1387  case UCD:
1388  {
1389  for (auto i : this->node_index_range())
1390  out_stream << this->node_id(i)+1 << "\t";
1391 
1392  out_stream << '\n';
1393  return;
1394  }
1395 
1396  default:
1397  libmesh_error_msg("Unsupported IO package " << iop);
1398  }
1399 }
Node ** _nodes
Definition: elem.h:1695
virtual void connectivity(const unsigned int sc, const IOPackage iop, std::vector< dof_id_type > &conn) const =0
IntRange< unsigned short > node_index_range() const
Definition: elem.h:2148
virtual unsigned int n_sub_elem() const =0
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:1914

Member Data Documentation

◆ _children

◆ _counts [1/2]

ReferenceCounter::Counts libMesh::ReferenceCounter::_counts
staticprotectedinherited

◆ _counts [2/2]

ReferenceCounter::Counts libMesh::ReferenceCounter::_counts
staticprotectedinherited

◆ _elemlinks

Elem** libMesh::Elem::_elemlinks
protectedinherited

Pointers to this element's parent and neighbors, and for lower-dimensional elements' interior_parent.

Definition at line 1701 of file elem.h.

Referenced by libMesh::Elem::Elem(), libMesh::Elem::interior_parent(), libMesh::Elem::neighbor_ptr(), libMesh::Elem::neighbor_ptr_range(), libMesh::Elem::parent(), libMesh::Elem::set_interior_parent(), libMesh::Elem::set_neighbor(), and libMesh::Elem::set_parent().

◆ _elemlinks_data

Elem* libMesh::Pyramid::_elemlinks_data[6+(LIBMESH_DIM >3)]
protected

Data for links to parent/neighbor/interior_parent elements.

Definition at line 151 of file cell_pyramid.h.

◆ _enable_print_counter [1/2]

bool libMesh::ReferenceCounter::_enable_print_counter = true
staticprotectedinherited

Flag to control whether reference count information is printed when print_info is called.

Definition at line 141 of file reference_counter.h.

Referenced by libMesh::ReferenceCounter::disable_print_counter_info(), libMesh::ReferenceCounter::enable_print_counter_info(), and libMesh::ReferenceCounter::print_info().

◆ _enable_print_counter [2/2]

bool libMesh::ReferenceCounter::_enable_print_counter = true
staticprotectedinherited

Flag to control whether reference count information is printed when print_info is called.

Definition at line 141 of file reference_counter.h.

Referenced by libMesh::ReferenceCounter::disable_print_counter_info(), libMesh::ReferenceCounter::enable_print_counter_info(), and libMesh::ReferenceCounter::print_info().

◆ _master_points

const Real libMesh::Pyramid::_master_points
staticprotected
Initial value:
=
{
{-1, -1, 0},
{1, -1, 0},
{1, 1, 0},
{-1, 1, 0},
{0, 0, 1},
{0, -1, 0},
{1, 0, 0},
{0, 1, 0},
{-1, 0, 0},
{0, -0.5, 0.5},
{0.5, 0, 0.5},
{0, 0.5, 0.5},
{-0.5, 0, 0.5}
}

Master element node locations

Definition at line 156 of file cell_pyramid.h.

Referenced by master_point().

◆ _mutex [1/2]

Threads::spin_mutex libMesh::ReferenceCounter::_mutex
staticprotectedinherited

Mutual exclusion object to enable thread-safe reference counting.

Definition at line 135 of file reference_counter.h.

◆ _mutex [2/2]

Threads::spin_mutex libMesh::ReferenceCounter::_mutex
staticprotectedinherited

Mutual exclusion object to enable thread-safe reference counting.

Definition at line 135 of file reference_counter.h.

◆ _n_objects [1/2]

Threads::atomic< unsigned int > libMesh::ReferenceCounter::_n_objects
staticprotectedinherited

The number of objects. Print the reference count information when the number returns to 0.

Definition at line 130 of file reference_counter.h.

Referenced by libMesh::ReferenceCounter::n_objects(), libMesh::ReferenceCounter::ReferenceCounter(), and libMesh::ReferenceCounter::~ReferenceCounter().

◆ _n_objects [2/2]

Threads::atomic< unsigned int > libMesh::ReferenceCounter::_n_objects
staticprotectedinherited

The number of objects. Print the reference count information when the number returns to 0.

Definition at line 130 of file reference_counter.h.

Referenced by libMesh::ReferenceCounter::n_objects(), libMesh::ReferenceCounter::ReferenceCounter(), and libMesh::ReferenceCounter::~ReferenceCounter().

◆ _nodes

◆ _p_level

unsigned char libMesh::Elem::_p_level
protectedinherited

p refinement level - the difference between the polynomial degree on this element and the minimum polynomial degree on the mesh. This is stored as an unsigned char to save space. In theory, these last four bytes might have been padding anyway.

Definition at line 1736 of file elem.h.

Referenced by libMesh::Elem::hack_p_level(), libMesh::Elem::max_descendant_p_level(), libMesh::Elem::p_level(), and libMesh::Elem::set_p_level().

◆ _pflag

unsigned char libMesh::Elem::_pflag
protectedinherited

p refinement flag. This is stored as an unsigned char to save space.

Definition at line 1726 of file elem.h.

Referenced by libMesh::Elem::p_refinement_flag(), and libMesh::Elem::set_p_refinement_flag().

◆ _rflag

unsigned char libMesh::Elem::_rflag
protectedinherited

h refinement flag. This is stored as an unsigned char to save space.

Definition at line 1720 of file elem.h.

Referenced by libMesh::Elem::refinement_flag(), and libMesh::Elem::set_refinement_flag().

◆ _sbd_id

subdomain_id_type libMesh::Elem::_sbd_id
protectedinherited

The subdomain to which this element belongs.

Definition at line 1713 of file elem.h.

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

◆ invalid_id

const dof_id_type libMesh::DofObject::invalid_id = static_cast<dof_id_type>(-1)
staticinherited

An invalid id to distinguish an uninitialized DofObject

Definition at line 347 of file dof_object.h.

Referenced by libMesh::DofMap::_dof_indices(), libMesh::Node::active(), libMesh::TopologyMap::add_node(), libMesh::MeshRefinement::add_node(), libMesh::ReplicatedMesh::add_point(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::Elem::bracketing_nodes(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_periodic_constraints(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_proj_constraints(), libMesh::DofMap::distribute_dofs(), libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::DofMap::dof_indices(), libMesh::DofObject::dof_number(), libMesh::TopologyMap::find(), libMesh::ReplicatedMesh::insert_node(), libMesh::DofObject::invalidate_dofs(), libMesh::DofObject::invalidate_id(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_object_ids(), libMesh::Elem::node_id(), libMesh::DofMap::old_dof_indices(), libMesh::DistributedMesh::own_node(), libMesh::Parallel::Packing< T >::pack(), libMesh::XdrIO::pack_element(), libMesh::SFCPartitioner::partition_range(), libMesh::Elem::point(), libMesh::System::read_legacy_data(), libMesh::System::read_parallel_data(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::DofMap::SCALAR_dof_indices(), libMesh::DofObject::set_dof_number(), libMesh::DofObject::set_n_comp_group(), libMesh::DofObject::set_n_vars_per_group(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::Parallel::sync_node_data_by_element_id_once(), libMesh::Parallel::Packing< T >::unpack(), libMesh::DofObject::valid_id(), and libMesh::System::write_parallel_data().

◆ invalid_processor_id

const processor_id_type libMesh::DofObject::invalid_processor_id = static_cast<processor_id_type>(-1)
staticinherited

An invalid processor_id to distinguish DoFs that have not been assigned to a processor.

Definition at line 358 of file dof_object.h.

Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::DistributedMesh::add_elem(), libMesh::DistributedMesh::add_node(), libMesh::MeshRefinement::add_node(), libMesh::MeshCommunication::allgather(), libMesh::Node::choose_processor_id(), libMesh::MeshTools::create_bounding_box(), libMesh::MeshTools::create_nodal_bounding_box(), libMesh::DistributedMesh::delete_elem(), libMesh::DistributedMesh::delete_node(), libMesh::Elem::Elem(), libMesh::MeshCommunication::find_global_indices(), libMesh::DistributedMesh::insert_elem(), libMesh::DofObject::invalidate_processor_id(), libMesh::MeshTools::libmesh_assert_consistent_distributed(), libMesh::MeshTools::libmesh_assert_consistent_distributed_nodes(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_object_ids(), libMesh::DistributedMesh::n_active_elem(), libMesh::MeshBase::n_elem_on_proc(), libMesh::MeshBase::n_nodes_on_proc(), libMesh::MeshBase::n_unpartitioned_elem(), libMesh::MeshBase::n_unpartitioned_nodes(), libMesh::SparsityPattern::Build::operator()(), libMesh::Partitioner::processor_pairs_to_interface_nodes(), libMesh::DistributedMesh::renumber_dof_objects(), libMesh::Partitioner::set_node_processor_ids(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::Partitioner::set_parent_processor_ids(), libMesh::Parallel::sync_dofobject_data_by_id(), libMesh::Parallel::sync_dofobject_data_by_xyz(), libMesh::Parallel::sync_element_data_by_parent_id(), libMesh::Parallel::sync_node_data_by_element_id_once(), libMesh::MeshTools::total_weight(), libMesh::Parallel::Packing< T >::unpack(), libMesh::DofObject::valid_processor_id(), and libMesh::CheckpointIO::write().

◆ invalid_subdomain_id

const subdomain_id_type libMesh::Elem::invalid_subdomain_id = std::numeric_limits<subdomain_id_type>::max()
staticinherited

A static integral constant representing an invalid subdomain id. See also DofObject::{invalid_id, invalid_unique_id, invalid_processor_id}.

Note
We don't use the static_cast(-1) trick here since subdomain_id_type is sometimes a signed integer for compatibility reasons (see libmesh/id_types.h).
Normally you can declare static const integral types directly in the header file (C++ standard, 9.4.2/4) but std::numeric_limits<T>::max() is not considered a "constant expression". This one is therefore defined in elem.C. http://stackoverflow.com/questions/2738435/using-numeric-limitsmax-in-constant-expressions

Definition at line 262 of file elem.h.

Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::BoundaryInfo::add_elements(), libMesh::MeshBase::get_id_by_name(), and libMesh::BoundaryInfo::sync().

◆ invalid_unique_id

const unique_id_type libMesh::DofObject::invalid_unique_id = static_cast<unique_id_type>(-1)
staticinherited

◆ max_n_nodes

const unsigned int libMesh::Elem::max_n_nodes = 27
staticinherited

The maximum number of nodes any element can contain. This is useful for replacing heap vectors with stack arrays.

Definition at line 600 of file elem.h.

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

◆ old_dof_object

◆ type_to_n_edges_map

const unsigned int libMesh::Elem::type_to_n_edges_map
staticinherited

This array maps the integer representation of the ElemType enum to the number of edges on the element.

Definition at line 669 of file elem.h.

Referenced by libMesh::Parallel::Packing< T >::packed_size().

◆ type_to_n_nodes_map

const unsigned int libMesh::Elem::type_to_n_nodes_map
staticinherited

This array maps the integer representation of the ElemType enum to the number of nodes in the element.

Definition at line 589 of file elem.h.

Referenced by libMesh::XdrIO::pack_element(), libMesh::Parallel::Packing< T >::packed_size(), libMesh::CheckpointIO::read_connectivity(), libMesh::XdrIO::read_serialized_connectivity(), and libMesh::Parallel::Packing< T >::unpack().

◆ type_to_n_sides_map

const unsigned int libMesh::Elem::type_to_n_sides_map
staticinherited

This array maps the integer representation of the ElemType enum to the number of sides on the element.

Definition at line 620 of file elem.h.

Referenced by libMesh::Parallel::Packing< T >::packed_size().


The documentation for this class was generated from the following files: