libMesh
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends | List of all members
libMesh::BoundaryInfo Class Reference

The BoundaryInfo class contains information relevant to boundary conditions including storing faces, edges, and nodes on the boundary, along with ids that can be used to identify the type of boundary each entity is part of. More...

#include <boundary_info.h>

Inheritance diagram for libMesh::BoundaryInfo:
[legend]

Public Types

enum  NodeBCTupleSortBy { NodeBCTupleSortBy::NODE_ID, NodeBCTupleSortBy::BOUNDARY_ID, NodeBCTupleSortBy::UNSORTED }
 
enum  BCTupleSortBy { BCTupleSortBy::ELEM_ID, BCTupleSortBy::SIDE_ID, BCTupleSortBy::BOUNDARY_ID, BCTupleSortBy::UNSORTED }
 
typedef std::tuple< dof_id_type, boundary_id_typeNodeBCTuple
 As above, but the library creates and fills in a vector of (node-id, bc-id) pairs and returns it to the user, taking advantage of guaranteed RVO. More...
 
typedef std::tuple< dof_id_type, unsigned short int, boundary_id_typeBCTuple
 As above, but the library creates and fills in a vector of (elem-id, side-id, bc-id) triplets and returns it to the user, taking advantage of guaranteed RVO. More...
 

Public Member Functions

BoundaryInfooperator= (const BoundaryInfo &other_boundary_info)
 Copy assignment operator. More...
 
bool operator== (const BoundaryInfo &other_boundary_info) const
 This tests for data equality via element ids. More...
 
bool operator!= (const BoundaryInfo &other_boundary_info) const
 
 ~BoundaryInfo ()
 Destructor. More...
 
void clear ()
 Clears the underlying data structures and restores the object to a pristine state with no data stored. More...
 
void regenerate_id_sets ()
 Clears and regenerates the cached sets of ids. More...
 
void sync (UnstructuredMesh &boundary_mesh)
 Generates boundary_mesh data structures corresponding to the mesh data structures. More...
 
void sync (const std::set< boundary_id_type > &requested_boundary_ids, UnstructuredMesh &boundary_mesh)
 Generates boundary_mesh data structures corresponding to the mesh data structures. More...
 
void sync (const std::set< boundary_id_type > &requested_boundary_ids, UnstructuredMesh &boundary_mesh, const std::set< subdomain_id_type > &subdomains_relative_to)
 Like the other sync() implementations, but specifically intended for building "boundary" meshes from internal sidesets. More...
 
void get_side_and_node_maps (UnstructuredMesh &boundary_mesh, std::map< dof_id_type, dof_id_type > &node_id_map, std::map< dof_id_type, unsigned char > &side_id_map, Real tolerance=1.e-6)
 Suppose we have used sync to create boundary_mesh. More...
 
void add_elements (const std::set< boundary_id_type > &requested_boundary_ids, UnstructuredMesh &boundary_mesh, bool store_parent_side_ids=false)
 Generates elements along the boundary of our _mesh, which use pre-existing nodes on the boundary_mesh, and which have interior_parent values properly defined. More...
 
void add_elements (const std::set< boundary_id_type > &requested_boundary_ids, UnstructuredMesh &boundary_mesh, const std::set< subdomain_id_type > &subdomains_relative_to, bool store_parent_side_ids=false)
 Same as the add_elements() function above, but takes a set of subdomains for which the sides must be relative to. More...
 
void add_node (const Node *node, const boundary_id_type id)
 Add Node node with boundary id id to the boundary information data structures. More...
 
void add_node (const dof_id_type node, const boundary_id_type id)
 Add node number node with boundary id id to the boundary information data structures. More...
 
void add_node (const Node *node, const std::vector< boundary_id_type > &ids)
 Add Node node with boundary ids ids to the boundary information data structure. More...
 
void clear_boundary_node_ids ()
 Clears all the boundary information from all of the nodes in the mesh. More...
 
void add_edge (const dof_id_type elem, const unsigned short int edge, const boundary_id_type id)
 Add edge edge of element number elem with boundary id id to the boundary information data structure. More...
 
void add_edge (const Elem *elem, const unsigned short int edge, const boundary_id_type id)
 Add edge edge of element elem with boundary id id to the boundary information data structure. More...
 
void add_edge (const Elem *elem, const unsigned short int edge, const std::vector< boundary_id_type > &ids)
 Add edge edge of element elem with boundary ids ids to the boundary information data structure. More...
 
void add_shellface (const dof_id_type elem, const unsigned short int shellface, const boundary_id_type id)
 Add shell face shellface of element number elem with boundary id id to the boundary information data structure. More...
 
void add_shellface (const Elem *elem, const unsigned short int shellface, const boundary_id_type id)
 Add shell face shellface of element elem with boundary id id to the boundary information data structure. More...
 
void add_shellface (const Elem *elem, const unsigned short int shellface, const std::vector< boundary_id_type > &ids)
 Add shell face shellface of element elem with boundary ids ids to the boundary information data structure. More...
 
void add_side (const dof_id_type elem, const unsigned short int side, const boundary_id_type id)
 Add side side of element number elem with boundary id id to the boundary information data structure. More...
 
void add_side (const Elem *elem, const unsigned short int side, const boundary_id_type id)
 Add side side of element elem with boundary id id to the boundary information data structure. More...
 
void add_side (const Elem *elem, const unsigned short int side, const std::vector< boundary_id_type > &ids)
 Add side side of element elem with boundary ids ids to the boundary information data structure. More...
 
void remove (const Node *node)
 Removes the boundary conditions associated with node node, if any exist. More...
 
void remove (const Elem *elem)
 Removes the boundary conditions associated with element elem, if any exist. More...
 
void remove_node (const Node *node, const boundary_id_type id)
 Removes boundary id id from node node, if it exists. More...
 
void remove_edge (const Elem *elem, const unsigned short int edge)
 Removes all boundary conditions associated with edge edge of element elem, if any exist. More...
 
void remove_edge (const Elem *elem, const unsigned short int edge, const boundary_id_type id)
 Removes the boundary id id from edge edge of element elem, if it exists. More...
 
void remove_shellface (const Elem *elem, const unsigned short int shellface)
 Removes all boundary conditions associated with shell face shellface of element elem, if any exist. More...
 
void remove_shellface (const Elem *elem, const unsigned short int shellface, const boundary_id_type id)
 Removes all boundary conditions associated with shell face shellface of element elem, if any exist. More...
 
void remove_side (const Elem *elem, const unsigned short int side)
 Removes all boundary conditions associated with side side of element elem, if any exist. More...
 
void remove_side (const Elem *elem, const unsigned short int side, const boundary_id_type id)
 Removes the boundary id id from side side of element elem, if it exists. More...
 
void clear_stitched_boundary_side_ids (boundary_id_type sideset_id, boundary_id_type other_sideset_id, bool clear_nodeset_data=false)
 Clear sideset information along a stitched mesh interface. More...
 
void remove_id (boundary_id_type id, bool global=false)
 Removes all entities (nodes, sides, edges, shellfaces) with boundary id id from their respective containers and erases any record of id's existence from the BoundaryInfo object. More...
 
void renumber_id (boundary_id_type old_id, boundary_id_type new_id)
 Changes all entities (nodes, sides, edges, shellfaces) with boundary id old_id to instead be labeled by boundary id new_id. More...
 
std::size_t n_boundary_ids () const
 
bool has_boundary_id (const Node *const node, const boundary_id_type id) const
 
void boundary_ids (const Node *node, std::vector< boundary_id_type > &vec_to_fill) const
 Fills a user-provided std::vector with the boundary ids associated with Node node. More...
 
unsigned int n_boundary_ids (const Node *node) const
 
unsigned int n_edge_boundary_ids (const Elem *const elem, const unsigned short int edge) const
 
void edge_boundary_ids (const Elem *const elem, const unsigned short int edge, std::vector< boundary_id_type > &vec_to_fill) const
 
void raw_edge_boundary_ids (const Elem *const elem, const unsigned short int edge, std::vector< boundary_id_type > &vec_to_fill) const
 
unsigned int n_shellface_boundary_ids (const Elem *const elem, const unsigned short int shellface) const
 
void shellface_boundary_ids (const Elem *const elem, const unsigned short int shellface, std::vector< boundary_id_type > &vec_to_fill) const
 
void raw_shellface_boundary_ids (const Elem *const elem, const unsigned short int shellface, std::vector< boundary_id_type > &vec_to_fill) const
 
bool has_boundary_id (const Elem *const elem, const unsigned short int side, const boundary_id_type id) const
 
unsigned int n_boundary_ids (const Elem *const elem, const unsigned short int side) const
 
unsigned int n_raw_boundary_ids (const Elem *const elem, const unsigned short int side) const
 
void boundary_ids (const Elem *const elem, const unsigned short int side, std::vector< boundary_id_type > &vec_to_fill) const
 
void raw_boundary_ids (const Elem *const elem, const unsigned short int side, std::vector< boundary_id_type > &vec_to_fill) const
 
void copy_boundary_ids (const BoundaryInfo &old_boundary_info, const Elem *const old_elem, const Elem *const new_elem)
 
unsigned int side_with_boundary_id (const Elem *const elem, const boundary_id_type boundary_id) const
 
std::vector< unsigned intsides_with_boundary_id (const Elem *const elem, const boundary_id_type boundary_id) const
 
void build_node_boundary_ids (std::vector< boundary_id_type > &b_ids) const
 Builds the list of unique node boundary ids. More...
 
void build_side_boundary_ids (std::vector< boundary_id_type > &b_ids) const
 Builds the list of unique side boundary ids. More...
 
void build_shellface_boundary_ids (std::vector< boundary_id_type > &b_ids) const
 Builds the list of unique shellface boundary ids. More...
 
void transfer_boundary_ids_from_children (const Elem *const parent)
 Update parent's boundary id list so that this information is consistent with its children. More...
 
std::size_t n_boundary_conds () const
 
std::size_t n_edge_conds () const
 
std::size_t n_shellface_conds () const
 
std::size_t n_nodeset_conds () const
 
void build_node_list (std::vector< dof_id_type > &node_id_list, std::vector< boundary_id_type > &bc_id_list) const
 Creates a list of nodes and ids for those nodes. More...
 
std::vector< NodeBCTuplebuild_node_list (NodeBCTupleSortBy sort_by=NodeBCTupleSortBy::NODE_ID) const
 
void build_node_list_from_side_list ()
 Adds nodes with boundary ids based on the side's boundary ids they are connected to. More...
 
void build_side_list_from_node_list ()
 Adds sides to a sideset if every node on that side are in the same sideset. More...
 
void build_side_list (std::vector< dof_id_type > &element_id_list, std::vector< unsigned short int > &side_list, std::vector< boundary_id_type > &bc_id_list) const
 Creates a list of element numbers, sides, and ids for those sides. More...
 
std::vector< BCTuplebuild_side_list (BCTupleSortBy sort_by=BCTupleSortBy::ELEM_ID) const
 
void build_active_side_list (std::vector< dof_id_type > &element_id_list, std::vector< unsigned short int > &side_list, std::vector< boundary_id_type > &bc_id_list) const
 Creates a list of active element numbers, sides, and ids for those sides. More...
 
std::vector< BCTuplebuild_active_side_list () const
 As above, but the library creates and fills in a vector of (elem-id, side-id, bc-id) triplets and returns it to the user, taking advantage of guaranteed RVO. More...
 
void build_edge_list (std::vector< dof_id_type > &element_id_list, std::vector< unsigned short int > &edge_list, std::vector< boundary_id_type > &bc_id_list) const
 Creates a list of element numbers, edges, and boundary ids for those edges. More...
 
std::vector< BCTuplebuild_edge_list () const
 As above, but the library creates and fills in a vector of (elem-id, side-id, bc-id) triplets and returns it to the user, taking advantage of guaranteed RVO. More...
 
void build_shellface_list (std::vector< dof_id_type > &element_id_list, std::vector< unsigned short int > &shellface_list, std::vector< boundary_id_type > &bc_id_list) const
 Creates a list of element numbers, shellfaces, and boundary ids for those shellfaces. More...
 
std::vector< BCTuplebuild_shellface_list () const
 As above, but the library creates and fills in a vector of (elem-id, side-id, bc-id) triplets and returns it to the user, taking advantage of guaranteed RVO. More...
 
void parallel_sync_side_ids ()
 Synchronize the boundary element side and node across processors. More...
 
void parallel_sync_node_ids ()
 
const std::set< boundary_id_type > & get_boundary_ids () const
 
const std::set< boundary_id_type > & get_global_boundary_ids () const
 
const std::set< boundary_id_type > & get_side_boundary_ids () const
 
const std::set< boundary_id_type > & get_edge_boundary_ids () const
 
const std::set< boundary_id_type > & get_shellface_boundary_ids () const
 
const std::set< boundary_id_type > & get_node_boundary_ids () const
 
void print_info (std::ostream &out_stream=libMesh::out) const
 Prints the boundary information data structure. More...
 
void print_summary (std::ostream &out_stream=libMesh::out) const
 Prints a summary of the boundary information. More...
 
const std::string & get_sideset_name (boundary_id_type id) const
 
std::string & sideset_name (boundary_id_type id)
 
const std::string & get_nodeset_name (boundary_id_type id) const
 
std::string & nodeset_name (boundary_id_type id)
 
const std::string & get_edgeset_name (boundary_id_type id) const
 
std::string & edgeset_name (boundary_id_type id)
 
boundary_id_type get_id_by_name (std::string_view name) const
 
std::map< boundary_id_type, std::string > & set_sideset_name_map ()
 
const std::map< boundary_id_type, std::string > & get_sideset_name_map () const
 
std::map< boundary_id_type, std::string > & set_nodeset_name_map ()
 
const std::map< boundary_id_type, std::string > & get_nodeset_name_map () const
 
std::map< boundary_id_type, std::string > & set_edgeset_name_map ()
 
const std::map< boundary_id_type, std::string > & get_edgeset_name_map () const
 
const std::multimap< const Node *, boundary_id_type > & get_nodeset_map () const
 
const std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > & get_edgeset_map () const
 
const std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > & get_sideset_map () const
 
bool is_children_on_boundary_side () const
 
void allow_children_on_boundary_side (const bool children_on_boundary)
 Whether or not to allow directly setting boundary sides on child elements. More...
 
const Parallel::Communicatorcomm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 

Static Public Attributes

static const boundary_id_type invalid_id = -123
 Number used for internal use. More...
 

Protected Member Functions

 BoundaryInfo (MeshBase &m)
 Constructor. More...
 
void set_mesh (MeshBase &m)
 

Protected Attributes

const Parallel::Communicator_communicator
 

Private Member Functions

void libmesh_assert_valid_multimaps () const
 Helper method for ensuring that our multimaps don't contain entries with duplicate keys and values. More...
 
void _find_id_maps (const std::set< boundary_id_type > &requested_boundary_ids, dof_id_type first_free_node_id, std::map< dof_id_type, dof_id_type > *node_id_map, dof_id_type first_free_elem_id, std::map< std::pair< dof_id_type, unsigned char >, dof_id_type > *side_id_map, const std::set< subdomain_id_type > &subdomains_relative_to)
 Helper method for finding consistent maps of interior to boundary dof_object ids. More...
 

Private Attributes

MeshBase_mesh
 A pointer to the Mesh this boundary info pertains to. More...
 
std::multimap< const Node *, boundary_id_type_boundary_node_id
 Data structure that maps nodes in the mesh to boundary ids. More...
 
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_edge_id
 Data structure that maps edges of elements to boundary ids. More...
 
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_shellface_id
 Data structure that maps faces of shell elements to boundary ids. More...
 
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_side_id
 Data structure that maps sides of elements to boundary ids. More...
 
bool _children_on_boundary
 
std::set< boundary_id_type_boundary_ids
 A collection of user-specified boundary ids for sides, edges, nodes, and shell faces. More...
 
std::set< boundary_id_type_global_boundary_ids
 A collection of user-specified boundary ids for sides, edges, nodes, and shell faces. More...
 
std::set< boundary_id_type_side_boundary_ids
 Set of user-specified boundary IDs for sides only. More...
 
std::set< boundary_id_type_edge_boundary_ids
 Set of user-specified boundary IDs for edges only. More...
 
std::set< boundary_id_type_node_boundary_ids
 Set of user-specified boundary IDs for nodes only. More...
 
std::set< boundary_id_type_shellface_boundary_ids
 Set of user-specified boundary IDs for shellfaces only. More...
 
std::map< boundary_id_type, std::string > _ss_id_to_name
 This structure maintains the mapping of named side sets for file formats (Exodus, Gmsh) that support this. More...
 
std::map< boundary_id_type, std::string > _ns_id_to_name
 This structure maintains the mapping of named node sets for file formats (Exodus, Gmsh) that support this. More...
 
std::map< boundary_id_type, std::string > _es_id_to_name
 This structure maintains the mapping of named edge sets for file formats (Exodus, Gmsh) that support this. More...
 

Friends

class MeshBase
 

Detailed Description

The BoundaryInfo class contains information relevant to boundary conditions including storing faces, edges, and nodes on the boundary, along with ids that can be used to identify the type of boundary each entity is part of.

It can also build a mesh that just includes boundary elements/faces.

Author
Benjamin S. Kirk
Date
2002 Used by the Mesh to keep track of boundary nodes and elements.

Definition at line 57 of file boundary_info.h.

Member Typedef Documentation

◆ BCTuple

typedef std::tuple<dof_id_type, unsigned short int, boundary_id_type> libMesh::BoundaryInfo::BCTuple

As above, but the library creates and fills in a vector of (elem-id, side-id, bc-id) triplets and returns it to the user, taking advantage of guaranteed RVO.

The returned vector is sorted by element id by default, but this can be changed by passing SIDE_ID, BOUNDARY_ID, or UNSORTED to this function. Note: choosing UNSORTED is not recommended since the resulting list will potentially be in different orders on different processors when running in parallel.

Definition at line 686 of file boundary_info.h.

◆ NodeBCTuple

As above, but the library creates and fills in a vector of (node-id, bc-id) pairs and returns it to the user, taking advantage of guaranteed RVO.

Note: we could use std::pairs for this, but for consistency with the other build_XYZ_list functions, we're using tuples.

The "sort_by" parameter controls how the resulting list of tuples is sorted. It is possible (but not recommended) to choose UNSORTED, since in that case the resulting vectors will potentially be in different orders on different procs.

Definition at line 643 of file boundary_info.h.

Member Enumeration Documentation

◆ BCTupleSortBy

Enumerator
ELEM_ID 
SIDE_ID 
BOUNDARY_ID 
UNSORTED 

Definition at line 687 of file boundary_info.h.

687 {ELEM_ID, SIDE_ID, BOUNDARY_ID, UNSORTED};

◆ NodeBCTupleSortBy

Enumerator
NODE_ID 
BOUNDARY_ID 
UNSORTED 

Definition at line 644 of file boundary_info.h.

644 {NODE_ID, BOUNDARY_ID, UNSORTED};

Constructor & Destructor Documentation

◆ BoundaryInfo()

libMesh::BoundaryInfo::BoundaryInfo ( MeshBase m)
protected

Constructor.

Takes a reference to the mesh. The BoundaryInfo class is only used internally by the Mesh class. A user should never instantiate this class. Therefore the constructor is protected.

Definition at line 102 of file boundary_info.C.

102  :
103  ParallelObject(m.comm()),
104  _mesh (&m),
105  _children_on_boundary(false)
106 {
107 }
ParallelObject(const Parallel::Communicator &comm_in)
Constructor.
MeshBase * _mesh
A pointer to the Mesh this boundary info pertains to.

◆ ~BoundaryInfo()

libMesh::BoundaryInfo::~BoundaryInfo ( )
default

Destructor.

Not much to do.

Member Function Documentation

◆ _find_id_maps()

void libMesh::BoundaryInfo::_find_id_maps ( const std::set< boundary_id_type > &  requested_boundary_ids,
dof_id_type  first_free_node_id,
std::map< dof_id_type, dof_id_type > *  node_id_map,
dof_id_type  first_free_elem_id,
std::map< std::pair< dof_id_type, unsigned char >, dof_id_type > *  side_id_map,
const std::set< subdomain_id_type > &  subdomains_relative_to 
)
private

Helper method for finding consistent maps of interior to boundary dof_object ids.

Either node_id_map or side_id_map can be nullptr, in which case it will not be filled.

Definition at line 3046 of file boundary_info.C.

References _boundary_side_id, _mesh, libMesh::as_range(), libMesh::ParallelObject::comm(), libMesh::DofObject::id(), invalid_id, libMesh::DofObject::invalid_processor_id, libMesh::Elem::invalid_subdomain_id, libMesh::libmesh_assert(), libMesh::ParallelObject::n_processors(), libMesh::Elem::neighbor_ptr(), libMesh::Elem::node_index_range(), libMesh::Elem::node_ref(), libMesh::ParallelObject::processor_id(), libMesh::DofObject::processor_id(), TIMPI::Communicator::set_union(), libMesh::Elem::side_index_range(), libMesh::Elem::subdomain_id(), and libMesh::Elem::top_parent().

Referenced by add_elements(), and sync().

3052 {
3053  // We'll do the same modulus trick that DistributedMesh uses to avoid
3054  // id conflicts between different processors
3055  dof_id_type
3056  next_node_id = first_free_node_id + this->processor_id(),
3057  next_elem_id = first_free_elem_id + this->processor_id();
3058 
3059  // For avoiding extraneous element side construction
3060  ElemSideBuilder side_builder;
3061  // Pull objects out of the loop to reduce heap operations
3062  const Elem * side;
3063 
3064  // We'll pass through the mesh once first to build
3065  // the maps and count boundary nodes and elements.
3066  // To find local boundary nodes, we have to examine all elements
3067  // here rather than just local elements, because it's possible to
3068  // have a local boundary node that's not on a local boundary
3069  // element, e.g. at the tip of a triangle.
3070 
3071  // We'll loop through two different ranges here: first all elements,
3072  // looking for local nodes, and second through unpartitioned
3073  // elements, looking for all remaining nodes.
3074  const MeshBase::const_element_iterator end_el = _mesh->elements_end();
3075  bool hit_end_el = false;
3076  const MeshBase::const_element_iterator end_unpartitioned_el =
3077  _mesh->pid_elements_end(DofObject::invalid_processor_id);
3078 
3079  for (MeshBase::const_element_iterator el = _mesh->elements_begin();
3080  !hit_end_el || (el != end_unpartitioned_el); ++el)
3081  {
3082  if ((el == end_el) && !hit_end_el)
3083  {
3084  // Note that we're done with local nodes and just looking
3085  // for remaining unpartitioned nodes
3086  hit_end_el = true;
3087 
3088  // Join up the local results from other processors
3089  if (side_id_map)
3090  this->comm().set_union(*side_id_map);
3091  if (node_id_map)
3092  this->comm().set_union(*node_id_map);
3093 
3094  // Finally we'll pass through any unpartitioned elements to add them
3095  // to the maps and counts.
3096  next_node_id = first_free_node_id + this->n_processors();
3097  next_elem_id = first_free_elem_id + this->n_processors();
3098 
3099  el = _mesh->pid_elements_begin(DofObject::invalid_processor_id);
3100  if (el == end_unpartitioned_el)
3101  break;
3102  }
3103 
3104  const Elem * elem = *el;
3105 
3106  // If the subdomains_relative_to container has the
3107  // invalid_subdomain_id, we fall back on the "old" behavior of
3108  // adding sides regardless of this Elem's subdomain. Otherwise,
3109  // if the subdomains_relative_to container doesn't contain the
3110  // current Elem's subdomain_id(), we won't add any sides from
3111  // it.
3112  if (!subdomains_relative_to.count(Elem::invalid_subdomain_id) &&
3113  !subdomains_relative_to.count(elem->subdomain_id()))
3114  continue;
3115 
3116  // Get the top-level parent for this element. This is used for
3117  // searching for boundary sides on this element.
3118  const Elem * top_parent = elem->top_parent();
3119 
3120  // Find all the boundary side ids for this Elem.
3121  auto bounds = _boundary_side_id.equal_range(top_parent);
3122 
3123  for (auto s : elem->side_index_range())
3124  {
3125  bool add_this_side = false;
3126  boundary_id_type this_bcid = invalid_id;
3127 
3128  for (const auto & pr : as_range(bounds))
3129  {
3130  this_bcid = pr.second.second;
3131 
3132  // if this side is flagged with a boundary condition
3133  // and the user wants this id
3134  if ((pr.second.first == s) &&
3135  (requested_boundary_ids.count(this_bcid)))
3136  {
3137  add_this_side = true;
3138  break;
3139  }
3140  }
3141 
3142  // We may still want to add this side if the user called
3143  // sync() with no requested_boundary_ids. This corresponds
3144  // to the "old" style of calling sync() in which the entire
3145  // boundary was copied to the BoundaryMesh, and handles the
3146  // case where elements on the geometric boundary are not in
3147  // any sidesets.
3148  if (bounds.first == bounds.second &&
3149  requested_boundary_ids.count(invalid_id) &&
3150  elem->neighbor_ptr(s) == nullptr)
3151  add_this_side = true;
3152 
3153  if (add_this_side)
3154  {
3155  // We only assign ids for our own and for
3156  // unpartitioned elements
3157  if (side_id_map &&
3158  ((elem->processor_id() == this->processor_id()) ||
3159  (elem->processor_id() ==
3161  {
3162  std::pair<dof_id_type, unsigned char> side_pair(elem->id(), s);
3163  libmesh_assert (!side_id_map->count(side_pair));
3164  (*side_id_map)[side_pair] = next_elem_id;
3165  next_elem_id += this->n_processors() + 1;
3166  }
3167 
3168  side = &side_builder(*elem, s);
3169  for (auto n : side->node_index_range())
3170  {
3171  const Node & node = side->node_ref(n);
3172 
3173  // In parallel we don't know enough to number
3174  // others' nodes ourselves.
3175  if (!hit_end_el &&
3176  (node.processor_id() != this->processor_id()))
3177  continue;
3178 
3179  dof_id_type node_id = node.id();
3180  if (node_id_map && !node_id_map->count(node_id))
3181  {
3182  (*node_id_map)[node_id] = next_node_id;
3183  next_node_id += this->n_processors() + 1;
3184  }
3185  }
3186  }
3187  }
3188  }
3189 
3190  // FIXME: ought to renumber side/node_id_map image to be contiguous
3191  // to save memory, also ought to reserve memory
3192 }
const Parallel::Communicator & comm() const
MeshBase * _mesh
A pointer to the Mesh this boundary info pertains to.
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_side_id
Data structure that maps sides of elements to boundary ids.
processor_id_type n_processors() const
static const subdomain_id_type invalid_subdomain_id
A static integral constant representing an invalid subdomain id.
Definition: elem.h:238
int8_t boundary_id_type
Definition: id_types.h:51
static const boundary_id_type invalid_id
Number used for internal use.
static const processor_id_type invalid_processor_id
An invalid processor_id to distinguish DoFs that have not been assigned to a processor.
Definition: dof_object.h:488
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
Helper function that allows us to treat a homogenous pair as a range.
Definition: simple_range.h:57
libmesh_assert(ctx)
processor_id_type processor_id() const
uint8_t dof_id_type
Definition: id_types.h:67
void set_union(T &data, const unsigned int root_id) const

◆ add_edge() [1/3]

void libMesh::BoundaryInfo::add_edge ( const dof_id_type  elem,
const unsigned short int  edge,
const boundary_id_type  id 
)

Add edge edge of element number elem with boundary id id to the boundary information data structure.

Edge-based boundary IDs should only be used in 3D.

Definition at line 955 of file boundary_info.C.

References _mesh, and libMesh::MeshBase::elem_ptr().

Referenced by copy_boundary_ids(), main(), libMesh::ExodusII_IO_Helper::read_edge_blocks(), libMesh::XdrIO::read_serialized_bcs_helper(), libMesh::UnstructuredMesh::stitching_helper(), libMesh::Elem::swap2boundaryedges(), SystemsTest::testBoundaryProjectCube(), BoundaryInfoTest::testEdgeBoundaryConditions(), and WriteEdgesetData::testWriteImpl().

958 {
959  this->add_edge (_mesh->elem_ptr(e), edge, id);
960 }
MeshBase * _mesh
A pointer to the Mesh this boundary info pertains to.
virtual const Elem * elem_ptr(const dof_id_type i) const =0
void add_edge(const dof_id_type elem, const unsigned short int edge, const boundary_id_type id)
Add edge edge of element number elem with boundary id id to the boundary information data structure...

◆ add_edge() [2/3]

void libMesh::BoundaryInfo::add_edge ( const Elem elem,
const unsigned short int  edge,
const boundary_id_type  id 
)

Add edge edge of element elem with boundary id id to the boundary information data structure.

Edge-based boundary IDs should only be used in 3D.

Definition at line 964 of file boundary_info.C.

References _boundary_edge_id, _boundary_ids, _edge_boundary_ids, libMesh::as_range(), invalid_id, libMesh::Elem::level(), libMesh::libmesh_assert(), and libMesh::Elem::n_edges().

967 {
968  libmesh_assert(elem);
969 
970  // Only add BCs for level-0 elements.
971  libmesh_assert_equal_to (elem->level(), 0);
972 
973  // Only add BCs for edges that exist.
974  libmesh_assert_less (edge, elem->n_edges());
975 
976  libmesh_error_msg_if(id == invalid_id,
977  "ERROR: You may not set a boundary ID of "
978  << invalid_id
979  << "\n That is reserved for internal use.");
980 
981  // Don't add the same ID twice
982  for (const auto & pr : as_range(_boundary_edge_id.equal_range(elem)))
983  if (pr.second.first == edge &&
984  pr.second.second == id)
985  return;
986 
987  _boundary_edge_id.emplace(elem, std::make_pair(edge, id));
988  _boundary_ids.insert(id);
989  _edge_boundary_ids.insert(id); // Also add this ID to the set of edge boundary IDs
990 }
std::set< boundary_id_type > _edge_boundary_ids
Set of user-specified boundary IDs for edges only.
std::set< boundary_id_type > _boundary_ids
A collection of user-specified boundary ids for sides, edges, nodes, and shell faces.
static const boundary_id_type invalid_id
Number used for internal use.
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
Helper function that allows us to treat a homogenous pair as a range.
Definition: simple_range.h:57
libmesh_assert(ctx)
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_edge_id
Data structure that maps edges of elements to boundary ids.

◆ add_edge() [3/3]

void libMesh::BoundaryInfo::add_edge ( const Elem elem,
const unsigned short int  edge,
const std::vector< boundary_id_type > &  ids 
)

Add edge edge of element elem with boundary ids ids to the boundary information data structure.

Edge-based boundary IDs should only be used in 3D.

Definition at line 994 of file boundary_info.C.

References _boundary_edge_id, _boundary_ids, _edge_boundary_ids, libMesh::as_range(), invalid_id, libMesh::Elem::level(), libMesh::libmesh_assert(), and libMesh::Elem::n_edges().

997 {
998  if (ids.empty())
999  return;
1000 
1001  libmesh_assert(elem);
1002 
1003  // Only add BCs for level-0 elements.
1004  libmesh_assert_equal_to (elem->level(), 0);
1005 
1006  // Only add BCs for edges that exist.
1007  libmesh_assert_less (edge, elem->n_edges());
1008 
1009  // Don't add the same ID twice
1010  auto bounds = _boundary_edge_id.equal_range(elem);
1011 
1012  // The entries in the ids vector may be non-unique. If we expected
1013  // *lots* of ids, it might be fastest to construct a std::set from
1014  // the entries, but for a small number of entries, which is more
1015  // typical, it is probably faster to copy the vector and do sort+unique.
1016  // http://stackoverflow.com/questions/1041620/whats-the-most-efficient-way-to-erase-duplicates-and-sort-a-vector
1017  std::vector<boundary_id_type> unique_ids(ids.begin(), ids.end());
1018  std::sort(unique_ids.begin(), unique_ids.end());
1019  std::vector<boundary_id_type>::iterator new_end =
1020  std::unique(unique_ids.begin(), unique_ids.end());
1021 
1022  for (auto & id : as_range(unique_ids.begin(), new_end))
1023  {
1024  libmesh_error_msg_if(id == invalid_id,
1025  "ERROR: You may not set a boundary ID of "
1026  << invalid_id
1027  << "\n That is reserved for internal use.");
1028 
1029  bool already_inserted = false;
1030  for (const auto & pr : as_range(bounds))
1031  if (pr.second.first == edge &&
1032  pr.second.second == id)
1033  {
1034  already_inserted = true;
1035  break;
1036  }
1037  if (already_inserted)
1038  continue;
1039 
1040  _boundary_edge_id.emplace(elem, std::make_pair(edge, id));
1041  _boundary_ids.insert(id);
1042  _edge_boundary_ids.insert(id); // Also add this ID to the set of edge boundary IDs
1043  }
1044 }
std::set< boundary_id_type > _edge_boundary_ids
Set of user-specified boundary IDs for edges only.
std::set< boundary_id_type > _boundary_ids
A collection of user-specified boundary ids for sides, edges, nodes, and shell faces.
static const boundary_id_type invalid_id
Number used for internal use.
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
Helper function that allows us to treat a homogenous pair as a range.
Definition: simple_range.h:57
libmesh_assert(ctx)
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_edge_id
Data structure that maps edges of elements to boundary ids.

◆ add_elements() [1/2]

void libMesh::BoundaryInfo::add_elements ( const std::set< boundary_id_type > &  requested_boundary_ids,
UnstructuredMesh boundary_mesh,
bool  store_parent_side_ids = false 
)

Generates elements along the boundary of our _mesh, which use pre-existing nodes on the boundary_mesh, and which have interior_parent values properly defined.

The boundary_mesh may be the same as the interior mesh; this generates a mesh with elements of mixed dimension.

Only boundary elements with the specified ids are created.

Definition at line 604 of file boundary_info.C.

References libMesh::Elem::invalid_subdomain_id.

Referenced by main(), and sync().

607 {
608  // Call the 3 argument version of this function with a dummy value for the third arg.
609  std::set<subdomain_id_type> subdomains_relative_to;
610  subdomains_relative_to.insert(Elem::invalid_subdomain_id);
611 
612  this->add_elements(requested_boundary_ids,
613  boundary_mesh,
614  subdomains_relative_to,
615  store_parent_side_ids);
616 }
void add_elements(const std::set< boundary_id_type > &requested_boundary_ids, UnstructuredMesh &boundary_mesh, bool store_parent_side_ids=false)
Generates elements along the boundary of our _mesh, which use pre-existing nodes on the boundary_mesh...
static const subdomain_id_type invalid_subdomain_id
A static integral constant representing an invalid subdomain id.
Definition: elem.h:238

◆ add_elements() [2/2]

void libMesh::BoundaryInfo::add_elements ( const std::set< boundary_id_type > &  requested_boundary_ids,
UnstructuredMesh boundary_mesh,
const std::set< subdomain_id_type > &  subdomains_relative_to,
bool  store_parent_side_ids = false 
)

Same as the add_elements() function above, but takes a set of subdomains for which the sides must be relative to.

This is necessary to avoid double-adding sides of internal sidesets to the BoundaryMesh.

Definition at line 620 of file boundary_info.C.

References _boundary_side_id, _find_id_maps(), _mesh, libMesh::MeshBase::add_elem(), libMesh::MeshBase::add_elem_integer(), libMesh::as_range(), libMesh::Elem::build_side_ptr(), libMesh::MeshBase::elem_ptr(), libMesh::DofObject::id(), libMesh::Elem::INACTIVE, invalid_id, libMesh::Elem::invalid_subdomain_id, libMesh::invalid_uint, libMesh::Elem::is_node_on_side(), libMesh::MeshBase::is_serial(), libMesh::libmesh_assert(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_ids(), libMesh::MeshCommunication::make_node_unique_ids_parallel_consistent(), libMesh::make_range(), libMesh::MeshBase::max_elem_id(), n_nodes, libMesh::Elem::n_nodes(), libMesh::Elem::n_sides(), libMesh::Elem::n_vertices(), libMesh::Elem::neighbor_ptr(), libMesh::Elem::node_ptr(), libMesh::MeshBase::parallel_max_unique_id(), libMesh::Elem::parent(), libMesh::Elem::point(), libMesh::ParallelObject::processor_id(), libMesh::DofObject::processor_id(), libMesh::remote_elem, libMesh::DofObject::set_extra_integer(), libMesh::Elem::set_interior_parent(), libMesh::Elem::set_neighbor(), libMesh::Elem::set_parent(), libMesh::Elem::side_index_range(), and libMesh::Elem::top_parent().

624 {
625  LOG_SCOPE("add_elements()", "BoundaryInfo");
626 
627  // We're not prepared to mix serial and distributed meshes in this
628  // method, so make sure they match from the start.
629  libmesh_assert_equal_to(_mesh->is_serial(),
630  boundary_mesh.is_serial());
631 
632  std::map<std::pair<dof_id_type, unsigned char>, dof_id_type> side_id_map;
633  this->_find_id_maps(requested_boundary_ids,
634  0,
635  nullptr,
636  boundary_mesh.max_elem_id(),
637  &side_id_map,
638  subdomains_relative_to);
639 
640  // We have to add sides *outside* any element loop, because if
641  // boundary_mesh and _mesh are the same then those additions can
642  // invalidate our element iterators. So we just use the element
643  // loop to make a list of sides to add.
644  typedef std::vector<std::pair<dof_id_type, unsigned char>>
645  side_container;
646  side_container sides_to_add;
647 
648  for (const auto & elem : _mesh->element_ptr_range())
649  {
650  // If the subdomains_relative_to container has the
651  // invalid_subdomain_id, we fall back on the "old" behavior of
652  // adding sides regardless of this Elem's subdomain. Otherwise,
653  // if the subdomains_relative_to container doesn't contain the
654  // current Elem's subdomain_id(), we won't add any sides from
655  // it.
656  if (!subdomains_relative_to.count(Elem::invalid_subdomain_id) &&
657  !subdomains_relative_to.count(elem->subdomain_id()))
658  continue;
659 
660  // Get the top-level parent for this element
661  const Elem * top_parent = elem->top_parent();
662 
663  // Find all the boundary side ids for this Elem.
664  auto bounds = _boundary_side_id.equal_range(top_parent);
665 
666  for (auto s : elem->side_index_range())
667  {
668  bool add_this_side = false;
669  boundary_id_type this_bcid = invalid_id;
670 
671  for (const auto & pr : as_range(bounds))
672  {
673  this_bcid = pr.second.second;
674 
675  // if this side is flagged with a boundary condition
676  // and the user wants this id
677  if ((pr.second.first == s) &&
678  (requested_boundary_ids.count(this_bcid)))
679  {
680  add_this_side = true;
681  break;
682  }
683  }
684 
685  // We may still want to add this side if the user called
686  // sync() with no requested_boundary_ids. This corresponds
687  // to the "old" style of calling sync() in which the entire
688  // boundary was copied to the BoundaryMesh, and handles the
689  // case where elements on the geometric boundary are not in
690  // any sidesets.
691  if (bounds.first == bounds.second &&
692  requested_boundary_ids.count(invalid_id) &&
693  elem->neighbor_ptr(s) == nullptr)
694  add_this_side = true;
695 
696  if (add_this_side)
697  sides_to_add.emplace_back(elem->id(), s);
698  }
699  }
700 
701 #ifdef LIBMESH_ENABLE_UNIQUE_ID
702  unique_id_type old_max_unique_id = boundary_mesh.parallel_max_unique_id();
703 #endif
704 
705  // Add an "extra" integer for storing the side index of the parent
706  // Elem which each boundary Elem corresponds to. We do this once
707  // before any Elems have been added.
708  unsigned int parent_side_index_tag = store_parent_side_ids ?
709  boundary_mesh.add_elem_integer("parent_side_index") : libMesh::invalid_uint;
710 
711  for (const auto & [elem_id, s] : sides_to_add)
712  {
713  Elem * elem = _mesh->elem_ptr(elem_id);
714 
715  // Build the side - do not use a "proxy" element here:
716  // This will be going into the boundary_mesh and needs to
717  // stand on its own.
718  std::unique_ptr<Elem> side (elem->build_side_ptr(s, false));
719 
720  side->processor_id() = elem->processor_id();
721 
722  const std::pair<dof_id_type, unsigned char> side_pair(elem_id, s);
723 
724  libmesh_assert(side_id_map.count(side_pair));
725 
726  const dof_id_type new_side_id = side_id_map[side_pair];
727 
728  side->set_id(new_side_id);
729 
730 #ifdef LIBMESH_ENABLE_UNIQUE_ID
731  side->set_unique_id(old_max_unique_id + new_side_id);
732 #endif
733 
734  // Add the side
735  Elem * new_elem = boundary_mesh.add_elem(std::move(side));
736 
737  // If requested, new_elem gets an "extra" integer equal to the
738  // side id "s" of the interior_parent it corresponds to.
739  if (store_parent_side_ids)
740  new_elem->set_extra_integer(parent_side_index_tag, s);
741 
742 #ifdef LIBMESH_ENABLE_AMR
743  // Set parent links
744  if (elem->parent())
745  {
746  const std::pair<dof_id_type, unsigned char> parent_side_pair(elem->parent()->id(), s);
747 
748  libmesh_assert(side_id_map.count(parent_side_pair));
749 
750  Elem * side_parent = boundary_mesh.elem_ptr(side_id_map[parent_side_pair]);
751 
752  libmesh_assert(side_parent);
753 
754  new_elem->set_parent(side_parent);
755 
756  side_parent->set_refinement_flag(Elem::INACTIVE);
757 
758  // Figuring out which child we are of our parent
759  // is a trick. Due to libMesh child numbering
760  // conventions, if we are an element on a vertex,
761  // then we share that vertex with our parent, with
762  // the same local index.
763  bool found_child = false;
764  for (auto v : make_range(new_elem->n_vertices()))
765  if (new_elem->node_ptr(v) == side_parent->node_ptr(v))
766  {
767  side_parent->add_child(new_elem, v);
768  found_child = true;
769  }
770 
771  // If we don't share any vertex with our parent,
772  // then we're the fourth child (index 3) of a
773  // triangle.
774  if (!found_child)
775  {
776  libmesh_assert_equal_to (new_elem->n_vertices(), 3);
777  side_parent->add_child(new_elem, 3);
778  }
779  }
780 #endif
781 
782  new_elem->set_interior_parent (elem);
783 
784  // On non-local elements on DistributedMesh we might have
785  // RemoteElem neighbor links to construct
786  if (!_mesh->is_serial() &&
787  (elem->processor_id() != this->processor_id()))
788  {
789  const unsigned short n_nodes = elem->n_nodes();
790 
791  const unsigned short bdy_n_sides = new_elem->n_sides();
792  const unsigned short bdy_n_nodes = new_elem->n_nodes();
793 
794  // Check every interior side for a RemoteElem
795  for (auto interior_side : elem->side_index_range())
796  {
797  // Might this interior side have a RemoteElem that
798  // needs a corresponding Remote on a boundary side?
799  if (elem->neighbor_ptr(interior_side) != remote_elem)
800  continue;
801 
802  // Which boundary side?
803  for (unsigned short boundary_side = 0;
804  boundary_side != bdy_n_sides; ++boundary_side)
805  {
806  // Look for matching node points. This is safe in
807  // *this* context.
808  bool found_all_nodes = true;
809  for (unsigned short boundary_node = 0;
810  boundary_node != bdy_n_nodes; ++boundary_node)
811  {
812  if (!new_elem->is_node_on_side(boundary_node,
813  boundary_side))
814  continue;
815 
816  bool found_this_node = false;
817  for (unsigned short interior_node = 0;
818  interior_node != n_nodes; ++interior_node)
819  {
820  if (!elem->is_node_on_side(interior_node,
821  interior_side))
822  continue;
823 
824  if (new_elem->point(boundary_node) ==
825  elem->point(interior_node))
826  {
827  found_this_node = true;
828  break;
829  }
830  }
831  if (!found_this_node)
832  {
833  found_all_nodes = false;
834  break;
835  }
836  }
837 
838  if (found_all_nodes)
839  {
840  new_elem->set_neighbor
841  (boundary_side,
842  const_cast<RemoteElem *>(remote_elem));
843  break;
844  }
845  }
846  }
847  }
848  }
849 
850  // We haven't been bothering to keep unique ids consistent on ghost
851  // elements
852  if (!boundary_mesh.is_serial())
853  MeshCommunication().make_node_unique_ids_parallel_consistent(boundary_mesh);
854 
855  // Make sure we didn't add ids inconsistently
856 #ifdef DEBUG
857 # ifdef LIBMESH_HAVE_RTTI
858  DistributedMesh * parmesh = dynamic_cast<DistributedMesh *>(&boundary_mesh);
859  if (parmesh)
860  parmesh->libmesh_assert_valid_parallel_ids();
861 # endif
862 #endif
863 }
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
Definition: libmesh.h:286
MeshBase * _mesh
A pointer to the Mesh this boundary info pertains to.
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_side_id
Data structure that maps sides of elements to boundary ids.
virtual bool is_serial() const
Definition: mesh_base.h:205
static const subdomain_id_type invalid_subdomain_id
A static integral constant representing an invalid subdomain id.
Definition: elem.h:238
const dof_id_type n_nodes
Definition: tecplot_io.C:67
int8_t boundary_id_type
Definition: id_types.h:51
static const boundary_id_type invalid_id
Number used for internal use.
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
Helper function that allows us to treat a homogenous pair as a range.
Definition: simple_range.h:57
libmesh_assert(ctx)
virtual const Elem * elem_ptr(const dof_id_type i) const =0
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
Definition: int_range.h:134
void _find_id_maps(const std::set< boundary_id_type > &requested_boundary_ids, dof_id_type first_free_node_id, std::map< dof_id_type, dof_id_type > *node_id_map, dof_id_type first_free_elem_id, std::map< std::pair< dof_id_type, unsigned char >, dof_id_type > *side_id_map, const std::set< subdomain_id_type > &subdomains_relative_to)
Helper method for finding consistent maps of interior to boundary dof_object ids. ...
processor_id_type processor_id() const
processor_id_type processor_id() const
Definition: dof_object.h:898
uint8_t unique_id_type
Definition: id_types.h:86
uint8_t dof_id_type
Definition: id_types.h:67
const RemoteElem * remote_elem
Definition: remote_elem.C:54

◆ add_node() [1/3]

void libMesh::BoundaryInfo::add_node ( const Node node,
const boundary_id_type  id 
)

Add Node node with boundary id id to the boundary information data structures.

Definition at line 884 of file boundary_info.C.

References _boundary_ids, _boundary_node_id, _node_boundary_ids, libMesh::as_range(), and invalid_id.

Referenced by libMesh::MeshTools::Subdivision::add_boundary_ghosts(), add_node(), libMesh::AbaqusIO::assign_boundary_node_ids(), libMesh::MeshTools::Generation::build_cube(), libMesh::MeshTools::Generation::build_extrusion(), build_node_list_from_side_list(), main(), libMesh::Nemesis_IO::read(), libMesh::ExodusII_IO::read(), libMesh::GmshIO::read_mesh(), libMesh::CheckpointIO::read_nodesets(), libMesh::XdrIO::read_serialized_nodesets(), libMesh::UnstructuredMesh::stitching_helper(), sync(), and SystemsTest::testBoundaryProjectCube().

886 {
887  libmesh_error_msg_if(id == invalid_id,
888  "ERROR: You may not set a boundary ID of "
889  << invalid_id
890  << "\n That is reserved for internal use.");
891 
892  // Don't add the same ID twice
893  for (const auto & pr : as_range(_boundary_node_id.equal_range(node)))
894  if (pr.second == id)
895  return;
896 
897  _boundary_node_id.emplace(node, id);
898  _boundary_ids.insert(id);
899  _node_boundary_ids.insert(id); // Also add this ID to the set of node boundary IDs
900 }
std::set< boundary_id_type > _node_boundary_ids
Set of user-specified boundary IDs for nodes only.
std::set< boundary_id_type > _boundary_ids
A collection of user-specified boundary ids for sides, edges, nodes, and shell faces.
static const boundary_id_type invalid_id
Number used for internal use.
std::multimap< const Node *, boundary_id_type > _boundary_node_id
Data structure that maps nodes in the mesh to boundary ids.
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
Helper function that allows us to treat a homogenous pair as a range.
Definition: simple_range.h:57

◆ add_node() [2/3]

void libMesh::BoundaryInfo::add_node ( const dof_id_type  node,
const boundary_id_type  id 
)

Add node number node with boundary id id to the boundary information data structures.

Definition at line 867 of file boundary_info.C.

References _mesh, add_node(), and libMesh::MeshBase::query_node_ptr().

869 {
870  const Node * node_ptr = _mesh->query_node_ptr(node_id);
871 
872  // The user could easily ask for an invalid node id, so let's throw
873  // an easy-to-understand error message when this happens.
874  libmesh_error_msg_if(!node_ptr,
875  "BoundaryInfo::add_node(): Could not retrieve pointer for node "
876  << node_id
877  << ", no boundary id was added.");
878 
879  this->add_node (node_ptr, id);
880 }
MeshBase * _mesh
A pointer to the Mesh this boundary info pertains to.
void add_node(const Node *node, const boundary_id_type id)
Add Node node with boundary id id to the boundary information data structures.
virtual const Node * query_node_ptr(const dof_id_type i) const =0

◆ add_node() [3/3]

void libMesh::BoundaryInfo::add_node ( const Node node,
const std::vector< boundary_id_type > &  ids 
)

Add Node node with boundary ids ids to the boundary information data structure.

Definition at line 904 of file boundary_info.C.

References _boundary_ids, _boundary_node_id, _node_boundary_ids, libMesh::as_range(), invalid_id, and libMesh::libmesh_assert().

906 {
907  if (ids.empty())
908  return;
909 
910  libmesh_assert(node);
911 
912  // Don't add the same ID twice
913  auto bounds = _boundary_node_id.equal_range(node);
914 
915  // The entries in the ids vector may be non-unique. If we expected
916  // *lots* of ids, it might be fastest to construct a std::set from
917  // the entries, but for a small number of entries, which is more
918  // typical, it is probably faster to copy the vector and do sort+unique.
919  // http://stackoverflow.com/questions/1041620/whats-the-most-efficient-way-to-erase-duplicates-and-sort-a-vector
920  std::vector<boundary_id_type> unique_ids(ids.begin(), ids.end());
921  std::sort(unique_ids.begin(), unique_ids.end());
922  std::vector<boundary_id_type>::iterator new_end =
923  std::unique(unique_ids.begin(), unique_ids.end());
924 
925  for (auto & id : as_range(unique_ids.begin(), new_end))
926  {
927  libmesh_error_msg_if(id == invalid_id,
928  "ERROR: You may not set a boundary ID of "
929  << invalid_id
930  << "\n That is reserved for internal use.");
931 
932  bool already_inserted = false;
933  for (const auto & pr : as_range(bounds))
934  if (pr.second == id)
935  {
936  already_inserted = true;
937  break;
938  }
939  if (already_inserted)
940  continue;
941 
942  _boundary_node_id.emplace(node, id);
943  _boundary_ids.insert(id);
944  _node_boundary_ids.insert(id); // Also add this ID to the set of node boundary IDs
945  }
946 }
std::set< boundary_id_type > _node_boundary_ids
Set of user-specified boundary IDs for nodes only.
std::set< boundary_id_type > _boundary_ids
A collection of user-specified boundary ids for sides, edges, nodes, and shell faces.
static const boundary_id_type invalid_id
Number used for internal use.
std::multimap< const Node *, boundary_id_type > _boundary_node_id
Data structure that maps nodes in the mesh to boundary ids.
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
Helper function that allows us to treat a homogenous pair as a range.
Definition: simple_range.h:57
libmesh_assert(ctx)

◆ add_shellface() [1/3]

void libMesh::BoundaryInfo::add_shellface ( const dof_id_type  elem,
const unsigned short int  shellface,
const boundary_id_type  id 
)

Add shell face shellface of element number elem with boundary id id to the boundary information data structure.

This is only relevant for shell elements.

Definition at line 1048 of file boundary_info.C.

References _mesh, and libMesh::MeshBase::elem_ptr().

Referenced by copy_boundary_ids(), libMesh::ExodusII_IO::read(), libMesh::XdrIO::read_serialized_bcs_helper(), libMesh::UnstructuredMesh::stitching_helper(), and BoundaryInfoTest::testShellFaceConstraints().

1051 {
1052  this->add_shellface (_mesh->elem_ptr(e), shellface, id);
1053 }
MeshBase * _mesh
A pointer to the Mesh this boundary info pertains to.
virtual const Elem * elem_ptr(const dof_id_type i) const =0
void add_shellface(const dof_id_type elem, const unsigned short int shellface, const boundary_id_type id)
Add shell face shellface of element number elem with boundary id id to the boundary information data ...

◆ add_shellface() [2/3]

void libMesh::BoundaryInfo::add_shellface ( const Elem elem,
const unsigned short int  shellface,
const boundary_id_type  id 
)

Add shell face shellface of element elem with boundary id id to the boundary information data structure.

This is only relevant for shell elements.

Definition at line 1057 of file boundary_info.C.

References _boundary_ids, _boundary_shellface_id, _shellface_boundary_ids, libMesh::as_range(), invalid_id, libMesh::Elem::level(), and libMesh::libmesh_assert().

1060 {
1061  libmesh_assert(elem);
1062 
1063  // Only add BCs for level-0 elements.
1064  libmesh_assert_equal_to (elem->level(), 0);
1065 
1066  // Shells only have 2 faces
1067  libmesh_assert_less(shellface, 2);
1068 
1069  libmesh_error_msg_if(id == invalid_id,
1070  "ERROR: You may not set a boundary ID of "
1071  << invalid_id
1072  << "\n That is reserved for internal use.");
1073 
1074  // Don't add the same ID twice
1075  for (const auto & pr : as_range(_boundary_shellface_id.equal_range(elem)))
1076  if (pr.second.first == shellface &&
1077  pr.second.second == id)
1078  return;
1079 
1080  _boundary_shellface_id.emplace(elem, std::make_pair(shellface, id));
1081  _boundary_ids.insert(id);
1082  _shellface_boundary_ids.insert(id); // Also add this ID to the set of shellface boundary IDs
1083 }
std::set< boundary_id_type > _boundary_ids
A collection of user-specified boundary ids for sides, edges, nodes, and shell faces.
static const boundary_id_type invalid_id
Number used for internal use.
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
Helper function that allows us to treat a homogenous pair as a range.
Definition: simple_range.h:57
libmesh_assert(ctx)
std::set< boundary_id_type > _shellface_boundary_ids
Set of user-specified boundary IDs for shellfaces only.
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_shellface_id
Data structure that maps faces of shell elements to boundary ids.

◆ add_shellface() [3/3]

void libMesh::BoundaryInfo::add_shellface ( const Elem elem,
const unsigned short int  shellface,
const std::vector< boundary_id_type > &  ids 
)

Add shell face shellface of element elem with boundary ids ids to the boundary information data structure.

This is only relevant for shell elements.

Definition at line 1087 of file boundary_info.C.

References _boundary_ids, _boundary_shellface_id, _shellface_boundary_ids, libMesh::as_range(), invalid_id, libMesh::Elem::level(), and libMesh::libmesh_assert().

1090 {
1091  if (ids.empty())
1092  return;
1093 
1094  libmesh_assert(elem);
1095 
1096  // Only add BCs for level-0 elements.
1097  libmesh_assert_equal_to (elem->level(), 0);
1098 
1099  // Shells only have 2 faces
1100  libmesh_assert_less(shellface, 2);
1101 
1102  // Don't add the same ID twice
1103  auto bounds = _boundary_shellface_id.equal_range(elem);
1104 
1105  // The entries in the ids vector may be non-unique. If we expected
1106  // *lots* of ids, it might be fastest to construct a std::set from
1107  // the entries, but for a small number of entries, which is more
1108  // typical, it is probably faster to copy the vector and do sort+unique.
1109  // http://stackoverflow.com/questions/1041620/whats-the-most-efficient-way-to-erase-duplicates-and-sort-a-vector
1110  std::vector<boundary_id_type> unique_ids(ids.begin(), ids.end());
1111  std::sort(unique_ids.begin(), unique_ids.end());
1112  std::vector<boundary_id_type>::iterator new_end =
1113  std::unique(unique_ids.begin(), unique_ids.end());
1114 
1115  for (auto & id : as_range(unique_ids.begin(), new_end))
1116  {
1117  libmesh_error_msg_if(id == invalid_id,
1118  "ERROR: You may not set a boundary ID of "
1119  << invalid_id
1120  << "\n That is reserved for internal use.");
1121 
1122  bool already_inserted = false;
1123  for (const auto & pr : as_range(bounds))
1124  if (pr.second.first == shellface &&
1125  pr.second.second == id)
1126  {
1127  already_inserted = true;
1128  break;
1129  }
1130  if (already_inserted)
1131  continue;
1132 
1133  _boundary_shellface_id.emplace(elem, std::make_pair(shellface, id));
1134  _boundary_ids.insert(id);
1135  _shellface_boundary_ids.insert(id); // Also add this ID to the set of shellface boundary IDs
1136  }
1137 }
std::set< boundary_id_type > _boundary_ids
A collection of user-specified boundary ids for sides, edges, nodes, and shell faces.
static const boundary_id_type invalid_id
Number used for internal use.
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
Helper function that allows us to treat a homogenous pair as a range.
Definition: simple_range.h:57
libmesh_assert(ctx)
std::set< boundary_id_type > _shellface_boundary_ids
Set of user-specified boundary IDs for shellfaces only.
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_shellface_id
Data structure that maps faces of shell elements to boundary ids.

◆ add_side() [1/3]

void libMesh::BoundaryInfo::add_side ( const dof_id_type  elem,
const unsigned short int  side,
const boundary_id_type  id 
)

Add side side of element number elem with boundary id id to the boundary information data structure.

Definition at line 1140 of file boundary_info.C.

References _mesh, and libMesh::MeshBase::elem_ptr().

Referenced by libMesh::MeshTools::Subdivision::all_subdivision(), libMesh::MeshTools::Modification::all_tri(), libMesh::AbaqusIO::assign_sideset_ids(), libMesh::MeshTools::Generation::build_cube(), libMesh::MeshTools::Generation::build_delaunay_square(), libMesh::MeshTools::Generation::build_extrusion(), BoundaryMeshTest::build_mesh(), build_side_list_from_node_list(), copy_boundary_ids(), libMesh::TriangleWrapper::copy_tri_to_mesh(), libMesh::UnstructuredMesh::create_submesh(), libMesh::MeshTools::Modification::flatten(), libMesh::UNVIO::groups_in(), libMesh::Poly2TriTriangulator::insert_refinement_points(), main(), libMesh::Nemesis_IO::read(), libMesh::ExodusII_IO::read(), libMesh::CheckpointIO::read_bcs(), libMesh::GmshIO::read_mesh(), libMesh::XdrIO::read_serialized_bcs_helper(), libMesh::UnstructuredMesh::stitching_helper(), libMesh::Elem::swap2boundarysides(), BoundaryInfoTest::testBoundaryOnChildrenBoundaryIDs(), BoundaryInfoTest::testBoundaryOnChildrenBoundarySides(), BoundaryInfoTest::testBoundaryOnChildrenElementsRefineCoarsen(), BoundaryInfoTest::testBoundaryOnChildrenErrors(), PeriodicBCTest::testPeriodicBC(), transfer_boundary_ids_from_children(), and libMesh::Poly2TriTriangulator::triangulate_current_points().

1143 {
1144  this->add_side (_mesh->elem_ptr(e), side, id);
1145 }
MeshBase * _mesh
A pointer to the Mesh this boundary info pertains to.
virtual const Elem * elem_ptr(const dof_id_type i) const =0
void add_side(const dof_id_type elem, const unsigned short int side, const boundary_id_type id)
Add side side of element number elem with boundary id id to the boundary information data structure...

◆ add_side() [2/3]

void libMesh::BoundaryInfo::add_side ( const Elem elem,
const unsigned short int  side,
const boundary_id_type  id 
)

Add side side of element elem with boundary id id to the boundary information data structure.

Definition at line 1149 of file boundary_info.C.

References _boundary_ids, _boundary_side_id, _children_on_boundary, _side_boundary_ids, libMesh::as_range(), boundary_ids(), invalid_id, libMesh::Elem::level(), libMesh::libmesh_assert(), and libMesh::Elem::n_sides().

1152 {
1153  libmesh_assert(elem);
1154 
1155  // Only add BCs for sides that exist.
1156  libmesh_assert_less (side, elem->n_sides());
1157 
1158  libmesh_error_msg_if(id == invalid_id, "ERROR: You may not set a boundary ID of "
1159  << invalid_id
1160  << "\n That is reserved for internal use.");
1161 
1162  // Don't add the same ID twice
1163  for (const auto & pr : as_range(_boundary_side_id.equal_range(elem)))
1164  if (pr.second.first == side &&
1165  pr.second.second == id)
1166  return;
1167 
1168 #ifdef LIBMESH_ENABLE_AMR
1169  // Users try to mark boundary on child elements
1170  // If this happens, we will allow users to remove
1171  // side from child elements as well
1172  if (elem->level())
1173  {
1174  _children_on_boundary = true;
1175 
1176  // Here we have to stop and check if we already have this boundary defined on the
1177  // parent (if yes, no need to add)
1178  std::vector<boundary_id_type> bd_ids;
1179  this->boundary_ids(elem,side,bd_ids);
1180 
1181  if(std::find(bd_ids.begin(), bd_ids.end(), id) != bd_ids.end())
1182  libmesh_not_implemented_msg("Trying to add boundary ID "
1183  + std::to_string(id)
1184  + " which already exists on the ancestors.");
1185  }
1186 #endif
1187 
1188  _boundary_side_id.emplace(elem, std::make_pair(side, id));
1189  _boundary_ids.insert(id);
1190  _side_boundary_ids.insert(id); // Also add this ID to the set of side boundary IDs
1191 }
std::set< boundary_id_type > _boundary_ids
A collection of user-specified boundary ids for sides, edges, nodes, and shell faces.
std::set< boundary_id_type > _side_boundary_ids
Set of user-specified boundary IDs for sides only.
void boundary_ids(const Node *node, std::vector< boundary_id_type > &vec_to_fill) const
Fills a user-provided std::vector with the boundary ids associated with Node node.
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_side_id
Data structure that maps sides of elements to boundary ids.
static const boundary_id_type invalid_id
Number used for internal use.
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
Helper function that allows us to treat a homogenous pair as a range.
Definition: simple_range.h:57
libmesh_assert(ctx)

◆ add_side() [3/3]

void libMesh::BoundaryInfo::add_side ( const Elem elem,
const unsigned short int  side,
const std::vector< boundary_id_type > &  ids 
)

Add side side of element elem with boundary ids ids to the boundary information data structure.

Definition at line 1195 of file boundary_info.C.

References _boundary_ids, _boundary_side_id, _children_on_boundary, _side_boundary_ids, libMesh::as_range(), boundary_ids(), invalid_id, libMesh::Elem::level(), libMesh::libmesh_assert(), and libMesh::Elem::n_sides().

1198 {
1199  if (ids.empty())
1200  return;
1201 
1202  libmesh_assert(elem);
1203 
1204  // Only add BCs for sides that exist.
1205  libmesh_assert_less (side, elem->n_sides());
1206 
1207 #ifdef LIBMESH_ENABLE_AMR
1208  // Users try to mark boundary on child elements
1209  // If this happens, we will allow users to remove
1210  // side from child elements as well
1211  if (elem->level())
1212  {
1213  _children_on_boundary = true;
1214 
1215  // Here we have to stop and check if we already have this boundary defined on the
1216  // parent (if yes, no need to add)
1217  std::vector<boundary_id_type> bd_ids;
1218  this->boundary_ids(elem,side,bd_ids);
1219 
1220  for (const auto id : ids)
1221  if(std::find(bd_ids.begin(), bd_ids.end(), id) != bd_ids.end())
1222  libmesh_not_implemented_msg("Trying to add boundary ID "
1223  + std::to_string(id)
1224  + " which already exists on the ancestors.");
1225  }
1226 #endif
1227 
1228  // Don't add the same ID twice
1229  auto bounds = _boundary_side_id.equal_range(elem);
1230 
1231  // The entries in the ids vector may be non-unique. If we expected
1232  // *lots* of ids, it might be fastest to construct a std::set from
1233  // the entries, but for a small number of entries, which is more
1234  // typical, it is probably faster to copy the vector and do sort+unique.
1235  // http://stackoverflow.com/questions/1041620/whats-the-most-efficient-way-to-erase-duplicates-and-sort-a-vector
1236  std::vector<boundary_id_type> unique_ids(ids.begin(), ids.end());
1237  std::sort(unique_ids.begin(), unique_ids.end());
1238  std::vector<boundary_id_type>::iterator new_end =
1239  std::unique(unique_ids.begin(), unique_ids.end());
1240 
1241  for (auto & id : as_range(unique_ids.begin(), new_end))
1242  {
1243  libmesh_error_msg_if(id == invalid_id,
1244  "ERROR: You may not set a boundary ID of "
1245  << invalid_id
1246  << "\n That is reserved for internal use.");
1247 
1248  bool already_inserted = false;
1249  for (const auto & pr : as_range(bounds))
1250  if (pr.second.first == side && pr.second.second == id)
1251  {
1252  already_inserted = true;
1253  break;
1254  }
1255  if (already_inserted)
1256  continue;
1257 
1258  _boundary_side_id.emplace(elem, std::make_pair(side, id));
1259  _boundary_ids.insert(id);
1260  _side_boundary_ids.insert(id); // Also add this ID to the set of side boundary IDs
1261  }
1262 }
std::set< boundary_id_type > _boundary_ids
A collection of user-specified boundary ids for sides, edges, nodes, and shell faces.
std::set< boundary_id_type > _side_boundary_ids
Set of user-specified boundary IDs for sides only.
void boundary_ids(const Node *node, std::vector< boundary_id_type > &vec_to_fill) const
Fills a user-provided std::vector with the boundary ids associated with Node node.
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_side_id
Data structure that maps sides of elements to boundary ids.
static const boundary_id_type invalid_id
Number used for internal use.
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
Helper function that allows us to treat a homogenous pair as a range.
Definition: simple_range.h:57
libmesh_assert(ctx)

◆ allow_children_on_boundary_side()

void libMesh::BoundaryInfo::allow_children_on_boundary_side ( const bool  children_on_boundary)
inline

Whether or not to allow directly setting boundary sides on child elements.

Definition at line 923 of file boundary_info.h.

References _children_on_boundary.

Referenced by BoundaryInfoTest::testBoundaryOnChildrenErrors().

924  { _children_on_boundary = children_on_boundary; }

◆ boundary_ids() [1/2]

void libMesh::BoundaryInfo::boundary_ids ( const Node node,
std::vector< boundary_id_type > &  vec_to_fill 
) const

Fills a user-provided std::vector with the boundary ids associated with Node node.

Definition at line 1278 of file boundary_info.C.

References _boundary_node_id, and libMesh::as_range().

Referenced by add_side(), libMesh::MeshTools::Subdivision::all_subdivision(), libMesh::MeshTools::Modification::all_tri(), assemble_elasticity(), AssemblyA0::boundary_assembly(), AssemblyA1::boundary_assembly(), AssemblyA2::boundary_assembly(), libMesh::MeshTools::Generation::build_cube(), libMesh::MeshTools::Generation::build_extrusion(), build_node_list_from_side_list(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_periodic_constraints(), libMesh::UnstructuredMesh::create_submesh(), libMesh::MeshTools::Modification::flatten(), has_boundary_id(), libMesh::Poly2TriTriangulator::insert_refinement_points(), libMesh::Poly2TriTriangulator::is_refine_boundary_allowed(), main(), libMesh::TriangulatorInterface::MeshedHole::MeshedHole(), n_boundary_ids(), libMesh::GhostPointNeighbors::operator()(), libMesh::BoundaryProjectSolution::operator()(), operator==(), remove_side(), libMesh::FEMContext::side_boundary_ids(), libMesh::UnstructuredMesh::stitching_helper(), libMesh::Elem::swap2boundarysides(), sync(), ElemTest< elem_type >::test_flip(), ElemTest< elem_type >::test_orient(), ElemTest< elem_type >::test_orient_elements(), BoundaryInfoTest::testBoundaryOnChildrenBoundaryIDs(), SystemsTest::testBoundaryProjectCube(), MeshInputTest::testExodusIGASidesets(), libMesh::XdrIO::write_serialized_bcs_helper(), and libMesh::XdrIO::write_serialized_nodesets().

1280 {
1281  // Clear out any previous contents
1282  vec_to_fill.clear();
1283 
1284  for (const auto & pr : as_range(_boundary_node_id.equal_range(node)))
1285  vec_to_fill.push_back(pr.second);
1286 }
std::multimap< const Node *, boundary_id_type > _boundary_node_id
Data structure that maps nodes in the mesh to boundary ids.
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
Helper function that allows us to treat a homogenous pair as a range.
Definition: simple_range.h:57

◆ boundary_ids() [2/2]

void libMesh::BoundaryInfo::boundary_ids ( const Elem *const  elem,
const unsigned short int  side,
std::vector< boundary_id_type > &  vec_to_fill 
) const
Returns
The list of boundary ids associated with the side side of element elem.

Definition at line 1471 of file boundary_info.C.

References _boundary_side_id, _children_on_boundary, libMesh::as_range(), libMesh::Elem::is_child_on_side(), libMesh::Elem::level(), libMesh::libmesh_assert(), libMesh::Elem::n_sides(), libMesh::Elem::neighbor_ptr(), libMesh::Elem::parent(), libMesh::Elem::top_parent(), and libMesh::Elem::which_child_am_i().

1474 {
1475  libmesh_assert(elem);
1476 
1477  // Only query BCs for sides that exist.
1478  libmesh_assert_less (side, elem->n_sides());
1479 
1480  // Clear out any previous contents
1481  vec_to_fill.clear();
1482 
1483  // In most cases only level-0 elements store BCs.
1484  // In certain application (such as time-dependent domains), however, children
1485  // need to store BCs too. This case is covered with the _children_on_boundary
1486  // flag.
1487  const Elem * searched_elem = elem;
1488 
1489 #ifdef LIBMESH_ENABLE_AMR
1490 
1491  if (elem->level() != 0)
1492  {
1493  // If we have children on the boundaries, we need to search for boundary IDs on the
1494  // child and its ancestors too if they share the side.
1496  {
1497  // Loop over ancestors to check if they have boundary ids on the same side
1498  while (searched_elem)
1499  {
1500  for (const auto & pr : as_range(_boundary_side_id.equal_range(searched_elem)))
1501  // Here we need to check if the boundary id already exists
1502  if (pr.second.first == side &&
1503  std::find(vec_to_fill.begin(), vec_to_fill.end(), pr.second.second) ==
1504  vec_to_fill.end())
1505  vec_to_fill.push_back(pr.second.second);
1506 
1507 
1508  const Elem * parent = searched_elem->parent();
1509  // If the parent doesn't exist or if the child is not on the correct side of the
1510  // parent we are done checking the ancestors
1511  if (!parent || parent->is_child_on_side(parent->which_child_am_i(searched_elem), side) == false)
1512  return;
1513 
1514  searched_elem = parent;
1515  }
1516 
1517  return;
1518  }
1519 
1520  // If we don't have children on boundaries and we are on an external boundary,
1521  // we just look for the top parent
1522  if (elem->neighbor_ptr(side) == nullptr)
1523  searched_elem = elem->top_parent();
1524  // Otherwise we loop over the ancestors and check if they have a different BC for us
1525  else
1526  while (searched_elem->parent() != nullptr)
1527  {
1528  const Elem * parent = searched_elem->parent();
1529  if (parent->is_child_on_side(parent->which_child_am_i(searched_elem), side) == false)
1530  return;
1531 
1532  searched_elem = parent;
1533  }
1534  }
1535 
1536 #endif
1537 
1538  // Check each element in the range to see if its side matches the requested side.
1539  for (const auto & pr : as_range(_boundary_side_id.equal_range(searched_elem)))
1540  if (pr.second.first == side)
1541  vec_to_fill.push_back(pr.second.second);
1542 }
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_side_id
Data structure that maps sides of elements to boundary ids.
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
Helper function that allows us to treat a homogenous pair as a range.
Definition: simple_range.h:57
libmesh_assert(ctx)

◆ build_active_side_list() [1/2]

void libMesh::BoundaryInfo::build_active_side_list ( std::vector< dof_id_type > &  element_id_list,
std::vector< unsigned short int > &  side_list,
std::vector< boundary_id_type > &  bc_id_list 
) const

Creates a list of active element numbers, sides, and ids for those sides.

On a ReplicatedMesh this will include all sides; on a DistributedMesh only sides of semilocal elements will be included.

Definition at line 2670 of file boundary_info.C.

References build_active_side_list().

2673 {
2674  libmesh_deprecated();
2675 
2676  // Call the non-deprecated version of this function.
2677  auto bc_tuples = this->build_active_side_list();
2678 
2679  // Clear the input vectors, just in case they were used for
2680  // something else recently...
2681  el.clear();
2682  sl.clear();
2683  il.clear();
2684 
2685  // Reserve the size, then use push_back
2686  el.reserve (bc_tuples.size());
2687  sl.reserve (bc_tuples.size());
2688  il.reserve (bc_tuples.size());
2689 
2690  for (const auto & t : bc_tuples)
2691  {
2692  el.push_back(std::get<0>(t));
2693  sl.push_back(std::get<1>(t));
2694  il.push_back(std::get<2>(t));
2695  }
2696 }
std::vector< BCTuple > build_active_side_list() const
As above, but the library creates and fills in a vector of (elem-id, side-id, bc-id) triplets and ret...

◆ build_active_side_list() [2/2]

std::vector< BoundaryInfo::BCTuple > libMesh::BoundaryInfo::build_active_side_list ( ) const

As above, but the library creates and fills in a vector of (elem-id, side-id, bc-id) triplets and returns it to the user, taking advantage of guaranteed RVO.

Definition at line 2701 of file boundary_info.C.

References _boundary_side_id.

Referenced by build_active_side_list().

2702 {
2703  std::vector<BCTuple> bc_triples;
2704  bc_triples.reserve(_boundary_side_id.size());
2705 
2706  for (const auto & [elem, id_pair] : _boundary_side_id)
2707  {
2708  // Don't add remote sides
2709  if (elem->is_remote())
2710  continue;
2711 
2712  // Loop over the sides of possible children
2713  std::vector<const Elem *> family;
2714 #ifdef LIBMESH_ENABLE_AMR
2715  elem->active_family_tree_by_side(family, id_pair.first);
2716 #else
2717  family.push_back(elem);
2718 #endif
2719 
2720  // Populate the list items
2721  for (const auto & f : family)
2722  bc_triples.emplace_back(f->id(), id_pair.first, id_pair.second);
2723  }
2724 
2725  // This list is currently in memory address (arbitrary) order, so
2726  // sort to make it consistent on all procs.
2727  std::sort(bc_triples.begin(), bc_triples.end());
2728 
2729  return bc_triples;
2730 }
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_side_id
Data structure that maps sides of elements to boundary ids.

◆ build_edge_list() [1/2]

void libMesh::BoundaryInfo::build_edge_list ( std::vector< dof_id_type > &  element_id_list,
std::vector< unsigned short int > &  edge_list,
std::vector< boundary_id_type > &  bc_id_list 
) const

Creates a list of element numbers, edges, and boundary ids for those edges.

On a ReplicatedMesh this will include all edges; on a DistributedMesh only edges of semilocal elements will be included.

Definition at line 2734 of file boundary_info.C.

References build_edge_list().

Referenced by libMesh::UnstructuredMesh::stitching_helper(), MeshInputTest::testLowOrderEdgeBlocks(), WriteEdgesetData::testWriteImpl(), and libMesh::ExodusII_IO_Helper::write_elements().

2737 {
2738  libmesh_deprecated();
2739 
2740  // Call the non-deprecated version of this function.
2741  auto bc_tuples = this->build_edge_list();
2742 
2743  // Clear the input vectors, just in case they were used for
2744  // something else recently...
2745  el.clear();
2746  sl.clear();
2747  il.clear();
2748 
2749  // Reserve the size, then use push_back
2750  el.reserve (bc_tuples.size());
2751  sl.reserve (bc_tuples.size());
2752  il.reserve (bc_tuples.size());
2753 
2754  for (const auto & t : bc_tuples)
2755  {
2756  el.push_back(std::get<0>(t));
2757  sl.push_back(std::get<1>(t));
2758  il.push_back(std::get<2>(t));
2759  }
2760 }
std::vector< BCTuple > build_edge_list() const
As above, but the library creates and fills in a vector of (elem-id, side-id, bc-id) triplets and ret...

◆ build_edge_list() [2/2]

std::vector< BoundaryInfo::BCTuple > libMesh::BoundaryInfo::build_edge_list ( ) const

As above, but the library creates and fills in a vector of (elem-id, side-id, bc-id) triplets and returns it to the user, taking advantage of guaranteed RVO.

Definition at line 2765 of file boundary_info.C.

References _boundary_edge_id.

Referenced by build_edge_list().

2766 {
2767  std::vector<BCTuple> bc_triples;
2768  bc_triples.reserve(_boundary_edge_id.size());
2769 
2770  for (const auto & [elem, id_pair] : _boundary_edge_id)
2771  bc_triples.emplace_back(elem->id(), id_pair.first, id_pair.second);
2772 
2773  // This list is currently in memory address (arbitrary) order, so
2774  // sort to make it consistent on all procs.
2775  std::sort(bc_triples.begin(), bc_triples.end());
2776 
2777  return bc_triples;
2778 }
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_edge_id
Data structure that maps edges of elements to boundary ids.

◆ build_node_boundary_ids()

void libMesh::BoundaryInfo::build_node_boundary_ids ( std::vector< boundary_id_type > &  b_ids) const

Builds the list of unique node boundary ids.

On a ReplicatedMesh this will be all ids; on a DistributedMesh only ids on semilocal nodes will be included.

Definition at line 2093 of file boundary_info.C.

References _boundary_node_id.

Referenced by libMesh::ExodusII_IO_Helper::initialize(), and libMesh::ExodusII_IO_Helper::write_nodesets().

2094 {
2095  b_ids.clear();
2096 
2097  for (const auto & pr : _boundary_node_id)
2098  {
2099  boundary_id_type id = pr.second;
2100 
2101  if (std::find(b_ids.begin(),b_ids.end(),id) == b_ids.end())
2102  b_ids.push_back(id);
2103  }
2104 }
int8_t boundary_id_type
Definition: id_types.h:51
std::multimap< const Node *, boundary_id_type > _boundary_node_id
Data structure that maps nodes in the mesh to boundary ids.

◆ build_node_list() [1/2]

void libMesh::BoundaryInfo::build_node_list ( std::vector< dof_id_type > &  node_id_list,
std::vector< boundary_id_type > &  bc_id_list 
) const

Creates a list of nodes and ids for those nodes.

On a ReplicatedMesh this will include all nodes; on a DistributedMesh only semilocal nodes will be included.

Definition at line 2274 of file boundary_info.C.

Referenced by libMesh::Nemesis_IO_Helper::compute_num_global_nodesets(), libMesh::UnstructuredMesh::stitching_helper(), WriteNodesetData::testWriteImpl(), libMesh::CheckpointIO::write(), and libMesh::ExodusII_IO_Helper::write_nodesets().

2276 {
2277  libmesh_deprecated();
2278 
2279  // Call the non-deprecated version of this function.
2280  auto bc_tuples = this->build_node_list();
2281 
2282  // Clear the input vectors, just in case they were used for
2283  // something else recently...
2284  nl.clear();
2285  il.clear();
2286 
2287  // Reserve the size, then use push_back
2288  nl.reserve (bc_tuples.size());
2289  il.reserve (bc_tuples.size());
2290 
2291  for (const auto & t : bc_tuples)
2292  {
2293  nl.push_back(std::get<0>(t));
2294  il.push_back(std::get<1>(t));
2295  }
2296 }
void build_node_list(std::vector< dof_id_type > &node_id_list, std::vector< boundary_id_type > &bc_id_list) const
Creates a list of nodes and ids for those nodes.

◆ build_node_list() [2/2]

std::vector< BoundaryInfo::NodeBCTuple > libMesh::BoundaryInfo::build_node_list ( NodeBCTupleSortBy  sort_by = NodeBCTupleSortBy::NODE_ID) const

Definition at line 2301 of file boundary_info.C.

References _boundary_node_id, BOUNDARY_ID, and NODE_ID.

2302 {
2303  std::vector<NodeBCTuple> bc_tuples;
2304  bc_tuples.reserve(_boundary_node_id.size());
2305 
2306  for (const auto & [node, bid] : _boundary_node_id)
2307  bc_tuples.emplace_back(node->id(), bid);
2308 
2309  // This list is currently in memory address (arbitrary) order, so
2310  // sort, using the specified ordering, to make it consistent on all procs.
2311  if (sort_by == NodeBCTupleSortBy::NODE_ID)
2312  std::sort(bc_tuples.begin(), bc_tuples.end());
2313  else if (sort_by == NodeBCTupleSortBy::BOUNDARY_ID)
2314  std::sort(bc_tuples.begin(), bc_tuples.end(),
2315  [](const NodeBCTuple & left, const NodeBCTuple & right)
2316  {return std::get<1>(left) < std::get<1>(right);});
2317 
2318  return bc_tuples;
2319 }
std::tuple< dof_id_type, boundary_id_type > NodeBCTuple
As above, but the library creates and fills in a vector of (node-id, bc-id) pairs and returns it to t...
std::multimap< const Node *, boundary_id_type > _boundary_node_id
Data structure that maps nodes in the mesh to boundary ids.

◆ build_node_list_from_side_list()

void libMesh::BoundaryInfo::build_node_list_from_side_list ( )

Adds nodes with boundary ids based on the side's boundary ids they are connected to.

Definition at line 2323 of file boundary_info.C.

References _boundary_side_id, _mesh, libMesh::Elem::active_family_tree_by_side(), add_node(), boundary_ids(), libMesh::ParallelObject::comm(), libMesh::index_range(), libMesh::MeshBase::is_serial(), libMesh::Elem::node_id(), libMesh::Elem::node_index_range(), libMesh::Elem::node_ptr(), libMesh::MeshBase::node_ptr(), libMesh::ParallelObject::processor_id(), and libMesh::DofObject::processor_id().

Referenced by WriteNodesetData::testWriteImpl().

2324 {
2325  // If we're on a distributed mesh, even the owner of a node is not
2326  // guaranteed to be able to properly assign its new boundary id(s)!
2327  // Nodal neighbors are not always ghosted, and a nodal neighbor
2328  // might have a boundary side.
2329  const bool mesh_is_serial = _mesh->is_serial();
2330 
2331  typedef std::set<std::pair<dof_id_type, boundary_id_type>> set_type;
2332  typedef std::vector<std::pair<dof_id_type, boundary_id_type>> vec_type;
2333 
2334  const processor_id_type my_proc_id = this->processor_id();
2335  std::unordered_map<processor_id_type, set_type> nodes_to_push;
2336  std::unordered_map<processor_id_type, vec_type> node_vecs_to_push;
2337 
2338  // For avoiding extraneous element side construction
2339  ElemSideBuilder side_builder;
2340  // Pull objects out of the loop to reduce heap operations
2341  const Elem * side;
2342 
2343  // Loop over the side list
2344  for (const auto & [elem, id_pair] : _boundary_side_id)
2345  {
2346  // Don't add remote sides
2347  if (elem->is_remote())
2348  continue;
2349 
2350  // Need to loop over the sides of any possible children
2351  std::vector<const Elem *> family;
2352 #ifdef LIBMESH_ENABLE_AMR
2353  elem->active_family_tree_by_side (family, id_pair.first);
2354 #else
2355  family.push_back(elem);
2356 #endif
2357 
2358  for (const auto & cur_elem : family)
2359  {
2360  side = &side_builder(*cur_elem, id_pair.first);
2361 
2362  // Add each node node on the side with the side's boundary id
2363  for (auto i : side->node_index_range())
2364  {
2365  const boundary_id_type bcid = id_pair.second;
2366  this->add_node(side->node_ptr(i), bcid);
2367  if (!mesh_is_serial)
2368  {
2369  const processor_id_type proc_id =
2370  side->node_ptr(i)->processor_id();
2371  if (proc_id != my_proc_id)
2372  nodes_to_push[proc_id].emplace(side->node_id(i), bcid);
2373  }
2374  }
2375  }
2376  }
2377 
2378  // If we're on a serial mesh then we're done.
2379  if (mesh_is_serial)
2380  return;
2381 
2382  // Otherwise we need to push ghost node bcids to their owners, then
2383  // pull ghost node bcids from their owners.
2384 
2385  for (auto & [proc_id, s] : nodes_to_push)
2386  {
2387  node_vecs_to_push[proc_id].assign(s.begin(), s.end());
2388  s.clear();
2389  }
2390 
2391  auto nodes_action_functor =
2392  [this]
2394  const vec_type & received_nodes)
2395  {
2396  for (const auto & [dof_id, bndry_id] : received_nodes)
2397  this->add_node(_mesh->node_ptr(dof_id), bndry_id);
2398  };
2399 
2400  Parallel::push_parallel_vector_data
2401  (this->comm(), node_vecs_to_push, nodes_action_functor);
2402 
2403  // At this point we should know all the BCs for our own nodes; now
2404  // we need BCs for ghost nodes.
2405  std::unordered_map<processor_id_type, std::vector<dof_id_type>>
2406  node_ids_requested;
2407 
2408  // Determine what nodes we need to request
2409  for (const auto & node : _mesh->node_ptr_range())
2410  {
2411  const processor_id_type pid = node->processor_id();
2412  if (pid != my_proc_id)
2413  node_ids_requested[pid].push_back(node->id());
2414  }
2415 
2416  typedef std::vector<boundary_id_type> datum_type;
2417 
2418  auto node_bcid_gather_functor =
2419  [this]
2421  const std::vector<dof_id_type> & ids,
2422  std::vector<datum_type> & data)
2423  {
2424  const std::size_t query_size = ids.size();
2425  data.resize(query_size);
2426 
2427  for (std::size_t i=0; i != query_size; ++i)
2428  this->boundary_ids(_mesh->node_ptr(ids[i]), data[i]);
2429  };
2430 
2431  auto node_bcid_action_functor =
2432  [this]
2434  const std::vector<dof_id_type> & ids,
2435  const std::vector<datum_type> & data)
2436  {
2437  for (auto i : index_range(ids))
2438  this->add_node(_mesh->node_ptr(ids[i]), data[i]);
2439  };
2440 
2441  datum_type * datum_type_ex = nullptr;
2442  Parallel::pull_parallel_vector_data
2443  (this->comm(), node_ids_requested, node_bcid_gather_functor,
2444  node_bcid_action_functor, datum_type_ex);
2445 }
const Parallel::Communicator & comm() const
void boundary_ids(const Node *node, std::vector< boundary_id_type > &vec_to_fill) const
Fills a user-provided std::vector with the boundary ids associated with Node node.
MeshBase * _mesh
A pointer to the Mesh this boundary info pertains to.
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_side_id
Data structure that maps sides of elements to boundary ids.
uint8_t processor_id_type
Definition: id_types.h:104
uint8_t processor_id_type
virtual bool is_serial() const
Definition: mesh_base.h:205
void add_node(const Node *node, const boundary_id_type id)
Add Node node with boundary id id to the boundary information data structures.
int8_t boundary_id_type
Definition: id_types.h:51
virtual const Node * node_ptr(const dof_id_type i) const =0
processor_id_type processor_id() const
auto index_range(const T &sizable)
Helper function that returns an IntRange<std::size_t> representing all the indices of the passed-in v...
Definition: int_range.h:111

◆ build_shellface_boundary_ids()

void libMesh::BoundaryInfo::build_shellface_boundary_ids ( std::vector< boundary_id_type > &  b_ids) const

Builds the list of unique shellface boundary ids.

On a ReplicatedMesh this will be all ids; on a DistributedMesh only ids on shellfaces of semilocal elements will be included.

Definition at line 2121 of file boundary_info.C.

References _boundary_shellface_id.

Referenced by libMesh::ExodusII_IO_Helper::initialize(), and libMesh::ExodusII_IO_Helper::write_sidesets().

2122 {
2123  b_ids.clear();
2124 
2125  for (const auto & pr :_boundary_shellface_id)
2126  {
2127  boundary_id_type id = pr.second.second;
2128 
2129  if (std::find(b_ids.begin(),b_ids.end(),id) == b_ids.end())
2130  b_ids.push_back(id);
2131  }
2132 }
int8_t boundary_id_type
Definition: id_types.h:51
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_shellface_id
Data structure that maps faces of shell elements to boundary ids.

◆ build_shellface_list() [1/2]

void libMesh::BoundaryInfo::build_shellface_list ( std::vector< dof_id_type > &  element_id_list,
std::vector< unsigned short int > &  shellface_list,
std::vector< boundary_id_type > &  bc_id_list 
) const

Creates a list of element numbers, shellfaces, and boundary ids for those shellfaces.

On a ReplicatedMesh this will include all shellfaces; on a DistributedMesh only shellfaces of semilocal elements will be included.

Definition at line 2782 of file boundary_info.C.

References build_shellface_list().

Referenced by libMesh::UnstructuredMesh::stitching_helper(), and libMesh::ExodusII_IO_Helper::write_sidesets().

2785 {
2786  libmesh_deprecated();
2787 
2788  // Call the non-deprecated version of this function.
2789  auto bc_tuples = this->build_shellface_list();
2790 
2791  // Clear the input vectors, just in case they were used for
2792  // something else recently...
2793  el.clear();
2794  sl.clear();
2795  il.clear();
2796 
2797  // Reserve the size, then use push_back
2798  el.reserve (bc_tuples.size());
2799  sl.reserve (bc_tuples.size());
2800  il.reserve (bc_tuples.size());
2801 
2802  for (const auto & t : bc_tuples)
2803  {
2804  el.push_back(std::get<0>(t));
2805  sl.push_back(std::get<1>(t));
2806  il.push_back(std::get<2>(t));
2807  }
2808 }
std::vector< BCTuple > build_shellface_list() const
As above, but the library creates and fills in a vector of (elem-id, side-id, bc-id) triplets and ret...

◆ build_shellface_list() [2/2]

std::vector< BoundaryInfo::BCTuple > libMesh::BoundaryInfo::build_shellface_list ( ) const

As above, but the library creates and fills in a vector of (elem-id, side-id, bc-id) triplets and returns it to the user, taking advantage of guaranteed RVO.

Definition at line 2813 of file boundary_info.C.

References _boundary_shellface_id.

Referenced by build_shellface_list().

2814 {
2815  std::vector<BCTuple> bc_triples;
2816  bc_triples.reserve(_boundary_shellface_id.size());
2817 
2818  for (const auto & [elem, id_pair] : _boundary_shellface_id)
2819  bc_triples.emplace_back(elem->id(), id_pair.first, id_pair.second);
2820 
2821  // This list is currently in memory address (arbitrary) order, so
2822  // sort to make it consistent on all procs.
2823  std::sort(bc_triples.begin(), bc_triples.end());
2824 
2825  return bc_triples;
2826 }
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_shellface_id
Data structure that maps faces of shell elements to boundary ids.

◆ build_side_boundary_ids()

void libMesh::BoundaryInfo::build_side_boundary_ids ( std::vector< boundary_id_type > &  b_ids) const

Builds the list of unique side boundary ids.

On a ReplicatedMesh this will be all ids; on a DistributedMesh only ids on sides of semilocal elements will be included.

Definition at line 2107 of file boundary_info.C.

References _boundary_side_id.

Referenced by libMesh::ExodusII_IO_Helper::initialize(), and libMesh::ExodusII_IO_Helper::write_sidesets().

2108 {
2109  b_ids.clear();
2110 
2111  for (const auto & pr : _boundary_side_id)
2112  {
2113  boundary_id_type id = pr.second.second;
2114 
2115  if (std::find(b_ids.begin(),b_ids.end(),id) == b_ids.end())
2116  b_ids.push_back(id);
2117  }
2118 }
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_side_id
Data structure that maps sides of elements to boundary ids.
int8_t boundary_id_type
Definition: id_types.h:51

◆ build_side_list() [1/2]

void libMesh::BoundaryInfo::build_side_list ( std::vector< dof_id_type > &  element_id_list,
std::vector< unsigned short int > &  side_list,
std::vector< boundary_id_type > &  bc_id_list 
) const

Creates a list of element numbers, sides, and ids for those sides.

On a ReplicatedMesh this will include all sides; on a DistributedMesh only sides of semilocal elements will be included.

Definition at line 2610 of file boundary_info.C.

Referenced by libMesh::Nemesis_IO_Helper::compute_num_global_sidesets(), libMesh::UnstructuredMesh::stitching_helper(), BoundaryInfoTest::testMesh(), MeshTriangulationTest::testPoly2TriHolesInteriorRefinedBase(), BoundaryInfoTest::testRenumber(), WriteEdgesetData::testWriteImpl(), WriteSidesetData::testWriteImpl(), libMesh::FroIO::write(), libMesh::CheckpointIO::write(), libMesh::GmshIO::write_mesh(), and libMesh::ExodusII_IO_Helper::write_sidesets().

2613 {
2614  libmesh_deprecated();
2615 
2616  // Call the non-deprecated version of this function.
2617  auto bc_tuples = this->build_side_list();
2618 
2619  // Clear the input vectors, just in case they were used for
2620  // something else recently...
2621  el.clear();
2622  sl.clear();
2623  il.clear();
2624 
2625  // Reserve the size, then use push_back
2626  el.reserve (bc_tuples.size());
2627  sl.reserve (bc_tuples.size());
2628  il.reserve (bc_tuples.size());
2629 
2630  for (const auto & t : bc_tuples)
2631  {
2632  el.push_back(std::get<0>(t));
2633  sl.push_back(std::get<1>(t));
2634  il.push_back(std::get<2>(t));
2635  }
2636 }
void build_side_list(std::vector< dof_id_type > &element_id_list, std::vector< unsigned short int > &side_list, std::vector< boundary_id_type > &bc_id_list) const
Creates a list of element numbers, sides, and ids for those sides.

◆ build_side_list() [2/2]

std::vector< BoundaryInfo::BCTuple > libMesh::BoundaryInfo::build_side_list ( BCTupleSortBy  sort_by = BCTupleSortBy::ELEM_ID) const

Definition at line 2641 of file boundary_info.C.

References _boundary_side_id, BOUNDARY_ID, ELEM_ID, and SIDE_ID.

2642 {
2643  std::vector<BCTuple> bc_triples;
2644  bc_triples.reserve(_boundary_side_id.size());
2645 
2646  for (const auto & [elem, id_pair] : _boundary_side_id)
2647  bc_triples.emplace_back(elem->id(), id_pair.first, id_pair.second);
2648 
2649  // bc_triples is currently in whatever order the Elem pointers in
2650  // the _boundary_side_id multimap are in, and in particular might be
2651  // in different orders on different processors. To avoid this
2652  // inconsistency, we'll sort using the default operator< for tuples.
2653  if (sort_by == BCTupleSortBy::ELEM_ID)
2654  std::sort(bc_triples.begin(), bc_triples.end());
2655  else if (sort_by == BCTupleSortBy::SIDE_ID)
2656  std::sort(bc_triples.begin(), bc_triples.end(),
2657  [](const BCTuple & left, const BCTuple & right)
2658  {return std::get<1>(left) < std::get<1>(right);});
2659  else if (sort_by == BCTupleSortBy::BOUNDARY_ID)
2660  std::sort(bc_triples.begin(), bc_triples.end(),
2661  [](const BCTuple & left, const BCTuple & right)
2662  {return std::get<2>(left) < std::get<2>(right);});
2663 
2664  return bc_triples;
2665 }
std::tuple< dof_id_type, unsigned short int, boundary_id_type > BCTuple
As above, but the library creates and fills in a vector of (elem-id, side-id, bc-id) triplets and ret...
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_side_id
Data structure that maps sides of elements to boundary ids.

◆ build_side_list_from_node_list()

void libMesh::BoundaryInfo::build_side_list_from_node_list ( )

Adds sides to a sideset if every node on that side are in the same sideset.

Definition at line 2560 of file boundary_info.C.

References _boundary_node_id, _mesh, add_side(), libMesh::as_range(), libMesh::Elem::n_nodes(), libMesh::Elem::node_ref_range(), nodeset_name(), libMesh::out, and sideset_name().

Referenced by libMesh::AbaqusIO::read().

2561 {
2562  // Check for early return
2563  if (_boundary_node_id.empty())
2564  {
2565  libMesh::out << "No boundary node IDs have been added: cannot build side list!" << std::endl;
2566  return;
2567  }
2568 
2569  // For avoiding extraneous element side construction
2570  ElemSideBuilder side_builder;
2571  // Pull objects out of the loop to reduce heap operations
2572  const Elem * side_elem;
2573 
2574  for (const auto & elem : _mesh->active_element_ptr_range())
2575  for (auto side : elem->side_index_range())
2576  {
2577  side_elem = &side_builder(*elem, side);
2578 
2579  // map from nodeset_id to count for that ID
2580  std::map<boundary_id_type, unsigned> nodesets_node_count;
2581 
2582  // For each nodeset that this node is a member of, increment the associated
2583  // nodeset ID count
2584  for (const auto & node : side_elem->node_ref_range())
2585  for (const auto & pr : as_range(_boundary_node_id.equal_range(&node)))
2586  nodesets_node_count[pr.second]++;
2587 
2588  // Now check to see what nodeset_counts have the correct
2589  // number of nodes in them. For any that do, add this side to
2590  // the sideset, making sure the sideset inherits the
2591  // nodeset's name, if there is one.
2592  for (const auto & pr : nodesets_node_count)
2593  if (pr.second == side_elem->n_nodes())
2594  {
2595  add_side(elem, side, pr.first);
2596 
2597  // Let the sideset inherit any non-empty name from the nodeset
2598  std::string & nset_name = nodeset_name(pr.first);
2599 
2600  if (nset_name != "")
2601  sideset_name(pr.first) = nset_name;
2602  }
2603  } // end for side
2604 }
std::string & nodeset_name(boundary_id_type id)
MeshBase * _mesh
A pointer to the Mesh this boundary info pertains to.
std::multimap< const Node *, boundary_id_type > _boundary_node_id
Data structure that maps nodes in the mesh to boundary ids.
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
Helper function that allows us to treat a homogenous pair as a range.
Definition: simple_range.h:57
std::string & sideset_name(boundary_id_type id)
OStreamProxy out
void add_side(const dof_id_type elem, const unsigned short int side, const boundary_id_type id)
Add side side of element number elem with boundary id id to the boundary information data structure...

◆ clear()

void libMesh::BoundaryInfo::clear ( )

Clears the underlying data structures and restores the object to a pristine state with no data stored.

Definition at line 342 of file boundary_info.C.

References _boundary_edge_id, _boundary_ids, _boundary_node_id, _boundary_shellface_id, _boundary_side_id, _edge_boundary_ids, _es_id_to_name, _node_boundary_ids, _ns_id_to_name, _shellface_boundary_ids, _side_boundary_ids, and _ss_id_to_name.

Referenced by operator=(), and libMesh::Poly2TriTriangulator::triangulate_current_points().

343 {
344  _boundary_node_id.clear();
345  _boundary_side_id.clear();
346  _boundary_edge_id.clear();
347  _boundary_shellface_id.clear();
348  _boundary_ids.clear();
349  _side_boundary_ids.clear();
350  _node_boundary_ids.clear();
351  _edge_boundary_ids.clear();
352  _shellface_boundary_ids.clear();
353  _ss_id_to_name.clear();
354  _ns_id_to_name.clear();
355  _es_id_to_name.clear();
356 }
std::map< boundary_id_type, std::string > _ns_id_to_name
This structure maintains the mapping of named node sets for file formats (Exodus, Gmsh) that support ...
std::set< boundary_id_type > _node_boundary_ids
Set of user-specified boundary IDs for nodes only.
std::set< boundary_id_type > _edge_boundary_ids
Set of user-specified boundary IDs for edges only.
std::set< boundary_id_type > _boundary_ids
A collection of user-specified boundary ids for sides, edges, nodes, and shell faces.
std::set< boundary_id_type > _side_boundary_ids
Set of user-specified boundary IDs for sides only.
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_side_id
Data structure that maps sides of elements to boundary ids.
std::map< boundary_id_type, std::string > _ss_id_to_name
This structure maintains the mapping of named side sets for file formats (Exodus, Gmsh) that support ...
std::map< boundary_id_type, std::string > _es_id_to_name
This structure maintains the mapping of named edge sets for file formats (Exodus, Gmsh) that support ...
std::multimap< const Node *, boundary_id_type > _boundary_node_id
Data structure that maps nodes in the mesh to boundary ids.
std::set< boundary_id_type > _shellface_boundary_ids
Set of user-specified boundary IDs for shellfaces only.
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_shellface_id
Data structure that maps faces of shell elements to boundary ids.
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_edge_id
Data structure that maps edges of elements to boundary ids.

◆ clear_boundary_node_ids()

void libMesh::BoundaryInfo::clear_boundary_node_ids ( )

Clears all the boundary information from all of the nodes in the mesh.

Definition at line 950 of file boundary_info.C.

References _boundary_node_id.

951 {
952  _boundary_node_id.clear();
953 }
std::multimap< const Node *, boundary_id_type > _boundary_node_id
Data structure that maps nodes in the mesh to boundary ids.

◆ clear_stitched_boundary_side_ids()

void libMesh::BoundaryInfo::clear_stitched_boundary_side_ids ( boundary_id_type  sideset_id,
boundary_id_type  other_sideset_id,
bool  clear_nodeset_data = false 
)

Clear sideset information along a stitched mesh interface.

Parameters
sideset_idA sideset on one side of the stitched mesh interface
other_sideset_idThe sideset on the other side of the stitched mesh interface
clear_nodeset_dataWhether to clear boundary information for the nodes along the stitched mesh interface

Definition at line 3194 of file boundary_info.C.

References _boundary_side_id, invalid_id, libmesh_assert_valid_multimaps(), libMesh::Elem::neighbor_ptr(), libMesh::Elem::node_ptr(), libMesh::Elem::nodes_on_side(), regenerate_id_sets(), remove_node(), and libMesh::Elem::which_neighbor_am_i().

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

3197 {
3198  auto end_it = _boundary_side_id.end();
3199  auto it = _boundary_side_id.begin();
3200 
3201  // This predicate checks to see whether the pred_pr triplet's boundary ID matches sideset_id
3202  // (other_sideset_id) *and* whether there is a boundary information triplet on the other side of
3203  // the face whose boundary ID matches the other_sideset_id (sideset_id). We return a pair where
3204  // first is a boolean indicating our condition is true or false, and second is an iterator to the
3205  // neighboring triplet if our condition is true
3206  auto predicate =
3207  [sideset_id, other_sideset_id](
3208  const std::pair<const Elem *, std::pair<unsigned short int, boundary_id_type>> & pred_pr,
3209  const std::multimap<const Elem *, std::pair<unsigned short int, boundary_id_type>> &
3210  pred_container) {
3211  const Elem & elem = *pred_pr.first;
3212  const auto elem_side = pred_pr.second.first;
3213  const Elem * const other_elem = elem.neighbor_ptr(elem_side);
3214  if (!other_elem)
3215  return std::make_pair(false, pred_container.end());
3216 
3217  const auto elem_side_bnd_id = pred_pr.second.second;
3218  auto other_elem_side_bnd_id = BoundaryInfo::invalid_id;
3219  if (elem_side_bnd_id == sideset_id)
3220  other_elem_side_bnd_id = other_sideset_id;
3221  else if (elem_side_bnd_id == other_sideset_id)
3222  other_elem_side_bnd_id = sideset_id;
3223  else
3224  return std::make_pair(false, pred_container.end());
3225 
3226  const auto other_elem_side = other_elem->which_neighbor_am_i(&elem);
3227  const typename std::decay<decltype(pred_container)>::type::value_type other_sideset_info(
3228  other_elem, std::make_pair(other_elem_side, other_elem_side_bnd_id));
3229  auto other_range = pred_container.equal_range(other_elem);
3230  libmesh_assert_msg(
3231  other_range.first != other_range.second,
3232  "No matching sideset information for other element in boundary information");
3233  auto other_it = std::find(other_range.first, other_range.second, other_sideset_info);
3234  libmesh_assert_msg(
3235  other_it != pred_container.end(),
3236  "No matching sideset information for other element in boundary information");
3237  return std::make_pair(true, other_it);
3238  };
3239 
3240  for (; it != end_it;)
3241  {
3242  auto pred_result = predicate(*it, _boundary_side_id);
3243  if (pred_result.first)
3244  {
3245  // First erase associated nodeset information. Do it from both
3246  // sides, so we get any higher-order nodes if we're looking at
3247  // them from a lower-order side, and so we only remove the two
3248  // boundary ids used for stitching.
3249  if (clear_nodeset_data)
3250  {
3251  const Elem & elem = *it->first;
3252  const Elem & neigh = *pred_result.second->first;
3253  const auto elem_side = it->second.first;
3254  const boundary_id_type neigh_side = pred_result.second->second.first;
3255  const auto elem_bcid = it->second.second;
3256  const boundary_id_type neigh_bcid = pred_result.second->second.second;
3257 
3258  for (const auto local_node_num : elem.nodes_on_side(elem_side))
3259  this->remove_node(elem.node_ptr(local_node_num), elem_bcid);
3260 
3261  for (const auto local_node_num : neigh.nodes_on_side(neigh_side))
3262  this->remove_node(neigh.node_ptr(local_node_num), neigh_bcid);
3263  }
3264 
3265  // Now erase the sideset information for our element and its
3266  // neighbor, together. This is safe since a multimap doesn't
3267  // invalidate iterators.
3268  _boundary_side_id.erase(pred_result.second);
3269  it = _boundary_side_id.erase(it);
3270  }
3271  else
3272  ++it;
3273  }
3274 
3275  // Removing stitched-away boundary ids might have removed an id
3276  // *entirely*, so we need to recompute boundary id sets to check
3277  // for that.
3278  this->regenerate_id_sets();
3280 }
void libmesh_assert_valid_multimaps() const
Helper method for ensuring that our multimaps don&#39;t contain entries with duplicate keys and values...
void remove_node(const Node *node, const boundary_id_type id)
Removes boundary id id from node node, if it exists.
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_side_id
Data structure that maps sides of elements to boundary ids.
int8_t boundary_id_type
Definition: id_types.h:51
static const boundary_id_type invalid_id
Number used for internal use.
void regenerate_id_sets()
Clears and regenerates the cached sets of ids.

◆ comm()

const Parallel::Communicator& libMesh::ParallelObject::comm ( ) const
inlineinherited
Returns
A reference to the Parallel::Communicator object used by this mesh.

Definition at line 97 of file parallel_object.h.

References libMesh::ParallelObject::_communicator.

Referenced by libMesh::__libmesh_petsc_diff_solver_jacobian(), libMesh::__libmesh_petsc_diff_solver_monitor(), libMesh::__libmesh_petsc_diff_solver_residual(), libMesh::__libmesh_tao_equality_constraints(), libMesh::__libmesh_tao_equality_constraints_jacobian(), libMesh::__libmesh_tao_gradient(), libMesh::__libmesh_tao_hessian(), libMesh::__libmesh_tao_inequality_constraints(), libMesh::__libmesh_tao_inequality_constraints_jacobian(), libMesh::__libmesh_tao_objective(), libMesh::MeshRefinement::_coarsen_elements(), libMesh::ExactSolution::_compute_error(), libMesh::UniformRefinementEstimator::_estimate_error(), libMesh::Partitioner::_find_global_index_by_pid_map(), _find_id_maps(), libMesh::SlepcEigenSolver< libMesh::Number >::_petsc_shell_matrix_get_diagonal(), libMesh::PetscLinearSolver< Number >::_petsc_shell_matrix_get_diagonal(), libMesh::SlepcEigenSolver< libMesh::Number >::_petsc_shell_matrix_mult(), libMesh::PetscLinearSolver< Number >::_petsc_shell_matrix_mult(), libMesh::PetscLinearSolver< Number >::_petsc_shell_matrix_mult_add(), libMesh::MeshRefinement::_refine_elements(), libMesh::MeshRefinement::_smooth_flags(), libMesh::DofMap::add_constraints_to_send_list(), add_cube_convex_hull_to_mesh(), libMesh::PetscDMWrapper::add_dofs_helper(), libMesh::PetscDMWrapper::add_dofs_to_section(), libMesh::TransientRBConstruction::add_IC_to_RB_space(), libMesh::EigenSystem::add_matrices(), libMesh::System::add_matrix(), libMesh::RBConstruction::add_scaled_matrix_and_vector(), libMesh::System::add_variable(), libMesh::System::add_variables(), libMesh::System::add_vector(), libMesh::MeshTools::Modification::all_tri(), libMesh::LaplaceMeshSmoother::allgather_graph(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::TransientRBConstruction::allocate_data_structures(), libMesh::RBConstruction::allocate_data_structures(), libMesh::TransientRBConstruction::assemble_affine_expansion(), libMesh::FEMSystem::assemble_qoi(), libMesh::Nemesis_IO::assert_symmetric_cmaps(), libMesh::MeshCommunication::assign_global_indices(), libMesh::Partitioner::assign_partitioning(), libMesh::MeshTools::Generation::build_extrusion(), build_node_list_from_side_list(), libMesh::EquationSystems::build_parallel_elemental_solution_vector(), libMesh::EquationSystems::build_parallel_solution_vector(), libMesh::PetscDMWrapper::build_section(), libMesh::PetscDMWrapper::build_sf(), libMesh::MeshBase::cache_elem_data(), libMesh::System::calculate_norm(), libMesh::DofMap::check_dirichlet_bcid_consistency(), libMesh::RBConstruction::compute_Fq_representor_innerprods(), libMesh::RBConstruction::compute_max_error_bound(), libMesh::Nemesis_IO_Helper::compute_num_global_elem_blocks(), libMesh::Nemesis_IO_Helper::compute_num_global_nodesets(), libMesh::Nemesis_IO_Helper::compute_num_global_sidesets(), libMesh::RBConstruction::compute_output_dual_innerprods(), libMesh::RBConstruction::compute_residual_dual_norm_slow(), libMesh::RBSCMConstruction::compute_SCM_bounds_on_training_set(), libMesh::DofMap::computed_sparsity_already(), libMesh::Problem_Interface::computeF(), libMesh::Problem_Interface::computeJacobian(), libMesh::Problem_Interface::computePreconditioner(), libMesh::ContinuationSystem::ContinuationSystem(), libMesh::MeshBase::copy_constraint_rows(), libMesh::ExodusII_IO::copy_elemental_solution(), libMesh::ExodusII_IO::copy_nodal_solution(), libMesh::ExodusII_IO::copy_scalar_solution(), libMesh::MeshTools::correct_node_proc_ids(), libMesh::MeshTools::create_bounding_box(), libMesh::DofMap::create_dof_constraints(), libMesh::MeshTools::create_nodal_bounding_box(), libMesh::MeshRefinement::create_parent_error_vector(), libMesh::MeshTools::create_processor_bounding_box(), libMesh::MeshTools::create_subdomain_bounding_box(), libMesh::PetscMatrix< libMesh::Number >::create_submatrix_nosort(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::RBEIMEvaluation::distribute_bfs(), libMesh::DofMap::distribute_dofs(), DMlibMeshFunction(), DMlibMeshJacobian(), DMlibMeshSetSystem_libMesh(), DMVariableBounds_libMesh(), libMesh::DTKSolutionTransfer::DTKSolutionTransfer(), libMesh::MeshRefinement::eliminate_unrefined_patches(), libMesh::RBEIMConstruction::enrich_eim_approximation_on_interiors(), libMesh::RBEIMConstruction::enrich_eim_approximation_on_nodes(), libMesh::RBEIMConstruction::enrich_eim_approximation_on_sides(), libMesh::TransientRBConstruction::enrich_RB_space(), libMesh::EpetraVector< T >::EpetraVector(), AssembleOptimization::equality_constraints(), libMesh::PatchRecoveryErrorEstimator::estimate_error(), libMesh::WeightedPatchRecoveryErrorEstimator::estimate_error(), libMesh::AdjointRefinementEstimator::estimate_error(), libMesh::ExactErrorEstimator::estimate_error(), libMesh::MeshRefinement::flag_elements_by_elem_fraction(), libMesh::MeshRefinement::flag_elements_by_error_fraction(), libMesh::MeshRefinement::flag_elements_by_error_tolerance(), libMesh::MeshRefinement::flag_elements_by_mean_stddev(), libMesh::MeshRefinement::flag_elements_by_nelem_target(), libMesh::RBEIMEvaluation::gather_bfs(), libMesh::DofMap::gather_constraints(), libMesh::MeshfreeInterpolation::gather_remote_data(), libMesh::CondensedEigenSystem::get_eigenpair(), libMesh::RBEIMEvaluation::get_eim_basis_function_node_value(), libMesh::RBEIMEvaluation::get_eim_basis_function_side_value(), libMesh::RBEIMEvaluation::get_eim_basis_function_value(), libMesh::MeshBase::get_info(), libMesh::System::get_info(), libMesh::DofMap::get_info(), libMesh::ImplicitSystem::get_linear_solver(), libMesh::RBEIMConstruction::get_max_abs_value(), libMesh::RBEIMConstruction::get_node_max_abs_value(), libMesh::RBEIMEvaluation::get_parametrized_function_node_value(), libMesh::RBEIMEvaluation::get_parametrized_function_side_value(), libMesh::RBEIMEvaluation::get_parametrized_function_value(), libMesh::RBEIMConstruction::get_random_point(), AssembleOptimization::inequality_constraints(), AssembleOptimization::inequality_constraints_jacobian(), libMesh::LocationMap< T >::init(), libMesh::TimeSolver::init(), libMesh::SystemSubsetBySubdomain::init(), libMesh::PetscDMWrapper::init_and_attach_petscdm(), libMesh::ExodusII_IO_Helper::initialize(), libMesh::OptimizationSystem::initialize_equality_constraints_storage(), libMesh::OptimizationSystem::initialize_inequality_constraints_storage(), libMesh::RBEIMConstruction::initialize_parametrized_functions_in_training_set(), libMesh::RBEIMConstruction::inner_product(), integrate_function(), libMesh::MeshTools::libmesh_assert_consistent_distributed(), libMesh::MeshTools::libmesh_assert_consistent_distributed_nodes(), libMesh::MeshTools::libmesh_assert_contiguous_dof_ids(), libMesh::MeshTools::libmesh_assert_equal_connectivity(), libMesh::MeshTools::libmesh_assert_equal_points(), 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< Node >(), libMesh::MeshTools::libmesh_assert_valid_boundary_ids(), libMesh::MeshTools::libmesh_assert_valid_dof_ids(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_flags(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_object_ids(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_p_levels(), libMesh::MeshTools::libmesh_assert_valid_refinement_flags(), libMesh::MeshTools::libmesh_assert_valid_unique_ids(), libMesh::libmesh_petsc_linesearch_shellfunc(), libMesh::libmesh_petsc_preconditioner_apply(), libMesh::libmesh_petsc_recalculate_monitor(), libMesh::libmesh_petsc_snes_fd_residual(), libMesh::libmesh_petsc_snes_jacobian(), libMesh::libmesh_petsc_snes_mffd_interface(), libMesh::libmesh_petsc_snes_mffd_residual(), libMesh::libmesh_petsc_snes_postcheck(), libMesh::libmesh_petsc_snes_precheck(), libMesh::libmesh_petsc_snes_residual(), libMesh::libmesh_petsc_snes_residual_helper(), libMesh::MeshRefinement::limit_level_mismatch_at_edge(), libMesh::MeshRefinement::limit_level_mismatch_at_node(), libMesh::MeshRefinement::limit_overrefined_boundary(), libMesh::MeshRefinement::limit_underrefined_boundary(), libMesh::LinearImplicitSystem::LinearImplicitSystem(), main(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::MeshCommunication::make_elems_parallel_consistent(), libMesh::MeshRefinement::make_flags_parallel_consistent(), libMesh::MeshCommunication::make_new_node_proc_ids_parallel_consistent(), libMesh::MeshCommunication::make_new_nodes_parallel_consistent(), libMesh::MeshCommunication::make_node_bcids_parallel_consistent(), libMesh::MeshCommunication::make_node_ids_parallel_consistent(), libMesh::MeshCommunication::make_node_proc_ids_parallel_consistent(), libMesh::MeshCommunication::make_node_unique_ids_parallel_consistent(), libMesh::MeshCommunication::make_nodes_parallel_consistent(), libMesh::MeshCommunication::make_p_levels_parallel_consistent(), libMesh::MeshRefinement::make_refinement_compatible(), libMesh::TransientRBConstruction::mass_matrix_scaled_matvec(), libMesh::FEMSystem::mesh_position_set(), libMesh::TriangulatorInterface::MeshedHole::MeshedHole(), LinearElasticityWithContact::move_mesh(), libMesh::DistributedMesh::n_active_elem(), libMesh::MeshTools::n_active_levels(), n_boundary_conds(), libMesh::DofMap::n_constrained_dofs(), n_edge_conds(), libMesh::CondensedEigenSystem::n_global_non_condensed_dofs(), libMesh::MeshTools::n_levels(), MixedOrderTest::n_neighbor_links(), n_nodeset_conds(), libMesh::SparsityPattern::Build::n_nonzeros(), libMesh::MeshTools::n_p_levels(), n_shellface_conds(), libMesh::RBEIMEvaluation::node_distribute_bfs(), libMesh::RBEIMEvaluation::node_gather_bfs(), libMesh::RBEIMConstruction::node_inner_product(), libMesh::MeshBase::operator==(), libMesh::DistributedMesh::parallel_max_elem_id(), libMesh::DistributedMesh::parallel_max_node_id(), libMesh::ReplicatedMesh::parallel_max_unique_id(), libMesh::DistributedMesh::parallel_max_unique_id(), libMesh::DistributedMesh::parallel_n_elem(), libMesh::DistributedMesh::parallel_n_nodes(), libMesh::SparsityPattern::Build::parallel_sync(), parallel_sync_node_ids(), parallel_sync_side_ids(), libMesh::MeshTools::paranoid_n_levels(), libMesh::Partitioner::partition(), libMesh::Partitioner::partition_unpartitioned_elements(), libMesh::petsc_auto_fieldsplit(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), libMesh::MeshBase::prepare_for_use(), libMesh::DofMap::print_dof_constraints(), libMesh::DofMap::process_mesh_constraint_rows(), libMesh::Partitioner::processor_pairs_to_interface_nodes(), libMesh::InterMeshProjection::project_system_vectors(), FEMParameters::read(), libMesh::Nemesis_IO::read(), libMesh::XdrIO::read(), libMesh::EquationSystems::read(), libMesh::ExodusII_IO::read_header(), libMesh::CheckpointIO::read_header(), libMesh::XdrIO::read_header(), libMesh::System::read_header(), libMesh::RBEIMEvaluation::read_in_interior_basis_functions(), libMesh::RBEIMEvaluation::read_in_node_basis_functions(), libMesh::RBEIMEvaluation::read_in_side_basis_functions(), libMesh::RBEvaluation::read_in_vectors_from_multiple_files(), libMesh::System::read_legacy_data(), libMesh::TransientRBConstruction::read_riesz_representors_from_files(), libMesh::RBConstruction::read_riesz_representors_from_files(), libMesh::System::read_SCALAR_dofs(), libMesh::XdrIO::read_serialized_bc_names(), libMesh::XdrIO::read_serialized_bcs_helper(), libMesh::System::read_serialized_blocked_dof_objects(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::XdrIO::read_serialized_nodes(), libMesh::XdrIO::read_serialized_nodesets(), libMesh::XdrIO::read_serialized_subdomain_names(), libMesh::System::read_serialized_vector(), libMesh::Nemesis_IO_Helper::read_var_names_impl(), libMesh::MeshBase::recalculate_n_partitions(), libMesh::MeshRefinement::refine_and_coarsen_elements(), libMesh::DistributedMesh::renumber_dof_objects(), libMesh::DistributedMesh::renumber_nodes_and_elements(), LinearElasticityWithContact::residual_and_jacobian(), OverlappingAlgebraicGhostingTest::run_ghosting_test(), OverlappingCouplingGhostingTest::run_sparsity_pattern_test(), scale_mesh_and_plot(), libMesh::DofMap::scatter_constraints(), libMesh::CheckpointIO::select_split_config(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::send_and_insert_dof_values(), libMesh::TransientRBConstruction::set_error_temporal_data(), libMesh::Partitioner::set_interface_node_processor_ids_BFS(), libMesh::Partitioner::set_interface_node_processor_ids_linear(), libMesh::Partitioner::set_interface_node_processor_ids_petscpartitioner(), libMesh::Partitioner::set_node_processor_ids(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::Partitioner::set_parent_processor_ids(), libMesh::PetscDMWrapper::set_point_range_in_section(), libMesh::PetscDiffSolver::setup_petsc_data(), libMesh::RBEIMEvaluation::side_distribute_bfs(), libMesh::RBEIMEvaluation::side_gather_bfs(), libMesh::RBEIMConstruction::side_inner_product(), libMesh::Partitioner::single_partition(), libMesh::LaplaceMeshSmoother::smooth(), libMesh::split_mesh(), libMesh::RBEIMConstruction::store_eim_solutions_for_training_set(), libMesh::MeshBase::subdomain_ids(), sync(), ConstraintOperatorTest::test1DCoarseningNewNodes(), ConstraintOperatorTest::test1DCoarseningOperator(), libMesh::MeshRefinement::test_level_one(), MeshfunctionDFEM::test_mesh_function_dfem(), MeshfunctionDFEM::test_mesh_function_dfem_grad(), MeshFunctionTest::test_p_level(), libMesh::MeshRefinement::test_unflagged(), DofMapTest::testBadElemFECombo(), SystemsTest::testBlockRestrictedVarNDofs(), BoundaryInfoTest::testBoundaryOnChildrenErrors(), ConstraintOperatorTest::testCoreform(), MeshInputTest::testExodusIGASidesets(), MeshTriangulationTest::testFoundCenters(), PointLocatorTest::testLocator(), BoundaryInfoTest::testMesh(), PointLocatorTest::testPlanar(), MeshTriangulationTest::testPoly2TriRefinementBase(), SystemsTest::testProjectCubeWithMeshFunction(), BoundaryInfoTest::testRenumber(), CheckpointIOTest::testSplitter(), MeshInputTest::testTetgenIO(), MeshTriangulationTest::testTriangulatorInterp(), MeshTriangulationTest::testTriangulatorMeshedHoles(), MeshTriangulationTest::testTriangulatorRoundHole(), libMesh::MeshTools::total_weight(), libMesh::RBConstruction::train_reduced_basis_with_POD(), libMesh::MeshFunctionSolutionTransfer::transfer(), libMesh::MeshfreeSolutionTransfer::transfer(), libMesh::Poly2TriTriangulator::triangulate(), libMesh::TransientRBConstruction::truth_assembly(), libMesh::RBConstruction::truth_assembly(), libMesh::MeshRefinement::uniformly_coarsen(), libMesh::TransientRBConstruction::update_RB_initial_condition_all_N(), libMesh::TransientRBConstruction::update_RB_system_matrices(), libMesh::RBConstruction::update_RB_system_matrices(), libMesh::TransientRBConstruction::update_residual_terms(), libMesh::RBConstruction::update_residual_terms(), libMesh::NameBasedIO::write(), libMesh::XdrIO::write(), libMesh::VTKIO::write_nodal_data(), libMesh::RBEIMEvaluation::write_out_interior_basis_functions(), libMesh::RBEIMEvaluation::write_out_node_basis_functions(), libMesh::RBEIMEvaluation::write_out_side_basis_functions(), libMesh::RBEvaluation::write_out_vectors(), libMesh::TransientRBConstruction::write_riesz_representors_to_files(), libMesh::RBConstruction::write_riesz_representors_to_files(), libMesh::System::write_SCALAR_dofs(), libMesh::XdrIO::write_serialized_bcs_helper(), libMesh::System::write_serialized_blocked_dof_objects(), libMesh::XdrIO::write_serialized_connectivity(), libMesh::XdrIO::write_serialized_nodes(), libMesh::XdrIO::write_serialized_nodesets(), libMesh::RBDataSerialization::RBEvaluationSerialization::write_to_file(), libMesh::RBDataSerialization::TransientRBEvaluationSerialization::write_to_file(), libMesh::RBDataSerialization::RBEIMEvaluationSerialization::write_to_file(), and libMesh::RBDataSerialization::RBSCMEvaluationSerialization::write_to_file().

98  { return _communicator; }
const Parallel::Communicator & _communicator

◆ copy_boundary_ids()

void libMesh::BoundaryInfo::copy_boundary_ids ( const BoundaryInfo old_boundary_info,
const Elem *const  old_elem,
const Elem *const  new_elem 
)

Definition at line 1590 of file boundary_info.C.

References add_edge(), add_shellface(), add_side(), libMesh::Elem::edge_index_range(), libMesh::Elem::n_edges(), libMesh::Elem::n_sides(), raw_boundary_ids(), raw_edge_boundary_ids(), raw_shellface_boundary_ids(), and libMesh::Elem::side_index_range().

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

1593 {
1594  libmesh_assert_equal_to (old_elem->n_sides(), new_elem->n_sides());
1595  libmesh_assert_equal_to (old_elem->n_edges(), new_elem->n_edges());
1596 
1597  std::vector<boundary_id_type> bndry_ids;
1598 
1599  for (auto s : old_elem->side_index_range())
1600  {
1601  old_boundary_info.raw_boundary_ids (old_elem, s, bndry_ids);
1602  this->add_side (new_elem, s, bndry_ids);
1603  }
1604 
1605  for (auto e : old_elem->edge_index_range())
1606  {
1607  old_boundary_info.raw_edge_boundary_ids (old_elem, e, bndry_ids);
1608  this->add_edge (new_elem, e, bndry_ids);
1609  }
1610 
1611  for (unsigned short sf=0; sf != 2; sf++)
1612  {
1613  old_boundary_info.raw_shellface_boundary_ids (old_elem, sf, bndry_ids);
1614  this->add_shellface (new_elem, sf, bndry_ids);
1615  }
1616 }
void add_side(const dof_id_type elem, const unsigned short int side, const boundary_id_type id)
Add side side of element number elem with boundary id id to the boundary information data structure...
void add_shellface(const dof_id_type elem, const unsigned short int shellface, const boundary_id_type id)
Add shell face shellface of element number elem with boundary id id to the boundary information data ...
void add_edge(const dof_id_type elem, const unsigned short int edge, const boundary_id_type id)
Add edge edge of element number elem with boundary id id to the boundary information data structure...

◆ edge_boundary_ids()

void libMesh::BoundaryInfo::edge_boundary_ids ( const Elem *const  elem,
const unsigned short int  edge,
std::vector< boundary_id_type > &  vec_to_fill 
) const
Returns
The list of boundary ids associated with the edge edge of element elem.
Note
Edge-based boundary IDs should only be used in 3D.

Definition at line 1298 of file boundary_info.C.

References _boundary_edge_id, libMesh::as_range(), libMesh::Elem::is_child_on_edge(), libMesh::Elem::is_edge_on_side(), libMesh::Elem::level(), libMesh::libmesh_assert(), libMesh::Elem::n_edges(), libMesh::Elem::neighbor_ptr(), libMesh::Elem::parent(), libMesh::Elem::side_index_range(), libMesh::Elem::top_parent(), and libMesh::Elem::which_child_am_i().

Referenced by n_edge_boundary_ids(), libMesh::BoundaryProjectSolution::operator()(), operator==(), libMesh::UnstructuredMesh::stitching_helper(), libMesh::Elem::swap2boundaryedges(), and libMesh::XdrIO::write_serialized_bcs_helper().

1301 {
1302  libmesh_assert(elem);
1303 
1304  // Clear out any previous contents
1305  vec_to_fill.clear();
1306 
1307  // Only query BCs for edges that exist.
1308  libmesh_assert_less (edge, elem->n_edges());
1309 
1310  // Only level-0 elements store BCs. If this is not a level-0
1311  // element get its level-0 parent and infer the BCs.
1312  const Elem * searched_elem = elem;
1313 #ifdef LIBMESH_ENABLE_AMR
1314  if (elem->level() != 0)
1315  {
1316  // Find all the sides that contain edge. If one of those is a boundary
1317  // side, then this must be a boundary edge. In that case, we just use the
1318  // top-level parent.
1319  bool found_boundary_edge = false;
1320  for (auto side : elem->side_index_range())
1321  {
1322  if (elem->is_edge_on_side(edge,side))
1323  {
1324  if (elem->neighbor_ptr(side) == nullptr)
1325  {
1326  searched_elem = elem->top_parent ();
1327  found_boundary_edge = true;
1328  break;
1329  }
1330  }
1331  }
1332 
1333  if (!found_boundary_edge)
1334  {
1335  // Child element is not on external edge, but it may have internal
1336  // "boundary" IDs. We will walk up the tree, at each level checking that
1337  // the current child is actually on the same edge of the parent that is
1338  // currently being searched for (i.e. that was passed in as "edge").
1339  while (searched_elem->parent() != nullptr)
1340  {
1341  const Elem * parent = searched_elem->parent();
1342  if (parent->is_child_on_edge(parent->which_child_am_i(searched_elem), edge) == false)
1343  return;
1344  searched_elem = parent;
1345  }
1346  }
1347  }
1348 #endif
1349 
1350  // Check each element in the range to see if its edge matches the requested edge.
1351  for (const auto & pr : as_range(_boundary_edge_id.equal_range(searched_elem)))
1352  if (pr.second.first == edge)
1353  vec_to_fill.push_back(pr.second.second);
1354 }
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
Helper function that allows us to treat a homogenous pair as a range.
Definition: simple_range.h:57
libmesh_assert(ctx)
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_edge_id
Data structure that maps edges of elements to boundary ids.

◆ edgeset_name()

std::string & libMesh::BoundaryInfo::edgeset_name ( boundary_id_type  id)
Returns
A writable reference to an optional edgeset name.

Definition at line 3017 of file boundary_info.C.

References _es_id_to_name.

Referenced by libMesh::ExodusII_IO_Helper::read_edge_blocks(), and WriteEdgesetData::testWriteImpl().

3018 {
3019  return _es_id_to_name[id];
3020 }
std::map< boundary_id_type, std::string > _es_id_to_name
This structure maintains the mapping of named edge sets for file formats (Exodus, Gmsh) that support ...

◆ get_boundary_ids()

const std::set<boundary_id_type>& libMesh::BoundaryInfo::get_boundary_ids ( ) const
inline
Returns
A set of the boundary ids which exist on semilocal parts of the mesh.

Code that wishes to access boundary ids on all parts of the mesh, including non-local parts, should call get_global_boundary_ids

Definition at line 776 of file boundary_info.h.

References _boundary_ids.

Referenced by libMesh::DofMap::check_dirichlet_bcid_consistency(), MeshInputTest::testExodusIGASidesets(), BoundaryInfoTest::testMesh(), BoundaryInfoTest::testRenumber(), and libMesh::FroIO::write().

777  { return _boundary_ids; }
std::set< boundary_id_type > _boundary_ids
A collection of user-specified boundary ids for sides, edges, nodes, and shell faces.

◆ get_edge_boundary_ids()

const std::set<boundary_id_type>& libMesh::BoundaryInfo::get_edge_boundary_ids ( ) const
inline
Returns
A reference to the set of all boundary IDs specified on edges of semilocal mesh elements.
Note
Edge-based boundary IDs should only be used in 3D.

Definition at line 798 of file boundary_info.h.

References _edge_boundary_ids.

Referenced by libMesh::DofMap::check_dirichlet_bcid_consistency(), libMesh::MeshBase::get_info(), libMesh::ExodusII_IO_Helper::initialize(), and WriteEdgesetData::testWriteImpl().

799  { return _edge_boundary_ids; }
std::set< boundary_id_type > _edge_boundary_ids
Set of user-specified boundary IDs for edges only.

◆ get_edgeset_map()

const std::multimap<const Elem *, std::pair<unsigned short int, boundary_id_type> >& libMesh::BoundaryInfo::get_edgeset_map ( ) const
inline
Returns
A const reference to the edgeset map.

Definition at line 905 of file boundary_info.h.

References _boundary_edge_id.

906  { return _boundary_edge_id; }
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_edge_id
Data structure that maps edges of elements to boundary ids.

◆ get_edgeset_name()

const std::string & libMesh::BoundaryInfo::get_edgeset_name ( boundary_id_type  id) const
Returns
A const reference to an optional edgeset name.

Definition at line 3005 of file boundary_info.C.

References _es_id_to_name.

Referenced by libMesh::ExodusII_IO_Helper::write_elements().

3006 {
3007  static const std::string empty_string;
3008  std::map<boundary_id_type, std::string>::const_iterator it =
3009  _es_id_to_name.find(id);
3010  if (it == _es_id_to_name.end())
3011  return empty_string;
3012  else
3013  return it->second;
3014 }
std::map< boundary_id_type, std::string > _es_id_to_name
This structure maintains the mapping of named edge sets for file formats (Exodus, Gmsh) that support ...

◆ get_edgeset_name_map()

const std::map<boundary_id_type, std::string>& libMesh::BoundaryInfo::get_edgeset_name_map ( ) const
inline

Definition at line 887 of file boundary_info.h.

References _es_id_to_name.

Referenced by libMesh::MeshTools::Generation::build_extrusion(), libMesh::MeshBase::get_info(), and libMesh::UnstructuredMesh::stitching_helper().

888  { return _es_id_to_name; }
std::map< boundary_id_type, std::string > _es_id_to_name
This structure maintains the mapping of named edge sets for file formats (Exodus, Gmsh) that support ...

◆ get_global_boundary_ids()

const std::set< boundary_id_type > & libMesh::BoundaryInfo::get_global_boundary_ids ( ) const
Returns
A set of the boundary ids which exist globally on the mesh. Relies on the mesh being prepared

Definition at line 3283 of file boundary_info.C.

References _global_boundary_ids, _mesh, libMesh::MeshBase::is_prepared(), and libMesh::libmesh_assert().

Referenced by MeshStitchTest::renameAndShift().

3284 {
3286  return _global_boundary_ids;
3287 }
bool is_prepared() const
Definition: mesh_base.h:192
MeshBase * _mesh
A pointer to the Mesh this boundary info pertains to.
std::set< boundary_id_type > _global_boundary_ids
A collection of user-specified boundary ids for sides, edges, nodes, and shell faces.
libmesh_assert(ctx)

◆ get_id_by_name()

boundary_id_type libMesh::BoundaryInfo::get_id_by_name ( std::string_view  name) const
Returns
The id of the named boundary if it exists, invalid_id otherwise.

Definition at line 3022 of file boundary_info.C.

References _es_id_to_name, _ns_id_to_name, _ss_id_to_name, invalid_id, and libMesh::Quality::name().

Referenced by HDGProblem::init().

3023 {
3024  // Search sidesets
3025  for (const auto & [ss_id, ss_name] : _ss_id_to_name)
3026  if (ss_name == name)
3027  return ss_id;
3028 
3029  // Search nodesets
3030  for (const auto & [ns_id, ns_name] : _ns_id_to_name)
3031  if (ns_name == name)
3032  return ns_id;
3033 
3034  // Search edgesets
3035  for (const auto & [es_id, es_name] : _es_id_to_name)
3036  if (es_name == name)
3037  return es_id;
3038 
3039  // If we made it here without returning, we don't have a sideset,
3040  // nodeset, or edgeset by the requested name, so return invalid_id
3041  return invalid_id;
3042 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:42
std::map< boundary_id_type, std::string > _ns_id_to_name
This structure maintains the mapping of named node sets for file formats (Exodus, Gmsh) that support ...
std::map< boundary_id_type, std::string > _ss_id_to_name
This structure maintains the mapping of named side sets for file formats (Exodus, Gmsh) that support ...
static const boundary_id_type invalid_id
Number used for internal use.
std::map< boundary_id_type, std::string > _es_id_to_name
This structure maintains the mapping of named edge sets for file formats (Exodus, Gmsh) that support ...

◆ get_node_boundary_ids()

const std::set<boundary_id_type>& libMesh::BoundaryInfo::get_node_boundary_ids ( ) const
inline
Returns
A reference to the set of all boundary IDs specified on semilocal mesh nodes.

Definition at line 814 of file boundary_info.h.

References _node_boundary_ids.

Referenced by libMesh::DofMap::check_dirichlet_bcid_consistency(), libMesh::Nemesis_IO_Helper::compute_num_global_nodesets(), libMesh::MeshBase::get_info(), and MeshStitchTest::testBoundaryInfo().

815  { return _node_boundary_ids; }
std::set< boundary_id_type > _node_boundary_ids
Set of user-specified boundary IDs for nodes only.

◆ get_nodeset_map()

const std::multimap<const Node *, boundary_id_type>& libMesh::BoundaryInfo::get_nodeset_map ( ) const
inline
Returns
A const reference to the nodeset map.

Definition at line 899 of file boundary_info.h.

References _boundary_node_id.

900  { return _boundary_node_id; }
std::multimap< const Node *, boundary_id_type > _boundary_node_id
Data structure that maps nodes in the mesh to boundary ids.

◆ get_nodeset_name()

const std::string & libMesh::BoundaryInfo::get_nodeset_name ( boundary_id_type  id) const
Returns
A reference for getting an optional name for a nodeset.

Definition at line 2989 of file boundary_info.C.

References _ns_id_to_name.

Referenced by libMesh::ExodusII_IO_Helper::write_nodesets().

2990 {
2991  static const std::string empty_string;
2992  std::map<boundary_id_type, std::string>::const_iterator it =
2993  _ns_id_to_name.find(id);
2994  if (it == _ns_id_to_name.end())
2995  return empty_string;
2996  else
2997  return it->second;
2998 }
std::map< boundary_id_type, std::string > _ns_id_to_name
This structure maintains the mapping of named node sets for file formats (Exodus, Gmsh) that support ...

◆ get_nodeset_name_map()

const std::map<boundary_id_type, std::string>& libMesh::BoundaryInfo::get_nodeset_name_map ( ) const
inline

Definition at line 879 of file boundary_info.h.

References _ns_id_to_name.

Referenced by libMesh::MeshTools::Generation::build_extrusion(), libMesh::MeshBase::get_info(), libMesh::ExodusII_IO_Helper::initialize(), libMesh::UnstructuredMesh::stitching_helper(), MeshStitchTest::testBoundaryInfo(), and libMesh::ExodusII_IO_Helper::write_nodesets().

880  { return _ns_id_to_name; }
std::map< boundary_id_type, std::string > _ns_id_to_name
This structure maintains the mapping of named node sets for file formats (Exodus, Gmsh) that support ...

◆ get_shellface_boundary_ids()

const std::set<boundary_id_type>& libMesh::BoundaryInfo::get_shellface_boundary_ids ( ) const
inline
Returns
A reference to the set of all boundary IDs specified on shell faces.
Note
This is only relevant on shell elements.

Definition at line 807 of file boundary_info.h.

References _shellface_boundary_ids.

808  { return _shellface_boundary_ids; }
std::set< boundary_id_type > _shellface_boundary_ids
Set of user-specified boundary IDs for shellfaces only.

◆ get_side_and_node_maps()

void libMesh::BoundaryInfo::get_side_and_node_maps ( UnstructuredMesh boundary_mesh,
std::map< dof_id_type, dof_id_type > &  node_id_map,
std::map< dof_id_type, unsigned char > &  side_id_map,
Real  tolerance = 1.e-6 
)

Suppose we have used sync to create boundary_mesh.

Then each element in boundary_mesh will have interior_parent defined. This method gets extra data for us:

  • node_id_map stores a map from the node ids on the interior mesh to the corresponding node ids of boundary_mesh.
  • side_id_map stores a map from the element ids of the boundary mesh to the side index of the interior_parent that the boundary element corresponds to. tolerance is used to identify when we have matching elements.

Definition at line 552 of file boundary_info.C.

References libMesh::Elem::interior_parent(), libMesh::Elem::node_id(), libMesh::TensorTools::norm(), libMesh::Real, libMesh::Elem::side_index_range(), and libMesh::Elem::vertex_average().

556 {
557  LOG_SCOPE("get_side_and_node_maps()", "BoundaryInfo");
558 
559  node_id_map.clear();
560  side_id_map.clear();
561 
562  // For building element sides without extraneous allocation
563  ElemSideBuilder side_builder;
564  // Pull objects out of the loop to reduce heap operations
565  const Elem * interior_parent_side;
566 
567  for (const auto & boundary_elem : boundary_mesh.active_element_ptr_range())
568  {
569  const Elem * interior_parent = boundary_elem->interior_parent();
570 
571  // Find out which side of interior_parent boundary_elem corresponds to.
572  // Use distance between average vertex location as a way to check.
573  unsigned char interior_parent_side_index = 0;
574  bool found_matching_sides = false;
575  for (auto side : interior_parent->side_index_range())
576  {
577  interior_parent_side = &side_builder(*interior_parent, side);
578  Real va_distance = (boundary_elem->vertex_average() - interior_parent_side->vertex_average()).norm();
579 
580  if (va_distance < (tolerance * boundary_elem->hmin()))
581  {
582  interior_parent_side_index = cast_int<unsigned char>(side);
583  found_matching_sides = true;
584  break;
585  }
586  }
587 
588  libmesh_error_msg_if(!found_matching_sides, "No matching side found within the specified tolerance");
589 
590  side_id_map[boundary_elem->id()] = interior_parent_side_index;
591 
592  for (auto local_node_index : boundary_elem->node_index_range())
593  {
594  dof_id_type boundary_node_id = boundary_elem->node_id(local_node_index);
595  dof_id_type interior_node_id = interior_parent_side->node_id(local_node_index);
596 
597  node_id_map[interior_node_id] = boundary_node_id;
598  }
599  }
600 }
auto norm(const T &a) -> decltype(std::abs(a))
Definition: tensor_tools.h:74
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
uint8_t dof_id_type
Definition: id_types.h:67

◆ get_side_boundary_ids()

const std::set<boundary_id_type>& libMesh::BoundaryInfo::get_side_boundary_ids ( ) const
inline
Returns
A reference to the set of the boundary IDs specified on sides of semilocal mesh elements.

Definition at line 789 of file boundary_info.h.

References _side_boundary_ids.

Referenced by libMesh::MeshTools::Generation::build_extrusion(), libMesh::Nemesis_IO_Helper::compute_num_global_sidesets(), libMesh::MeshBase::get_info(), and MeshStitchTest::testBoundaryInfo().

790  { return _side_boundary_ids; }
std::set< boundary_id_type > _side_boundary_ids
Set of user-specified boundary IDs for sides only.

◆ get_sideset_map()

const std::multimap<const Elem *, std::pair<unsigned short int, boundary_id_type> >& libMesh::BoundaryInfo::get_sideset_map ( ) const
inline
Returns
A const reference to the sideset map.

Definition at line 911 of file boundary_info.h.

References _boundary_side_id.

912  { return _boundary_side_id; }
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_side_id
Data structure that maps sides of elements to boundary ids.

◆ get_sideset_name()

const std::string & libMesh::BoundaryInfo::get_sideset_name ( boundary_id_type  id) const
Returns
A reference for getting an optional name for a sideset.

Definition at line 2972 of file boundary_info.C.

References _ss_id_to_name.

Referenced by libMesh::UnstructuredMesh::stitching_helper(), and libMesh::ExodusII_IO_Helper::write_sidesets().

2973 {
2974  static const std::string empty_string;
2975  std::map<boundary_id_type, std::string>::const_iterator it =
2976  _ss_id_to_name.find(id);
2977  if (it == _ss_id_to_name.end())
2978  return empty_string;
2979  else
2980  return it->second;
2981 }
std::map< boundary_id_type, std::string > _ss_id_to_name
This structure maintains the mapping of named side sets for file formats (Exodus, Gmsh) that support ...

◆ get_sideset_name_map()

const std::map<boundary_id_type, std::string>& libMesh::BoundaryInfo::get_sideset_name_map ( ) const
inline

Definition at line 871 of file boundary_info.h.

References _ss_id_to_name.

Referenced by libMesh::MeshTools::Generation::build_extrusion(), libMesh::MeshBase::get_info(), libMesh::ExodusII_IO_Helper::initialize(), libMesh::UnstructuredMesh::stitching_helper(), MeshStitchTest::testBoundaryInfo(), and libMesh::ExodusII_IO_Helper::write_sidesets().

872  { return _ss_id_to_name; }
std::map< boundary_id_type, std::string > _ss_id_to_name
This structure maintains the mapping of named side sets for file formats (Exodus, Gmsh) that support ...

◆ has_boundary_id() [1/2]

bool libMesh::BoundaryInfo::has_boundary_id ( const Node *const  node,
const boundary_id_type  id 
) const
Returns
true if node is associated with boundary id.

Definition at line 1266 of file boundary_info.C.

References _boundary_node_id, and libMesh::as_range().

Referenced by LinearElasticity::assemble(), assemble_elasticity(), assemble_poisson(), AssemblyF0::boundary_assembly(), AssemblyF1::boundary_assembly(), AssemblyF2::boundary_assembly(), libMesh::FEMContext::has_side_boundary_id(), LinearElasticityWithContact::initialize_contact_load_paths(), main(), AugmentSparsityOnInterface::mesh_reinit(), operator==(), SolidSystem::side_time_derivative(), BoundaryInfoTest::testBoundaryOnChildrenElementsRefineCoarsen(), SystemsTest::testBoundaryProjectCube(), and BoundaryInfoTest::testEdgeBoundaryConditions().

1268 {
1269  for (const auto & pr : as_range(_boundary_node_id.equal_range(node)))
1270  if (pr.second == id)
1271  return true;
1272 
1273  return false;
1274 }
std::multimap< const Node *, boundary_id_type > _boundary_node_id
Data structure that maps nodes in the mesh to boundary ids.
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
Helper function that allows us to treat a homogenous pair as a range.
Definition: simple_range.h:57

◆ has_boundary_id() [2/2]

bool libMesh::BoundaryInfo::has_boundary_id ( const Elem *const  elem,
const unsigned short int  side,
const boundary_id_type  id 
) const
Returns
true if side side of Elem elem is associated with id.

Definition at line 1460 of file boundary_info.C.

References boundary_ids().

1463 {
1464  std::vector<boundary_id_type> ids;
1465  this->boundary_ids(elem, side, ids);
1466  return (std::find(ids.begin(), ids.end(), id) != ids.end());
1467 }
void boundary_ids(const Node *node, std::vector< boundary_id_type > &vec_to_fill) const
Fills a user-provided std::vector with the boundary ids associated with Node node.

◆ is_children_on_boundary_side()

bool libMesh::BoundaryInfo::is_children_on_boundary_side ( ) const
inline
Returns
Whether or not there may be child elements directly assigned boundary sides

Definition at line 917 of file boundary_info.h.

References _children_on_boundary.

Referenced by libMesh::MeshRefinement::_coarsen_elements(), libMesh::PetscDiffSolver::solve(), and BoundaryInfoTest::testBoundaryOnChildrenElementsRefineCoarsen().

918  { return _children_on_boundary; }

◆ libmesh_assert_valid_multimaps()

void libMesh::BoundaryInfo::libmesh_assert_valid_multimaps ( ) const
private

Helper method for ensuring that our multimaps don't contain entries with duplicate keys and values.

Probably should have picked a different data structure there, and also not given users an accessor with raw access to it...

Definition at line 3290 of file boundary_info.C.

References _boundary_edge_id, _boundary_node_id, _boundary_shellface_id, _boundary_side_id, and libMesh::libmesh_assert().

Referenced by clear_stitched_boundary_side_ids(), and renumber_id().

3291 {
3292 #ifndef NDEBUG
3293  auto verify_multimap = [](const auto & themap) {
3294  for (const auto & [key, val] : themap)
3295  {
3296  auto range = themap.equal_range(key);
3297 
3298  int count = 0;
3299  for (auto it = range.first; it != range.second; ++it)
3300  if (it->second == val)
3301  ++count;
3302 
3303  libmesh_assert(count == 1);
3304  }
3305  };
3306 
3307  verify_multimap(this->_boundary_node_id);
3308  verify_multimap(this->_boundary_edge_id);
3309  verify_multimap(this->_boundary_shellface_id);
3310  verify_multimap(this->_boundary_side_id);
3311 #else
3312  return;
3313 #endif
3314 }
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_side_id
Data structure that maps sides of elements to boundary ids.
std::multimap< const Node *, boundary_id_type > _boundary_node_id
Data structure that maps nodes in the mesh to boundary ids.
libmesh_assert(ctx)
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_shellface_id
Data structure that maps faces of shell elements to boundary ids.
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_edge_id
Data structure that maps edges of elements to boundary ids.

◆ n_boundary_conds()

std::size_t libMesh::BoundaryInfo::n_boundary_conds ( ) const
Returns
The number of element-side-based boundary conditions.

This will be the correct global count even on a distributed mesh.

Definition at line 2185 of file boundary_info.C.

References _boundary_side_id, _mesh, libMesh::ParallelObject::comm(), libMesh::MeshBase::is_serial(), libMesh::ParallelObject::processor_id(), and TIMPI::Communicator::sum().

Referenced by libMesh::MeshTools::Modification::all_tri(), libMesh::MeshTools::Modification::flatten(), libMesh::AbaqusIO::read(), libMesh::Nemesis_IO::read(), AllTriTest::test_helper_2D(), AllTriTest::test_helper_3D(), libMesh::XdrIO::write(), and libMesh::GmshIO::write_mesh().

2186 {
2187  // in serial we know the number of bcs from the
2188  // size of the container
2189  if (_mesh->is_serial())
2190  return _boundary_side_id.size();
2191 
2192  // in parallel we need to sum the number of local bcs
2193  parallel_object_only();
2194 
2195  std::size_t nbcs=0;
2196 
2197  for (const auto & pr : _boundary_side_id)
2198  if (pr.first->processor_id() == this->processor_id())
2199  nbcs++;
2200 
2201  this->comm().sum (nbcs);
2202 
2203  return nbcs;
2204 }
void sum(T &r) const
const Parallel::Communicator & comm() const
MeshBase * _mesh
A pointer to the Mesh this boundary info pertains to.
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_side_id
Data structure that maps sides of elements to boundary ids.
virtual bool is_serial() const
Definition: mesh_base.h:205
processor_id_type processor_id() const

◆ n_boundary_ids() [1/3]

std::size_t libMesh::BoundaryInfo::n_boundary_ids ( ) const
inline
Returns
The number of user-specified boundary ids on the semilocal part of the mesh.
Note
DistributedMesh users may need to compare boundary_ids sets via inter-processor communication.

Definition at line 396 of file boundary_info.h.

References _boundary_ids.

Referenced by libMesh::MeshTools::Subdivision::all_subdivision(), MeshInputTest::testExodusIGASidesets(), MeshInputTest::testLowOrderEdgeBlocks(), BoundaryInfoTest::testMesh(), BoundaryInfoTest::testRenumber(), and libMesh::FroIO::write().

396 { return _boundary_ids.size(); }
std::set< boundary_id_type > _boundary_ids
A collection of user-specified boundary ids for sides, edges, nodes, and shell faces.

◆ n_boundary_ids() [2/3]

unsigned int libMesh::BoundaryInfo::n_boundary_ids ( const Node node) const
Returns
The number of boundary ids associated with Node node.

Definition at line 1290 of file boundary_info.C.

References _boundary_node_id, and distance().

1291 {
1292  auto pos = _boundary_node_id.equal_range(node);
1293  return cast_int<unsigned int>(std::distance(pos.first, pos.second));
1294 }
Real distance(const Point &p)
std::multimap< const Node *, boundary_id_type > _boundary_node_id
Data structure that maps nodes in the mesh to boundary ids.

◆ n_boundary_ids() [3/3]

unsigned int libMesh::BoundaryInfo::n_boundary_ids ( const Elem *const  elem,
const unsigned short int  side 
) const
Returns
The number of boundary ids associated with the side side of element elem.

Definition at line 1547 of file boundary_info.C.

References boundary_ids().

1549 {
1550  std::vector<boundary_id_type> ids;
1551  this->boundary_ids(elem, side, ids);
1552  return cast_int<unsigned int>(ids.size());
1553 }
void boundary_ids(const Node *node, std::vector< boundary_id_type > &vec_to_fill) const
Fills a user-provided std::vector with the boundary ids associated with Node node.

◆ n_edge_boundary_ids()

unsigned int libMesh::BoundaryInfo::n_edge_boundary_ids ( const Elem *const  elem,
const unsigned short int  edge 
) const
Returns
The number of boundary ids associated with the edge edge of element elem.
Note
Edge-based boundary IDs should only be used in 3D.

Definition at line 1358 of file boundary_info.C.

References edge_boundary_ids().

1360 {
1361  std::vector<boundary_id_type> ids;
1362  this->edge_boundary_ids(elem, edge, ids);
1363  return cast_int<unsigned int>(ids.size());
1364 }
void edge_boundary_ids(const Elem *const elem, const unsigned short int edge, std::vector< boundary_id_type > &vec_to_fill) const

◆ n_edge_conds()

std::size_t libMesh::BoundaryInfo::n_edge_conds ( ) const
Returns
The number of edge-based boundary conditions. Edge-based boundary IDs should only be used in 3D.

This will be the correct global count even on a distributed mesh.

Definition at line 2206 of file boundary_info.C.

References _boundary_edge_id, _mesh, libMesh::ParallelObject::comm(), libMesh::MeshBase::is_serial(), libMesh::ParallelObject::processor_id(), and TIMPI::Communicator::sum().

Referenced by libMesh::ExodusII_IO_Helper::initialize(), libMesh::Nemesis_IO::prepare_to_write_nodal_data(), BoundaryInfoTest::testEdgeBoundaryConditions(), WriteEdgesetData::testWriteImpl(), libMesh::Nemesis_IO::write(), libMesh::XdrIO::write(), and libMesh::ExodusII_IO::write().

2207 {
2208  // in serial we know the number of nodesets from the
2209  // size of the container
2210  if (_mesh->is_serial())
2211  return _boundary_edge_id.size();
2212 
2213  // in parallel we need to sum the number of local nodesets
2214  parallel_object_only();
2215 
2216  std::size_t n_edge_bcs=0;
2217 
2218  for (const auto & pr : _boundary_edge_id)
2219  if (pr.first->processor_id() == this->processor_id())
2220  n_edge_bcs++;
2221 
2222  this->comm().sum (n_edge_bcs);
2223 
2224  return n_edge_bcs;
2225 }
void sum(T &r) const
const Parallel::Communicator & comm() const
MeshBase * _mesh
A pointer to the Mesh this boundary info pertains to.
virtual bool is_serial() const
Definition: mesh_base.h:205
processor_id_type processor_id() const
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_edge_id
Data structure that maps edges of elements to boundary ids.

◆ n_nodeset_conds()

std::size_t libMesh::BoundaryInfo::n_nodeset_conds ( ) const
Returns
The number of node-based boundary conditions.

This will be the correct global count even on a distributed mesh.

Definition at line 2250 of file boundary_info.C.

References _boundary_node_id, _mesh, libMesh::ParallelObject::comm(), libMesh::MeshBase::is_serial(), libMesh::ParallelObject::processor_id(), and TIMPI::Communicator::sum().

Referenced by libMesh::XdrIO::write().

2251 {
2252  // in serial we know the number of nodesets from the
2253  // size of the container
2254  if (_mesh->is_serial())
2255  return _boundary_node_id.size();
2256 
2257  // in parallel we need to sum the number of local nodesets
2258  parallel_object_only();
2259 
2260  std::size_t n_nodesets=0;
2261 
2262  for (const auto & pr : _boundary_node_id)
2263  if (pr.first->processor_id() == this->processor_id())
2264  n_nodesets++;
2265 
2266  this->comm().sum (n_nodesets);
2267 
2268  return n_nodesets;
2269 }
void sum(T &r) const
const Parallel::Communicator & comm() const
MeshBase * _mesh
A pointer to the Mesh this boundary info pertains to.
virtual bool is_serial() const
Definition: mesh_base.h:205
std::multimap< const Node *, boundary_id_type > _boundary_node_id
Data structure that maps nodes in the mesh to boundary ids.
processor_id_type processor_id() const

◆ n_processors()

processor_id_type libMesh::ParallelObject::n_processors ( ) const
inlineinherited
Returns
The number of processors in the group.

Definition at line 103 of file parallel_object.h.

References libMesh::ParallelObject::_communicator, libMesh::libmesh_assert(), and TIMPI::Communicator::size().

Referenced by libMesh::Partitioner::_find_global_index_by_pid_map(), _find_id_maps(), libMesh::DofMap::add_constraints_to_send_list(), libMesh::PetscDMWrapper::add_dofs_to_section(), libMesh::DistributedMesh::add_elem(), libMesh::DofMap::add_neighbors_to_send_list(), libMesh::DistributedMesh::add_node(), libMesh::System::add_vector(), libMesh::LaplaceMeshSmoother::allgather_graph(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::FEMSystem::assembly(), libMesh::Nemesis_IO::assert_symmetric_cmaps(), libMesh::Partitioner::assign_partitioning(), libMesh::AztecLinearSolver< T >::AztecLinearSolver(), libMesh::EquationSystems::build_parallel_elemental_solution_vector(), libMesh::DistributedMesh::clear(), libMesh::DistributedMesh::clear_elems(), libMesh::Nemesis_IO_Helper::compute_border_node_ids(), libMesh::Nemesis_IO_Helper::construct_nemesis_filename(), libMesh::ExodusII_IO::copy_scalar_solution(), libMesh::Nemesis_IO::copy_scalar_solution(), libMesh::UnstructuredMesh::create_pid_mesh(), libMesh::MeshTools::create_processor_bounding_box(), libMesh::DofMap::distribute_dofs(), libMesh::DofMap::distribute_scalar_dofs(), libMesh::DistributedMesh::DistributedMesh(), libMesh::EnsightIO::EnsightIO(), libMesh::RBEIMEvaluation::gather_bfs(), libMesh::MeshBase::get_info(), libMesh::SystemSubsetBySubdomain::init(), libMesh::PetscDMWrapper::init_and_attach_petscdm(), libMesh::Nemesis_IO_Helper::initialize(), libMesh::ExodusII_IO_Helper::initialize(), libMesh::DistributedMesh::insert_elem(), libMesh::MeshTools::libmesh_assert_contiguous_dof_ids(), 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< Node >(), libMesh::MeshTools::libmesh_assert_valid_boundary_ids(), libMesh::MeshTools::libmesh_assert_valid_dof_ids(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::MeshTools::libmesh_assert_valid_refinement_flags(), libMesh::DofMap::local_variable_indices(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::MeshBase::n_active_elem_on_proc(), libMesh::MeshBase::n_elem_on_proc(), libMesh::MeshBase::n_nodes_on_proc(), libMesh::RBEIMEvaluation::node_gather_bfs(), libMesh::Partitioner::partition(), libMesh::MeshBase::partition(), libMesh::Partitioner::partition_unpartitioned_elements(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), libMesh::DofMap::prepare_send_list(), libMesh::DofMap::print_dof_constraints(), libMesh::NameBasedIO::read(), libMesh::Nemesis_IO::read(), libMesh::CheckpointIO::read(), libMesh::CheckpointIO::read_connectivity(), libMesh::XdrIO::read_header(), libMesh::CheckpointIO::read_nodes(), libMesh::System::read_parallel_data(), libMesh::System::read_SCALAR_dofs(), libMesh::System::read_serialized_blocked_dof_objects(), libMesh::System::read_serialized_vector(), libMesh::DistributedMesh::renumber_dof_objects(), libMesh::Partitioner::repartition(), OverlappingFunctorTest::run_partitioner_test(), libMesh::DofMap::scatter_constraints(), libMesh::DistributedMesh::set_next_unique_id(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::PetscDMWrapper::set_point_range_in_section(), WriteVecAndScalar::setupTests(), libMesh::RBEIMEvaluation::side_gather_bfs(), DistributedMeshTest::testRemoteElemError(), CheckpointIOTest::testSplitter(), libMesh::MeshRefinement::uniformly_coarsen(), libMesh::DistributedMesh::update_parallel_id_counts(), libMesh::GMVIO::write_binary(), libMesh::GMVIO::write_discontinuous_gmv(), libMesh::ExodusII_IO_Helper::write_nodal_coordinates(), libMesh::VTKIO::write_nodal_data(), libMesh::ExodusII_IO::write_nodal_data(), libMesh::System::write_parallel_data(), libMesh::System::write_SCALAR_dofs(), libMesh::XdrIO::write_serialized_bcs_helper(), libMesh::System::write_serialized_blocked_dof_objects(), libMesh::XdrIO::write_serialized_connectivity(), libMesh::XdrIO::write_serialized_nodes(), and libMesh::XdrIO::write_serialized_nodesets().

104  {
105  processor_id_type returnval =
106  cast_int<processor_id_type>(_communicator.size());
107  libmesh_assert(returnval); // We never have an empty comm
108  return returnval;
109  }
const Parallel::Communicator & _communicator
processor_id_type size() const
uint8_t processor_id_type
libmesh_assert(ctx)

◆ n_raw_boundary_ids()

unsigned int libMesh::BoundaryInfo::n_raw_boundary_ids ( const Elem *const  elem,
const unsigned short int  side 
) const
Returns
The number of raw (excludes ancestors) boundary ids associated with the side side of element elem.

Definition at line 1556 of file boundary_info.C.

References raw_boundary_ids().

1558 {
1559  std::vector<boundary_id_type> ids;
1560  this->raw_boundary_ids(elem, side, ids);
1561  return cast_int<unsigned int>(ids.size());
1562 }
void raw_boundary_ids(const Elem *const elem, const unsigned short int side, std::vector< boundary_id_type > &vec_to_fill) const

◆ n_shellface_boundary_ids()

unsigned int libMesh::BoundaryInfo::n_shellface_boundary_ids ( const Elem *const  elem,
const unsigned short int  shellface 
) const
Returns
The number of boundary ids associated with the specified shell face of element elem.
Note
This is only relevant for shell elements.

Definition at line 1426 of file boundary_info.C.

References shellface_boundary_ids().

1428 {
1429  std::vector<boundary_id_type> ids;
1430  this->shellface_boundary_ids(elem, shellface, ids);
1431  return cast_int<unsigned int>(ids.size());
1432 }
void shellface_boundary_ids(const Elem *const elem, const unsigned short int shellface, std::vector< boundary_id_type > &vec_to_fill) const

◆ n_shellface_conds()

std::size_t libMesh::BoundaryInfo::n_shellface_conds ( ) const
Returns
The number of shellface-based boundary conditions. This is only relevant on shell elements.

This will be the correct global count even on a distributed mesh.

Definition at line 2228 of file boundary_info.C.

References _boundary_shellface_id, _mesh, libMesh::ParallelObject::comm(), libMesh::MeshBase::is_serial(), libMesh::ParallelObject::processor_id(), and TIMPI::Communicator::sum().

Referenced by BoundaryInfoTest::testShellFaceConstraints(), and libMesh::XdrIO::write().

2229 {
2230  // in serial we know the number of nodesets from the
2231  // size of the container
2232  if (_mesh->is_serial())
2233  return _boundary_shellface_id.size();
2234 
2235  // in parallel we need to sum the number of local nodesets
2236  parallel_object_only();
2237 
2238  std::size_t n_shellface_bcs=0;
2239 
2240  for (const auto & pr : _boundary_shellface_id)
2241  if (pr.first->processor_id() == this->processor_id())
2242  n_shellface_bcs++;
2243 
2244  this->comm().sum (n_shellface_bcs);
2245 
2246  return n_shellface_bcs;
2247 }
void sum(T &r) const
const Parallel::Communicator & comm() const
MeshBase * _mesh
A pointer to the Mesh this boundary info pertains to.
virtual bool is_serial() const
Definition: mesh_base.h:205
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_shellface_id
Data structure that maps faces of shell elements to boundary ids.
processor_id_type processor_id() const

◆ nodeset_name()

std::string & libMesh::BoundaryInfo::nodeset_name ( boundary_id_type  id)
Returns
A writable reference for setting an optional name for a nodeset.

Definition at line 3000 of file boundary_info.C.

References _ns_id_to_name.

Referenced by libMesh::AbaqusIO::assign_boundary_node_ids(), libMesh::MeshTools::Generation::build_cube(), build_side_list_from_node_list(), libMesh::Nemesis_IO::read(), libMesh::ExodusII_IO::read(), libMesh::GmshIO::read_mesh(), MeshStitchTest::renameAndShift(), BoundaryInfoTest::testNameCopying(), and WriteNodesetData::testWriteImpl().

3001 {
3002  return _ns_id_to_name[id];
3003 }
std::map< boundary_id_type, std::string > _ns_id_to_name
This structure maintains the mapping of named node sets for file formats (Exodus, Gmsh) that support ...

◆ operator!=()

bool libMesh::BoundaryInfo::operator!= ( const BoundaryInfo other_boundary_info) const
inline

Definition at line 88 of file boundary_info.h.

89  {
90  return !(*this == other_boundary_info);
91  }

◆ operator=()

BoundaryInfo & libMesh::BoundaryInfo::operator= ( const BoundaryInfo other_boundary_info)

Copy assignment operator.

Note
this will still reference the same MeshBase it was constructed with. Boundary data copied from other_boundary_info will refer to objects in this mesh which have the same DofObject::id() as the corresponding objects in the other mesh.

We're going to attempt to pull new pointers out of the mesh assigned to this boundary info.

This will only work if the mesh assigned to this BoundaryInfo is the same mesh object as other_boundary_info or was constructed in exactly the same way (or constructed as a copy, or a refined copy without renumbering, etc.).

Definition at line 109 of file boundary_info.C.

References _boundary_edge_id, _boundary_ids, _boundary_node_id, _boundary_shellface_id, _boundary_side_id, _edge_boundary_ids, _es_id_to_name, _global_boundary_ids, _mesh, _node_boundary_ids, _ns_id_to_name, _shellface_boundary_ids, _side_boundary_ids, _ss_id_to_name, clear(), libMesh::MeshBase::elem_ptr(), and libMesh::MeshBase::node_ptr().

110 {
111  // Overwrite any preexisting boundary info
112  this->clear();
113 
124  // Copy node boundary info
125  for (const auto & [node, bid] : other_boundary_info._boundary_node_id)
126  _boundary_node_id.emplace(_mesh->node_ptr(node->id()), bid);
127 
128  // Copy edge boundary info
129  for (const auto & [elem, id_pair] : other_boundary_info._boundary_edge_id)
130  _boundary_edge_id.emplace(_mesh->elem_ptr(elem->id()), id_pair);
131 
132  // Copy shellface boundary info
133  for (const auto & [elem, id_pair] : other_boundary_info._boundary_shellface_id)
134  _boundary_shellface_id.emplace(_mesh->elem_ptr(elem->id()), id_pair);
135 
136  // Copy side boundary info
137  for (const auto & [elem, id_pair] : other_boundary_info._boundary_side_id)
138  _boundary_side_id.emplace(_mesh->elem_ptr(elem->id()), id_pair);
139 
140  _boundary_ids = other_boundary_info._boundary_ids;
141  _global_boundary_ids = other_boundary_info._global_boundary_ids;
142  _side_boundary_ids = other_boundary_info._side_boundary_ids;
143  _node_boundary_ids = other_boundary_info._node_boundary_ids;
144  _edge_boundary_ids = other_boundary_info._edge_boundary_ids;
145  _shellface_boundary_ids = other_boundary_info._shellface_boundary_ids;
146 
147  _ss_id_to_name = other_boundary_info._ss_id_to_name;
148  _ns_id_to_name = other_boundary_info._ns_id_to_name;
149  _es_id_to_name = other_boundary_info._es_id_to_name;
150 
151  return *this;
152 }
std::map< boundary_id_type, std::string > _ns_id_to_name
This structure maintains the mapping of named node sets for file formats (Exodus, Gmsh) that support ...
std::set< boundary_id_type > _node_boundary_ids
Set of user-specified boundary IDs for nodes only.
std::set< boundary_id_type > _edge_boundary_ids
Set of user-specified boundary IDs for edges only.
std::set< boundary_id_type > _boundary_ids
A collection of user-specified boundary ids for sides, edges, nodes, and shell faces.
std::set< boundary_id_type > _side_boundary_ids
Set of user-specified boundary IDs for sides only.
MeshBase * _mesh
A pointer to the Mesh this boundary info pertains to.
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_side_id
Data structure that maps sides of elements to boundary ids.
std::set< boundary_id_type > _global_boundary_ids
A collection of user-specified boundary ids for sides, edges, nodes, and shell faces.
std::map< boundary_id_type, std::string > _ss_id_to_name
This structure maintains the mapping of named side sets for file formats (Exodus, Gmsh) that support ...
std::map< boundary_id_type, std::string > _es_id_to_name
This structure maintains the mapping of named edge sets for file formats (Exodus, Gmsh) that support ...
std::multimap< const Node *, boundary_id_type > _boundary_node_id
Data structure that maps nodes in the mesh to boundary ids.
void clear()
Clears the underlying data structures and restores the object to a pristine state with no data stored...
virtual const Elem * elem_ptr(const dof_id_type i) const =0
std::set< boundary_id_type > _shellface_boundary_ids
Set of user-specified boundary IDs for shellfaces only.
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_shellface_id
Data structure that maps faces of shell elements to boundary ids.
virtual const Node * node_ptr(const dof_id_type i) const =0
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_edge_id
Data structure that maps edges of elements to boundary ids.

◆ operator==()

bool libMesh::BoundaryInfo::operator== ( const BoundaryInfo other_boundary_info) const

This tests for data equality via element ids.

Definition at line 155 of file boundary_info.C.

References _boundary_edge_id, _boundary_ids, _boundary_node_id, _boundary_shellface_id, _boundary_side_id, _children_on_boundary, _edge_boundary_ids, _es_id_to_name, _global_boundary_ids, _mesh, _node_boundary_ids, _ns_id_to_name, _shellface_boundary_ids, _side_boundary_ids, _ss_id_to_name, boundary_ids(), edge_boundary_ids(), has_boundary_id(), libMesh::DofObject::id(), libMesh::index_range(), libMesh::MeshBase::query_elem_ptr(), libMesh::MeshBase::query_node_ptr(), and shellface_boundary_ids().

156 {
157  for (const auto & [other_node, bid] : other_boundary_info._boundary_node_id)
158  {
159  const Node * node = this->_mesh->query_node_ptr(other_node->id());
160  if (!node)
161  return false;
162  if (!this->has_boundary_id(node, bid))
163  return false;
164  }
165  for (const auto & [node, bid] : this->_boundary_node_id)
166  {
167  const Node * other_node =
168  other_boundary_info._mesh->query_node_ptr(node->id());
169  if (!other_node)
170  return false;
171  if (!other_boundary_info.has_boundary_id(other_node, bid))
172  return false;
173  }
174 
175  auto compare_edges = [&](const Elem * elem,
176  const Elem * other_elem,
177  unsigned short int edge)
178  {
179  if (!elem)
180  return false;
181  if (!other_elem)
182  return false;
183 
184  std::vector<boundary_id_type> our_edges, other_edges;
185  this->edge_boundary_ids(elem, edge, our_edges);
186  other_boundary_info.edge_boundary_ids(other_elem, edge, other_edges);
187  if (our_edges.size() != other_edges.size())
188  return false;
189 
190  std::sort(our_edges.begin(), our_edges.end());
191  std::sort(other_edges.begin(), other_edges.end());
192  for (auto i : index_range(our_edges))
193  if (our_edges[i] != other_edges[i])
194  return false;
195  return true;
196  };
197 
198  for (const auto & [other_elem, edge_id_pair] : other_boundary_info._boundary_edge_id)
199  {
200  const Elem * elem = this->_mesh->query_elem_ptr(other_elem->id());
201  if (!compare_edges(elem, other_elem, edge_id_pair.first))
202  return false;
203  }
204 
205  for (const auto & [elem, edge_id_pair] : this->_boundary_edge_id)
206  {
207  const Elem * other_elem = other_boundary_info._mesh->query_elem_ptr(elem->id());
208  if (!compare_edges(elem, other_elem, edge_id_pair.first))
209  return false;
210  }
211 
212  auto compare_sides = [&](const Elem * elem,
213  const Elem * other_elem,
214  unsigned short int side)
215  {
216  if (!elem)
217  return false;
218  if (!other_elem)
219  return false;
220 
221  std::vector<boundary_id_type> our_sides, other_sides;
222  this->boundary_ids(elem, side, our_sides);
223  other_boundary_info.boundary_ids(other_elem, side, other_sides);
224  if (our_sides.size() != other_sides.size())
225  return false;
226 
227  std::sort(our_sides.begin(), our_sides.end());
228  std::sort(other_sides.begin(), other_sides.end());
229  for (auto i : index_range(our_sides))
230  if (our_sides[i] != other_sides[i])
231  return false;
232  return true;
233  };
234 
235  for (const auto & [other_elem, side_id_pair] : other_boundary_info._boundary_side_id)
236  {
237  const Elem * elem = this->_mesh->query_elem_ptr(other_elem->id());
238  if (!compare_sides(elem, other_elem, side_id_pair.first))
239  return false;
240  }
241 
242  for (const auto & [elem, side_id_pair] : this->_boundary_side_id)
243  {
244  const Elem * other_elem = other_boundary_info._mesh->query_elem_ptr(elem->id());
245  if (!compare_sides(elem, other_elem, side_id_pair.first))
246  return false;
247  }
248 
249  auto compare_shellfaces = [&](const Elem * elem,
250  const Elem * other_elem,
251  unsigned short int shellface)
252  {
253  if (!elem)
254  return false;
255  if (!other_elem)
256  return false;
257 
258  std::vector<boundary_id_type> our_shellfaces, other_shellfaces;
259  this->shellface_boundary_ids(elem, shellface, our_shellfaces);
260  other_boundary_info.shellface_boundary_ids(other_elem, shellface, other_shellfaces);
261  if (our_shellfaces.size() != other_shellfaces.size())
262  return false;
263 
264  std::sort(our_shellfaces.begin(), our_shellfaces.end());
265  std::sort(other_shellfaces.begin(), other_shellfaces.end());
266  for (auto i : index_range(our_shellfaces))
267  if (our_shellfaces[i] != other_shellfaces[i])
268  return false;
269  return true;
270  };
271 
272  for (const auto & [other_elem, shellface_id_pair] : other_boundary_info._boundary_shellface_id)
273  {
274  const Elem * elem = this->_mesh->query_elem_ptr(other_elem->id());
275  if (!compare_shellfaces(elem, other_elem, shellface_id_pair.first))
276  return false;
277  }
278 
279  for (const auto & [elem, shellface_id_pair] : this->_boundary_shellface_id)
280  {
281  const Elem * other_elem = other_boundary_info._mesh->query_elem_ptr(elem->id());
282  if (!compare_shellfaces(elem, other_elem, shellface_id_pair.first))
283  return false;
284  }
285 
286  if (_children_on_boundary != other_boundary_info._children_on_boundary)
287  return false;
288 
289  auto compare_sets = [](const auto & set1, const auto & set2)
290  {
291  if (set1.size() != set2.size())
292  return false;
293  for (boundary_id_type bid : set1)
294  if (!set2.count(bid))
295  return false;
296 
297  return true;
298  };
299 
300  if (!compare_sets(_boundary_ids,
301  other_boundary_info._boundary_ids) ||
302  !compare_sets(_global_boundary_ids,
303  other_boundary_info._global_boundary_ids) ||
304  !compare_sets(_edge_boundary_ids,
305  other_boundary_info._edge_boundary_ids) ||
306  !compare_sets(_node_boundary_ids,
307  other_boundary_info._node_boundary_ids) ||
308  !compare_sets(_shellface_boundary_ids,
309  other_boundary_info._shellface_boundary_ids) ||
310  !compare_sets(_side_boundary_ids,
311  other_boundary_info._side_boundary_ids))
312  return false;
313 
314  auto compare_maps = [](const auto & map1, const auto & map2)
315  {
316  if (map1.size() != map2.size())
317  return false;
318  for (const auto & pair : map1)
319  if (!map2.count(pair.first) ||
320  map2.at(pair.first) != pair.second)
321  return false;
322 
323  return true;
324  };
325 
326  if (!compare_maps(_ss_id_to_name,
327  other_boundary_info._ss_id_to_name) ||
328  !compare_maps(_ns_id_to_name,
329  other_boundary_info._ns_id_to_name) ||
330  !compare_maps(_es_id_to_name,
331  other_boundary_info._es_id_to_name))
332  return false;
333 
334  return true;
335 }
std::map< boundary_id_type, std::string > _ns_id_to_name
This structure maintains the mapping of named node sets for file formats (Exodus, Gmsh) that support ...
std::set< boundary_id_type > _node_boundary_ids
Set of user-specified boundary IDs for nodes only.
bool has_boundary_id(const Node *const node, const boundary_id_type id) const
std::set< boundary_id_type > _edge_boundary_ids
Set of user-specified boundary IDs for edges only.
std::set< boundary_id_type > _boundary_ids
A collection of user-specified boundary ids for sides, edges, nodes, and shell faces.
std::set< boundary_id_type > _side_boundary_ids
Set of user-specified boundary IDs for sides only.
void shellface_boundary_ids(const Elem *const elem, const unsigned short int shellface, std::vector< boundary_id_type > &vec_to_fill) const
void boundary_ids(const Node *node, std::vector< boundary_id_type > &vec_to_fill) const
Fills a user-provided std::vector with the boundary ids associated with Node node.
MeshBase * _mesh
A pointer to the Mesh this boundary info pertains to.
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_side_id
Data structure that maps sides of elements to boundary ids.
std::set< boundary_id_type > _global_boundary_ids
A collection of user-specified boundary ids for sides, edges, nodes, and shell faces.
std::map< boundary_id_type, std::string > _ss_id_to_name
This structure maintains the mapping of named side sets for file formats (Exodus, Gmsh) that support ...
int8_t boundary_id_type
Definition: id_types.h:51
std::map< boundary_id_type, std::string > _es_id_to_name
This structure maintains the mapping of named edge sets for file formats (Exodus, Gmsh) that support ...
std::multimap< const Node *, boundary_id_type > _boundary_node_id
Data structure that maps nodes in the mesh to boundary ids.
virtual const Node * query_node_ptr(const dof_id_type i) const =0
virtual const Elem * query_elem_ptr(const dof_id_type i) const =0
void edge_boundary_ids(const Elem *const elem, const unsigned short int edge, std::vector< boundary_id_type > &vec_to_fill) const
std::set< boundary_id_type > _shellface_boundary_ids
Set of user-specified boundary IDs for shellfaces only.
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_shellface_id
Data structure that maps faces of shell elements to boundary ids.
auto index_range(const T &sizable)
Helper function that returns an IntRange<std::size_t> representing all the indices of the passed-in v...
Definition: int_range.h:111
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_edge_id
Data structure that maps edges of elements to boundary ids.

◆ parallel_sync_node_ids()

void libMesh::BoundaryInfo::parallel_sync_node_ids ( )

Definition at line 2503 of file boundary_info.C.

References _boundary_node_id, _mesh, libMesh::as_range(), libMesh::ParallelObject::comm(), libMesh::index_range(), libMesh::MeshBase::node_ptr(), and libMesh::ParallelObject::processor_id().

2504 {
2505  // we need BCs for ghost nodes.
2506  std::unordered_map<processor_id_type, std::vector<dof_id_type>>
2507  node_ids_requested;
2508 
2509  // Determine what nodes we need to request
2510  for (const auto & node : _mesh->node_ptr_range())
2511  {
2512  const processor_id_type pid = node->processor_id();
2513  if (pid != this->processor_id())
2514  node_ids_requested[pid].push_back(node->id());
2515  }
2516 
2517  typedef std::vector<boundary_id_type> datum_type;
2518 
2519  // gather the node ID and boundary_id_type for the ghost nodes
2520  auto node_id_gather_functor =
2521  [this]
2523  const std::vector<dof_id_type> & ids,
2524  std::vector<datum_type> & data)
2525  {
2526  data.resize(ids.size());
2527  for (auto i : index_range(ids))
2528  {
2529  Node * node = _mesh->node_ptr(ids[i]);
2530  for (const auto & pr : as_range(_boundary_node_id.equal_range(node)))
2531  data[i].push_back(pr.second);
2532  }
2533  };
2534 
2535  // update the _boundary_node_id on this processor
2536  auto node_id_action_functor =
2537  [this]
2539  const std::vector<dof_id_type> & ids,
2540  std::vector<datum_type> & data)
2541  {
2542  for (auto i : index_range(ids))
2543  {
2544  Node * node = _mesh->node_ptr(ids[i]);
2545  //clear boundary node
2546  _boundary_node_id.erase(node);
2547  // update boundary node
2548  for (const auto & pr : data[i])
2549  _boundary_node_id.insert(std::make_pair(node, pr));
2550  }
2551  };
2552 
2553 
2554  datum_type * datum_type_ex = nullptr;
2555  Parallel::pull_parallel_vector_data
2556  (this->comm(), node_ids_requested, node_id_gather_functor,
2557  node_id_action_functor, datum_type_ex);
2558 }
const Parallel::Communicator & comm() const
MeshBase * _mesh
A pointer to the Mesh this boundary info pertains to.
uint8_t processor_id_type
Definition: id_types.h:104
uint8_t processor_id_type
std::multimap< const Node *, boundary_id_type > _boundary_node_id
Data structure that maps nodes in the mesh to boundary ids.
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
Helper function that allows us to treat a homogenous pair as a range.
Definition: simple_range.h:57
virtual const Node * node_ptr(const dof_id_type i) const =0
processor_id_type processor_id() const
auto index_range(const T &sizable)
Helper function that returns an IntRange<std::size_t> representing all the indices of the passed-in v...
Definition: int_range.h:111

◆ parallel_sync_side_ids()

void libMesh::BoundaryInfo::parallel_sync_side_ids ( )

Synchronize the boundary element side and node across processors.

This function is needed when boundary info is changed by adding or removing sides on the fly. Note: if the side of a ghost element is changed, then you would need to do do parallel push (see e.g., timpi/parallel_sync.h) and then sync.

Definition at line 2447 of file boundary_info.C.

References _boundary_side_id, _mesh, libMesh::as_range(), libMesh::ParallelObject::comm(), libMesh::MeshBase::elem_ptr(), libMesh::index_range(), libMesh::ParallelObject::processor_id(), and side_id.

2448 {
2449  // we need BCs for ghost elements.
2450  std::unordered_map<processor_id_type, std::vector<dof_id_type>>
2451  elem_ids_requested;
2452 
2453  // Determine what elements we need to request
2454  for (const auto & elem : _mesh->element_ptr_range())
2455  {
2456  const processor_id_type pid = elem->processor_id();
2457  if (pid != this->processor_id())
2458  elem_ids_requested[pid].push_back(elem->id());
2459  }
2460 
2461  typedef std::vector<std::pair<unsigned short int, boundary_id_type>> datum_type;
2462 
2463  // gather the element ID, side, and boundary_id_type for the ghost elements
2464  auto elem_id_gather_functor =
2465  [this]
2467  const std::vector<dof_id_type> & ids,
2468  std::vector<datum_type> & data)
2469  {
2470  data.resize(ids.size());
2471  for (auto i : index_range(ids))
2472  {
2473  Elem * elem = _mesh->elem_ptr(ids[i]);
2474  for (const auto & pr : as_range(_boundary_side_id.equal_range(elem)))
2475  data[i].push_back(std::make_pair(pr.second.first, pr.second.second));
2476  }
2477  };
2478  // update the _boundary_side_id on this processor
2479  auto elem_id_action_functor =
2480  [this]
2482  const std::vector<dof_id_type> & ids,
2483  std::vector<datum_type> & data)
2484  {
2485  for (auto i : index_range(ids))
2486  {
2487  Elem * elem = _mesh->elem_ptr(ids[i]);
2488  //clear boundary sides for this element
2489  _boundary_side_id.erase(elem);
2490  // update boundary sides for it
2491  for (const auto & [side_id, bndry_id] : data[i])
2492  _boundary_side_id.insert(std::make_pair(elem, std::make_pair(side_id, bndry_id)));
2493  }
2494  };
2495 
2496 
2497  datum_type * datum_type_ex = nullptr;
2498  Parallel::pull_parallel_vector_data
2499  (this->comm(), elem_ids_requested, elem_id_gather_functor,
2500  elem_id_action_functor, datum_type_ex);
2501 }
const boundary_id_type side_id
const Parallel::Communicator & comm() const
MeshBase * _mesh
A pointer to the Mesh this boundary info pertains to.
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_side_id
Data structure that maps sides of elements to boundary ids.
uint8_t processor_id_type
Definition: id_types.h:104
uint8_t processor_id_type
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
Helper function that allows us to treat a homogenous pair as a range.
Definition: simple_range.h:57
virtual const Elem * elem_ptr(const dof_id_type i) const =0
processor_id_type processor_id() const
auto index_range(const T &sizable)
Helper function that returns an IntRange<std::size_t> representing all the indices of the passed-in v...
Definition: int_range.h:111

◆ print_info()

void libMesh::BoundaryInfo::print_info ( std::ostream &  out_stream = libMesh::out) const

Prints the boundary information data structure.

Definition at line 2829 of file boundary_info.C.

References _boundary_edge_id, _boundary_node_id, _boundary_shellface_id, and _boundary_side_id.

2830 {
2831  // Print out the nodal BCs
2832  if (!_boundary_node_id.empty())
2833  {
2834  out_stream << "Nodal Boundary conditions:" << std::endl
2835  << "--------------------------" << std::endl
2836  << " (Node No., ID) " << std::endl;
2837 
2838  for (const auto & [node, bndry_id] : _boundary_node_id)
2839  out_stream << " (" << node->id()
2840  << ", " << bndry_id
2841  << ")" << std::endl;
2842  }
2843 
2844  // Print out the element edge BCs
2845  if (!_boundary_edge_id.empty())
2846  {
2847  out_stream << std::endl
2848  << "Edge Boundary conditions:" << std::endl
2849  << "-------------------------" << std::endl
2850  << " (Elem No., Edge No., ID) " << std::endl;
2851 
2852  for (const auto & [elem, id_pair] : _boundary_edge_id)
2853  out_stream << " (" << elem->id()
2854  << ", " << id_pair.first
2855  << ", " << id_pair.second
2856  << ")" << std::endl;
2857  }
2858 
2859  // Print out the element shellface BCs
2860  if (!_boundary_shellface_id.empty())
2861  {
2862  out_stream << std::endl
2863  << "Shell-face Boundary conditions:" << std::endl
2864  << "-------------------------" << std::endl
2865  << " (Elem No., Shell-face No., ID) " << std::endl;
2866 
2867  for (const auto & [elem, id_pair] : _boundary_shellface_id)
2868  out_stream << " (" << elem->id()
2869  << ", " << id_pair.first
2870  << ", " << id_pair.second
2871  << ")" << std::endl;
2872  }
2873 
2874  // Print out the element side BCs
2875  if (!_boundary_side_id.empty())
2876  {
2877  out_stream << std::endl
2878  << "Side Boundary conditions:" << std::endl
2879  << "-------------------------" << std::endl
2880  << " (Elem No., Side No., ID) " << std::endl;
2881 
2882  for (const auto & [elem, id_pair] : _boundary_side_id)
2883  out_stream << " (" << elem->id()
2884  << ", " << id_pair.first
2885  << ", " << id_pair.second
2886  << ")" << std::endl;
2887  }
2888 }
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_side_id
Data structure that maps sides of elements to boundary ids.
std::multimap< const Node *, boundary_id_type > _boundary_node_id
Data structure that maps nodes in the mesh to boundary ids.
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_shellface_id
Data structure that maps faces of shell elements to boundary ids.
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_edge_id
Data structure that maps edges of elements to boundary ids.

◆ print_summary()

void libMesh::BoundaryInfo::print_summary ( std::ostream &  out_stream = libMesh::out) const

Prints a summary of the boundary information.

Definition at line 2892 of file boundary_info.C.

References _boundary_edge_id, _boundary_node_id, _boundary_shellface_id, and _boundary_side_id.

Referenced by main().

2893 {
2894  // Print out the nodal BCs
2895  if (!_boundary_node_id.empty())
2896  {
2897  out_stream << "Nodal Boundary conditions:" << std::endl
2898  << "--------------------------" << std::endl
2899  << " (ID, number of nodes) " << std::endl;
2900 
2901  std::map<boundary_id_type, std::size_t> ID_counts;
2902 
2903  for (const auto & pr : _boundary_node_id)
2904  ID_counts[pr.second]++;
2905 
2906  for (const auto & [bndry_id, cnt] : ID_counts)
2907  out_stream << " (" << bndry_id
2908  << ", " << cnt
2909  << ")" << std::endl;
2910  }
2911 
2912  // Print out the element edge BCs
2913  if (!_boundary_edge_id.empty())
2914  {
2915  out_stream << std::endl
2916  << "Edge Boundary conditions:" << std::endl
2917  << "-------------------------" << std::endl
2918  << " (ID, number of edges) " << std::endl;
2919 
2920  std::map<boundary_id_type, std::size_t> ID_counts;
2921 
2922  for (const auto & pr : _boundary_edge_id)
2923  ID_counts[pr.second.second]++;
2924 
2925  for (const auto & [bndry_id, cnt] : ID_counts)
2926  out_stream << " (" << bndry_id
2927  << ", " << cnt
2928  << ")" << std::endl;
2929  }
2930 
2931 
2932  // Print out the element edge BCs
2933  if (!_boundary_shellface_id.empty())
2934  {
2935  out_stream << std::endl
2936  << "Shell-face Boundary conditions:" << std::endl
2937  << "-------------------------" << std::endl
2938  << " (ID, number of shellfaces) " << std::endl;
2939 
2940  std::map<boundary_id_type, std::size_t> ID_counts;
2941 
2942  for (const auto & pr : _boundary_shellface_id)
2943  ID_counts[pr.second.second]++;
2944 
2945  for (const auto & [bndry_id, cnt] : ID_counts)
2946  out_stream << " (" << bndry_id
2947  << ", " << cnt
2948  << ")" << std::endl;
2949  }
2950 
2951  // Print out the element side BCs
2952  if (!_boundary_side_id.empty())
2953  {
2954  out_stream << std::endl
2955  << "Side Boundary conditions:" << std::endl
2956  << "-------------------------" << std::endl
2957  << " (ID, number of sides) " << std::endl;
2958 
2959  std::map<boundary_id_type, std::size_t> ID_counts;
2960 
2961  for (const auto & pr : _boundary_side_id)
2962  ID_counts[pr.second.second]++;
2963 
2964  for (const auto & [bndry_id, cnt] : ID_counts)
2965  out_stream << " (" << bndry_id
2966  << ", " << cnt
2967  << ")" << std::endl;
2968  }
2969 }
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_side_id
Data structure that maps sides of elements to boundary ids.
std::multimap< const Node *, boundary_id_type > _boundary_node_id
Data structure that maps nodes in the mesh to boundary ids.
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_shellface_id
Data structure that maps faces of shell elements to boundary ids.
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_edge_id
Data structure that maps edges of elements to boundary ids.

◆ processor_id()

processor_id_type libMesh::ParallelObject::processor_id ( ) const
inlineinherited
Returns
The rank of this processor in the group.

Definition at line 114 of file parallel_object.h.

References libMesh::ParallelObject::_communicator, and TIMPI::Communicator::rank().

Referenced by _find_id_maps(), libMesh::PetscDMWrapper::add_dofs_to_section(), libMesh::DistributedMesh::add_elem(), add_elements(), libMesh::DofMap::add_neighbors_to_send_list(), libMesh::DistributedMesh::add_node(), libMesh::MeshTools::Modification::all_tri(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::FEMSystem::assembly(), libMesh::Nemesis_IO::assert_symmetric_cmaps(), libMesh::Partitioner::assign_partitioning(), libMesh::Nemesis_IO_Helper::build_element_and_node_maps(), libMesh::Partitioner::build_graph(), libMesh::InfElemBuilder::build_inf_elem(), build_node_list_from_side_list(), libMesh::EquationSystems::build_parallel_elemental_solution_vector(), libMesh::EquationSystems::build_parallel_solution_vector(), libMesh::DistributedMesh::clear(), libMesh::DistributedMesh::clear_elems(), libMesh::ExodusII_IO_Helper::close(), libMesh::Nemesis_IO_Helper::compute_border_node_ids(), libMesh::Nemesis_IO_Helper::compute_communication_map_parameters(), libMesh::Nemesis_IO_Helper::compute_internal_and_border_elems_and_internal_nodes(), libMesh::RBConstruction::compute_max_error_bound(), libMesh::Nemesis_IO_Helper::compute_node_communication_maps(), libMesh::Nemesis_IO_Helper::compute_num_global_elem_blocks(), libMesh::Nemesis_IO_Helper::compute_num_global_nodesets(), libMesh::Nemesis_IO_Helper::compute_num_global_sidesets(), libMesh::Nemesis_IO_Helper::construct_nemesis_filename(), libMesh::ExodusII_IO::copy_elemental_solution(), libMesh::ExodusII_IO::copy_nodal_solution(), libMesh::ExodusII_IO::copy_scalar_solution(), libMesh::Nemesis_IO::copy_scalar_solution(), libMesh::MeshTools::correct_node_proc_ids(), libMesh::ExodusII_IO_Helper::create(), libMesh::DistributedMesh::delete_elem(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::DofMap::distribute_dofs(), libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::DofMap::distribute_scalar_dofs(), libMesh::DistributedMesh::DistributedMesh(), libMesh::DofMap::end_dof(), libMesh::DofMap::end_old_dof(), libMesh::EnsightIO::EnsightIO(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SubFunctor::find_dofs_to_send(), libMesh::MeshFunction::find_element(), libMesh::MeshFunction::find_elements(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::DofMap::first_dof(), libMesh::DofMap::first_old_dof(), libMesh::RBEIMEvaluation::gather_bfs(), libMesh::Nemesis_IO_Helper::get_cmap_params(), libMesh::Nemesis_IO_Helper::get_eb_info_global(), libMesh::Nemesis_IO_Helper::get_elem_cmap(), libMesh::Nemesis_IO_Helper::get_elem_map(), libMesh::MeshBase::get_info(), libMesh::DofMap::get_info(), libMesh::Nemesis_IO_Helper::get_init_global(), libMesh::Nemesis_IO_Helper::get_init_info(), libMesh::Nemesis_IO_Helper::get_loadbal_param(), libMesh::DofMap::get_local_constraints(), libMesh::Nemesis_IO_Helper::get_node_cmap(), libMesh::Nemesis_IO_Helper::get_node_map(), libMesh::Nemesis_IO_Helper::get_ns_param_global(), libMesh::Nemesis_IO_Helper::get_ss_param_global(), libMesh::SparsityPattern::Build::handle_vi_vj(), libMesh::LaplaceMeshSmoother::init(), libMesh::SystemSubsetBySubdomain::init(), libMesh::PetscDMWrapper::init_and_attach_petscdm(), HeatSystem::init_data(), libMesh::ExodusII_IO_Helper::initialize(), libMesh::ExodusII_IO_Helper::initialize_element_variables(), libMesh::ExodusII_IO_Helper::initialize_global_variables(), libMesh::ExodusII_IO_Helper::initialize_nodal_variables(), libMesh::DistributedMesh::insert_elem(), libMesh::DofMap::is_evaluable(), libMesh::SparsityPattern::Build::join(), libMesh::TransientRBEvaluation::legacy_write_offline_data_to_files(), libMesh::RBSCMEvaluation::legacy_write_offline_data_to_files(), libMesh::RBEvaluation::legacy_write_offline_data_to_files(), libMesh::MeshTools::libmesh_assert_consistent_distributed(), libMesh::MeshTools::libmesh_assert_consistent_distributed_nodes(), libMesh::MeshTools::libmesh_assert_contiguous_dof_ids(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_object_ids(), libMesh::DofMap::local_variable_indices(), main(), libMesh::MeshRefinement::make_coarsening_compatible(), AugmentSparsityOnInterface::mesh_reinit(), libMesh::TriangulatorInterface::MeshedHole::MeshedHole(), libMesh::MeshBase::n_active_local_elem(), n_boundary_conds(), n_edge_conds(), libMesh::DofMap::n_local_dofs(), libMesh::System::n_local_dofs(), libMesh::MeshBase::n_local_elem(), libMesh::MeshBase::n_local_nodes(), n_nodeset_conds(), n_shellface_conds(), libMesh::RBEIMEvaluation::node_gather_bfs(), libMesh::SparsityPattern::Build::operator()(), libMesh::DistributedMesh::own_node(), parallel_sync_node_ids(), parallel_sync_side_ids(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), libMesh::DofMap::print_dof_constraints(), libMesh::DofMap::process_mesh_constraint_rows(), libMesh::Nemesis_IO_Helper::put_cmap_params(), libMesh::Nemesis_IO_Helper::put_elem_cmap(), libMesh::Nemesis_IO_Helper::put_elem_map(), libMesh::Nemesis_IO_Helper::put_loadbal_param(), libMesh::Nemesis_IO_Helper::put_node_cmap(), libMesh::Nemesis_IO_Helper::put_node_map(), libMesh::NameBasedIO::read(), libMesh::Nemesis_IO::read(), libMesh::XdrIO::read(), libMesh::CheckpointIO::read(), libMesh::EquationSystems::read(), libMesh::ExodusII_IO_Helper::read_elem_num_map(), libMesh::ExodusII_IO_Helper::read_global_values(), libMesh::ExodusII_IO::read_header(), libMesh::CheckpointIO::read_header(), libMesh::XdrIO::read_header(), libMesh::System::read_header(), libMesh::System::read_legacy_data(), libMesh::DynaIO::read_mesh(), libMesh::ExodusII_IO_Helper::read_node_num_map(), libMesh::System::read_parallel_data(), libMesh::TransientRBConstruction::read_riesz_representors_from_files(), libMesh::RBConstruction::read_riesz_representors_from_files(), libMesh::System::read_SCALAR_dofs(), libMesh::XdrIO::read_serialized_bc_names(), libMesh::XdrIO::read_serialized_bcs_helper(), libMesh::System::read_serialized_blocked_dof_objects(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::System::read_serialized_data(), libMesh::XdrIO::read_serialized_nodes(), libMesh::XdrIO::read_serialized_nodesets(), libMesh::XdrIO::read_serialized_subdomain_names(), libMesh::System::read_serialized_vector(), libMesh::System::read_serialized_vectors(), libMesh::Nemesis_IO_Helper::read_var_names_impl(), libMesh::DistributedMesh::renumber_dof_objects(), libMesh::DistributedMesh::renumber_nodes_and_elements(), libMesh::DofMap::scatter_constraints(), libMesh::CheckpointIO::select_split_config(), libMesh::DistributedMesh::set_next_unique_id(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::PetscDMWrapper::set_point_range_in_section(), libMesh::RBEIMEvaluation::side_gather_bfs(), ExodusTest< elem_type >::test_read_gold(), ExodusTest< elem_type >::test_write(), MeshInputTest::testAbaqusRead(), MeshInputTest::testCopyElementSolutionImpl(), MeshInputTest::testCopyElementVectorImpl(), MeshInputTest::testCopyNodalSolutionImpl(), DefaultCouplingTest::testCoupling(), PointNeighborCouplingTest::testCoupling(), MeshInputTest::testDynaFileMappings(), MeshInputTest::testDynaNoSplines(), MeshInputTest::testDynaReadElem(), MeshInputTest::testDynaReadPatch(), MeshInputTest::testExodusFileMappings(), MeshInputTest::testExodusIGASidesets(), MeshInputTest::testExodusWriteElementDataFromDiscontinuousNodalData(), MeshInputTest::testLowOrderEdgeBlocks(), SystemsTest::testProjectMatrix1D(), SystemsTest::testProjectMatrix2D(), SystemsTest::testProjectMatrix3D(), BoundaryInfoTest::testShellFaceConstraints(), MeshInputTest::testSingleElementImpl(), WriteVecAndScalar::testSolution(), CheckpointIOTest::testSplitter(), MeshInputTest::testTetgenIO(), libMesh::MeshTools::total_weight(), libMesh::MeshRefinement::uniformly_coarsen(), libMesh::DistributedMesh::update_parallel_id_counts(), libMesh::DTKAdapter::update_variable_values(), libMesh::NameBasedIO::write(), libMesh::XdrIO::write(), libMesh::CheckpointIO::write(), libMesh::EquationSystems::write(), libMesh::GMVIO::write_discontinuous_gmv(), libMesh::ExodusII_IO::write_element_data(), libMesh::ExodusII_IO_Helper::write_element_values(), libMesh::ExodusII_IO_Helper::write_element_values_element_major(), libMesh::ExodusII_IO_Helper::write_elements(), libMesh::ExodusII_IO_Helper::write_elemset_data(), libMesh::ExodusII_IO_Helper::write_elemsets(), libMesh::ExodusII_IO::write_global_data(), libMesh::ExodusII_IO_Helper::write_global_values(), libMesh::System::write_header(), libMesh::ExodusII_IO::write_information_records(), libMesh::ExodusII_IO_Helper::write_information_records(), libMesh::ExodusII_IO_Helper::write_nodal_coordinates(), libMesh::UCDIO::write_nodal_data(), libMesh::VTKIO::write_nodal_data(), libMesh::ExodusII_IO::write_nodal_data(), libMesh::ExodusII_IO::write_nodal_data_common(), libMesh::ExodusII_IO::write_nodal_data_discontinuous(), libMesh::ExodusII_IO_Helper::write_nodal_values(), libMesh::ExodusII_IO_Helper::write_nodeset_data(), libMesh::Nemesis_IO_Helper::write_nodesets(), libMesh::ExodusII_IO_Helper::write_nodesets(), libMesh::RBEIMEvaluation::write_out_interior_basis_functions(), libMesh::RBEIMEvaluation::write_out_node_basis_functions(), libMesh::RBEIMEvaluation::write_out_side_basis_functions(), write_output_solvedata(), libMesh::System::write_parallel_data(), libMesh::RBConstruction::write_riesz_representors_to_files(), libMesh::System::write_SCALAR_dofs(), libMesh::XdrIO::write_serialized_bc_names(), libMesh::XdrIO::write_serialized_bcs_helper(), libMesh::System::write_serialized_blocked_dof_objects(), libMesh::XdrIO::write_serialized_connectivity(), libMesh::System::write_serialized_data(), libMesh::XdrIO::write_serialized_nodes(), libMesh::XdrIO::write_serialized_nodesets(), libMesh::XdrIO::write_serialized_subdomain_names(), libMesh::System::write_serialized_vector(), libMesh::System::write_serialized_vectors(), libMesh::ExodusII_IO_Helper::write_sideset_data(), libMesh::Nemesis_IO_Helper::write_sidesets(), libMesh::ExodusII_IO_Helper::write_sidesets(), libMesh::ExodusII_IO::write_timestep(), libMesh::ExodusII_IO_Helper::write_timestep(), and libMesh::ExodusII_IO::write_timestep_discontinuous().

115  { return cast_int<processor_id_type>(_communicator.rank()); }
processor_id_type rank() const
const Parallel::Communicator & _communicator

◆ raw_boundary_ids()

void libMesh::BoundaryInfo::raw_boundary_ids ( const Elem *const  elem,
const unsigned short int  side,
std::vector< boundary_id_type > &  vec_to_fill 
) const
Returns
The list of raw boundary ids associated with the side side of element elem.

These ids are "raw" because they exclude ids which are implicit, such as a child's inheritance of its ancestors' boundary id.

Definition at line 1566 of file boundary_info.C.

References _boundary_side_id, _children_on_boundary, libMesh::as_range(), libMesh::libmesh_assert(), libMesh::Elem::n_sides(), and libMesh::Elem::parent().

Referenced by copy_boundary_ids(), n_raw_boundary_ids(), and remove_side().

1569 {
1570  libmesh_assert(elem);
1571 
1572  // Only query BCs for sides that exist.
1573  libmesh_assert_less (side, elem->n_sides());
1574 
1575  // Clear out any previous contents
1576  vec_to_fill.clear();
1577 
1578  // Only level-0 elements store BCs.
1579  if (elem->parent() && !_children_on_boundary)
1580  return;
1581 
1582  // Check each element in the range to see if its side matches the requested side.
1583  for (const auto & pr : as_range(_boundary_side_id.equal_range(elem)))
1584  if (pr.second.first == side)
1585  vec_to_fill.push_back(pr.second.second);
1586 }
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_side_id
Data structure that maps sides of elements to boundary ids.
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
Helper function that allows us to treat a homogenous pair as a range.
Definition: simple_range.h:57
libmesh_assert(ctx)

◆ raw_edge_boundary_ids()

void libMesh::BoundaryInfo::raw_edge_boundary_ids ( const Elem *const  elem,
const unsigned short int  edge,
std::vector< boundary_id_type > &  vec_to_fill 
) const
Returns
The list of raw boundary ids associated with the edge edge of element elem.

These ids are "raw" because they exclude ids which are implicit, such as a child's inheritance of its ancestors' boundary id.

Note
Edge-based boundary IDs should only be used in 3D.

Definition at line 1368 of file boundary_info.C.

References _boundary_edge_id, libMesh::as_range(), libMesh::libmesh_assert(), libMesh::Elem::n_edges(), and libMesh::Elem::parent().

Referenced by copy_boundary_ids().

1371 {
1372  libmesh_assert(elem);
1373 
1374  // Only query BCs for edges that exist.
1375  libmesh_assert_less (edge, elem->n_edges());
1376 
1377  // Clear out any previous contents
1378  vec_to_fill.clear();
1379 
1380  // Only level-0 elements store BCs.
1381  if (elem->parent())
1382  return;
1383 
1384  // Check each element in the range to see if its edge matches the requested edge.
1385  for (const auto & pr : as_range(_boundary_edge_id.equal_range(elem)))
1386  if (pr.second.first == edge)
1387  vec_to_fill.push_back(pr.second.second);
1388 }
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
Helper function that allows us to treat a homogenous pair as a range.
Definition: simple_range.h:57
libmesh_assert(ctx)
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_edge_id
Data structure that maps edges of elements to boundary ids.

◆ raw_shellface_boundary_ids()

void libMesh::BoundaryInfo::raw_shellface_boundary_ids ( const Elem *const  elem,
const unsigned short int  shellface,
std::vector< boundary_id_type > &  vec_to_fill 
) const
Returns
The list of raw boundary ids associated with the specified shell face of element elem.

These ids are "raw" because they exclude ids which are implicit, such as a child's inheritance of its ancestors' boundary id.

Note
This is only relevant for shell elements.

Definition at line 1436 of file boundary_info.C.

References _boundary_shellface_id, libMesh::as_range(), libMesh::libmesh_assert(), and libMesh::Elem::parent().

Referenced by copy_boundary_ids().

1439 {
1440  libmesh_assert(elem);
1441 
1442  // Shells only have 2 faces
1443  libmesh_assert_less(shellface, 2);
1444 
1445  // Clear out any previous contents
1446  vec_to_fill.clear();
1447 
1448  // Only level-0 elements store BCs.
1449  if (elem->parent())
1450  return;
1451 
1452  // Check each element in the range to see if its shellface matches the requested shellface.
1453  for (const auto & pr : as_range(_boundary_shellface_id.equal_range(elem)))
1454  if (pr.second.first == shellface)
1455  vec_to_fill.push_back(pr.second.second);
1456 }
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
Helper function that allows us to treat a homogenous pair as a range.
Definition: simple_range.h:57
libmesh_assert(ctx)
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_shellface_id
Data structure that maps faces of shell elements to boundary ids.

◆ regenerate_id_sets()

void libMesh::BoundaryInfo::regenerate_id_sets ( )

Clears and regenerates the cached sets of ids.

This is necessary after use of remove_*() functions, which remove individual id associations (an O(1) process) without checking to see whether that is the last association with the id (an O(N) process.

Definition at line 360 of file boundary_info.C.

References _boundary_edge_id, _boundary_ids, _boundary_node_id, _boundary_shellface_id, _boundary_side_id, libMesh::ParallelObject::_communicator, _edge_boundary_ids, _es_id_to_name, _global_boundary_ids, _mesh, _node_boundary_ids, _ns_id_to_name, _shellface_boundary_ids, _side_boundary_ids, _ss_id_to_name, libMesh::MeshBase::is_serial(), libMesh::libmesh_assert(), and TIMPI::Communicator::set_union().

Referenced by libMesh::UnstructuredMesh::all_first_order(), clear_stitched_boundary_side_ids(), libMesh::TetGenMeshInterface::delete_2D_hull_elements(), main(), libMesh::TetGenMeshInterface::pointset_convexhull(), and libMesh::MeshBase::prepare_for_use().

361 {
362  const auto old_ss_id_to_name = _ss_id_to_name;
363  const auto old_ns_id_to_name = _ns_id_to_name;
364  const auto old_es_id_to_name = _es_id_to_name;
365 
366  // Clear the old caches
367  _boundary_ids.clear();
368  _side_boundary_ids.clear();
369  _node_boundary_ids.clear();
370  _edge_boundary_ids.clear();
371  _shellface_boundary_ids.clear();
372  _ss_id_to_name.clear();
373  _ns_id_to_name.clear();
374  _es_id_to_name.clear();
375 
376  // Loop over id maps to regenerate each set.
377  for (const auto & pr : _boundary_node_id)
378  {
379  const boundary_id_type id = pr.second;
380  _boundary_ids.insert(id);
381  _node_boundary_ids.insert(id);
382  auto it = old_ns_id_to_name.find(id);
383  if (it != old_ns_id_to_name.end())
384  _ns_id_to_name.emplace(id, it->second);
385  }
386 
387  for (const auto & pr : _boundary_edge_id)
388  {
389  const boundary_id_type id = pr.second.second;
390  _boundary_ids.insert(id);
391  _edge_boundary_ids.insert(id);
392  auto it = old_es_id_to_name.find(id);
393  if (it != old_es_id_to_name.end())
394  _es_id_to_name.emplace(id, it->second);
395  }
396 
397  for (const auto & pr : _boundary_side_id)
398  {
399  const boundary_id_type id = pr.second.second;
400  _boundary_ids.insert(id);
401  _side_boundary_ids.insert(id);
402  auto it = old_ss_id_to_name.find(id);
403  if (it != old_ss_id_to_name.end())
404  _ss_id_to_name.emplace(id, it->second);
405  }
406 
407  for (const auto & pr : _boundary_shellface_id)
408  {
409  const boundary_id_type id = pr.second.second;
410  _boundary_ids.insert(id);
411  _shellface_boundary_ids.insert(id);
412  }
413 
414  // Handle global data
417  if (!_mesh->is_serial())
418  {
423  }
424 }
std::map< boundary_id_type, std::string > _ns_id_to_name
This structure maintains the mapping of named node sets for file formats (Exodus, Gmsh) that support ...
std::set< boundary_id_type > _node_boundary_ids
Set of user-specified boundary IDs for nodes only.
std::set< boundary_id_type > _edge_boundary_ids
Set of user-specified boundary IDs for edges only.
std::set< boundary_id_type > _boundary_ids
A collection of user-specified boundary ids for sides, edges, nodes, and shell faces.
std::set< boundary_id_type > _side_boundary_ids
Set of user-specified boundary IDs for sides only.
const Parallel::Communicator & _communicator
MeshBase * _mesh
A pointer to the Mesh this boundary info pertains to.
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_side_id
Data structure that maps sides of elements to boundary ids.
std::set< boundary_id_type > _global_boundary_ids
A collection of user-specified boundary ids for sides, edges, nodes, and shell faces.
std::map< boundary_id_type, std::string > _ss_id_to_name
This structure maintains the mapping of named side sets for file formats (Exodus, Gmsh) that support ...
virtual bool is_serial() const
Definition: mesh_base.h:205
int8_t boundary_id_type
Definition: id_types.h:51
std::map< boundary_id_type, std::string > _es_id_to_name
This structure maintains the mapping of named edge sets for file formats (Exodus, Gmsh) that support ...
std::multimap< const Node *, boundary_id_type > _boundary_node_id
Data structure that maps nodes in the mesh to boundary ids.
libmesh_assert(ctx)
std::set< boundary_id_type > _shellface_boundary_ids
Set of user-specified boundary IDs for shellfaces only.
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_shellface_id
Data structure that maps faces of shell elements to boundary ids.
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_edge_id
Data structure that maps edges of elements to boundary ids.
void set_union(T &data, const unsigned int root_id) const

◆ remove() [1/2]

void libMesh::BoundaryInfo::remove ( const Node node)

◆ remove() [2/2]

void libMesh::BoundaryInfo::remove ( const Elem elem)

Removes the boundary conditions associated with element elem, if any exist.

Definition at line 1643 of file boundary_info.C.

References _boundary_edge_id, _boundary_shellface_id, _boundary_side_id, and libMesh::libmesh_assert().

1644 {
1645  libmesh_assert(elem);
1646 
1647  // Erase everything associated with elem
1648  _boundary_edge_id.erase (elem);
1649  _boundary_side_id.erase (elem);
1650  _boundary_shellface_id.erase (elem);
1651 }
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_side_id
Data structure that maps sides of elements to boundary ids.
libmesh_assert(ctx)
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_shellface_id
Data structure that maps faces of shell elements to boundary ids.
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_edge_id
Data structure that maps edges of elements to boundary ids.

◆ remove_edge() [1/2]

void libMesh::BoundaryInfo::remove_edge ( const Elem elem,
const unsigned short int  edge 
)

Removes all boundary conditions associated with edge edge of element elem, if any exist.

Definition at line 1655 of file boundary_info.C.

References _boundary_edge_id, libMesh::Elem::level(), libMesh::libmesh_assert(), and libMesh::Elem::n_edges().

Referenced by renumber_id(), and libMesh::Elem::swap2boundaryedges().

1657 {
1658  libmesh_assert(elem);
1659 
1660  // Only touch BCs for edges that exist.
1661  libmesh_assert_less (edge, elem->n_edges());
1662 
1663  // Only level 0 elements are stored in BoundaryInfo.
1664  libmesh_assert_equal_to (elem->level(), 0);
1665 
1666  // Erase (elem, edge, *) entries from map.
1667  erase_if(_boundary_edge_id, elem,
1668  [edge](decltype(_boundary_edge_id)::mapped_type & pr)
1669  {return pr.first == edge;});
1670 }
libmesh_assert(ctx)
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_edge_id
Data structure that maps edges of elements to boundary ids.

◆ remove_edge() [2/2]

void libMesh::BoundaryInfo::remove_edge ( const Elem elem,
const unsigned short int  edge,
const boundary_id_type  id 
)

Removes the boundary id id from edge edge of element elem, if it exists.

Definition at line 1674 of file boundary_info.C.

References _boundary_edge_id, libMesh::Elem::level(), libMesh::libmesh_assert(), and libMesh::Elem::n_edges().

1677 {
1678  libmesh_assert(elem);
1679 
1680  // Only touch BCs for edges that exist.
1681  libmesh_assert_less (edge, elem->n_edges());
1682 
1683  // Only level 0 elements are stored in BoundaryInfo.
1684  libmesh_assert_equal_to (elem->level(), 0);
1685 
1686  // Erase (elem, edge, id) entries from map.
1687  erase_if(_boundary_edge_id, elem,
1688  [edge, id](decltype(_boundary_edge_id)::mapped_type & pr)
1689  {return pr.first == edge && pr.second == id;});
1690 }
libmesh_assert(ctx)
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_edge_id
Data structure that maps edges of elements to boundary ids.

◆ remove_id()

void libMesh::BoundaryInfo::remove_id ( boundary_id_type  id,
bool  global = false 
)

Removes all entities (nodes, sides, edges, shellfaces) with boundary id id from their respective containers and erases any record of id's existence from the BoundaryInfo object.

That is, after calling remove_id(), id will no longer be in the sets returned by get_boundary_ids(), get_side_boundary_ids(), etc., and will not be in the bc_id_list vector returned by build_side_list(), etc. Set the global parameter to true if this is being called for all processes in the object's communicator, in which case we will remove the id from the global boundary ID container

Definition at line 1782 of file boundary_info.C.

References _boundary_edge_id, _boundary_ids, _boundary_node_id, _boundary_shellface_id, _boundary_side_id, _edge_boundary_ids, _es_id_to_name, _global_boundary_ids, _node_boundary_ids, _ns_id_to_name, _shellface_boundary_ids, _side_boundary_ids, and _ss_id_to_name.

Referenced by BoundaryInfoTest::testMesh(), and BoundaryInfoTest::testRenumber().

1783 {
1784  // Erase id from ids containers
1785  _boundary_ids.erase(id);
1786  _side_boundary_ids.erase(id);
1787  _edge_boundary_ids.erase(id);
1788  _shellface_boundary_ids.erase(id);
1789  _node_boundary_ids.erase(id);
1790  _ss_id_to_name.erase(id);
1791  _ns_id_to_name.erase(id);
1792  _es_id_to_name.erase(id);
1793  if (global)
1794  _global_boundary_ids.erase(id);
1795 
1796  // Erase (*, id) entries from map.
1797  erase_if(_boundary_node_id,
1798  [id](decltype(_boundary_node_id)::mapped_type & val)
1799  {return val == id;});
1800 
1801  // Erase (*, *, id) entries from map.
1802  erase_if(_boundary_edge_id,
1803  [id](decltype(_boundary_edge_id)::mapped_type & pr)
1804  {return pr.second == id;});
1805 
1806  // Erase (*, *, id) entries from map.
1807  erase_if(_boundary_shellface_id,
1808  [id](decltype(_boundary_shellface_id)::mapped_type & pr)
1809  {return pr.second == id;});
1810 
1811  // Erase (*, *, id) entries from map.
1812  erase_if(_boundary_side_id,
1813  [id](decltype(_boundary_side_id)::mapped_type & pr)
1814  {return pr.second == id;});
1815 }
std::map< boundary_id_type, std::string > _ns_id_to_name
This structure maintains the mapping of named node sets for file formats (Exodus, Gmsh) that support ...
std::set< boundary_id_type > _node_boundary_ids
Set of user-specified boundary IDs for nodes only.
std::set< boundary_id_type > _edge_boundary_ids
Set of user-specified boundary IDs for edges only.
std::set< boundary_id_type > _boundary_ids
A collection of user-specified boundary ids for sides, edges, nodes, and shell faces.
std::set< boundary_id_type > _side_boundary_ids
Set of user-specified boundary IDs for sides only.
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_side_id
Data structure that maps sides of elements to boundary ids.
std::set< boundary_id_type > _global_boundary_ids
A collection of user-specified boundary ids for sides, edges, nodes, and shell faces.
std::map< boundary_id_type, std::string > _ss_id_to_name
This structure maintains the mapping of named side sets for file formats (Exodus, Gmsh) that support ...
std::map< boundary_id_type, std::string > _es_id_to_name
This structure maintains the mapping of named edge sets for file formats (Exodus, Gmsh) that support ...
std::multimap< const Node *, boundary_id_type > _boundary_node_id
Data structure that maps nodes in the mesh to boundary ids.
std::set< boundary_id_type > _shellface_boundary_ids
Set of user-specified boundary IDs for shellfaces only.
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_shellface_id
Data structure that maps faces of shell elements to boundary ids.
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_edge_id
Data structure that maps edges of elements to boundary ids.

◆ remove_node()

void libMesh::BoundaryInfo::remove_node ( const Node node,
const boundary_id_type  id 
)

Removes boundary id id from node node, if it exists.

Definition at line 1630 of file boundary_info.C.

References _boundary_node_id, and libMesh::libmesh_assert().

Referenced by clear_stitched_boundary_side_ids(), and renumber_id().

1632 {
1633  libmesh_assert(node);
1634 
1635  // Erase (node, id) entry from map.
1636  erase_if(_boundary_node_id, node,
1637  [id](decltype(_boundary_node_id)::mapped_type & val)
1638  {return val == id;});
1639 }
std::multimap< const Node *, boundary_id_type > _boundary_node_id
Data structure that maps nodes in the mesh to boundary ids.
libmesh_assert(ctx)

◆ remove_shellface() [1/2]

void libMesh::BoundaryInfo::remove_shellface ( const Elem elem,
const unsigned short int  shellface 
)

Removes all boundary conditions associated with shell face shellface of element elem, if any exist.

Definition at line 1693 of file boundary_info.C.

References _boundary_shellface_id, libMesh::Elem::level(), and libMesh::libmesh_assert().

Referenced by renumber_id().

1695 {
1696  libmesh_assert(elem);
1697 
1698  // Only level 0 elements are stored in BoundaryInfo.
1699  libmesh_assert_equal_to (elem->level(), 0);
1700 
1701  // Shells only have 2 faces
1702  libmesh_assert_less(shellface, 2);
1703 
1704  // Erase (elem, shellface, *) entries from map.
1705  erase_if(_boundary_shellface_id, elem,
1706  [shellface](decltype(_boundary_shellface_id)::mapped_type & pr)
1707  {return pr.first == shellface;});
1708 }
libmesh_assert(ctx)
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_shellface_id
Data structure that maps faces of shell elements to boundary ids.

◆ remove_shellface() [2/2]

void libMesh::BoundaryInfo::remove_shellface ( const Elem elem,
const unsigned short int  shellface,
const boundary_id_type  id 
)

Removes all boundary conditions associated with shell face shellface of element elem, if any exist.

Definition at line 1712 of file boundary_info.C.

References _boundary_shellface_id, libMesh::Elem::level(), and libMesh::libmesh_assert().

1715 {
1716  libmesh_assert(elem);
1717 
1718  // Only level 0 elements are stored in BoundaryInfo.
1719  libmesh_assert_equal_to (elem->level(), 0);
1720 
1721  // Shells only have 2 faces
1722  libmesh_assert_less(shellface, 2);
1723 
1724  // Erase (elem, shellface, id) entries from map.
1725  erase_if(_boundary_shellface_id, elem,
1726  [shellface, id](decltype(_boundary_shellface_id)::mapped_type & pr)
1727  {return pr.first == shellface && pr.second == id;});
1728 }
libmesh_assert(ctx)
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_shellface_id
Data structure that maps faces of shell elements to boundary ids.

◆ remove_side() [1/2]

void libMesh::BoundaryInfo::remove_side ( const Elem elem,
const unsigned short int  side 
)

Removes all boundary conditions associated with side side of element elem, if any exist.

Definition at line 1730 of file boundary_info.C.

References _boundary_side_id, libMesh::libmesh_assert(), and libMesh::Elem::n_sides().

Referenced by main(), renumber_id(), libMesh::Elem::swap2boundarysides(), BoundaryInfoTest::testBoundaryOnChildrenElementsRefineCoarsen(), and BoundaryInfoTest::testBoundaryOnChildrenErrors().

1732 {
1733  libmesh_assert(elem);
1734 
1735  // Only touch BCs for sides that exist.
1736  libmesh_assert_less (side, elem->n_sides());
1737 
1738  // Erase (elem, side, *) entries from map.
1739  erase_if(_boundary_side_id, elem,
1740  [side](decltype(_boundary_side_id)::mapped_type & pr)
1741  {return pr.first == side;});
1742 }
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_side_id
Data structure that maps sides of elements to boundary ids.
libmesh_assert(ctx)

◆ remove_side() [2/2]

void libMesh::BoundaryInfo::remove_side ( const Elem elem,
const unsigned short int  side,
const boundary_id_type  id 
)

Removes the boundary id id from side side of element elem, if it exists.

Definition at line 1746 of file boundary_info.C.

References _boundary_side_id, boundary_ids(), libMesh::Elem::level(), libMesh::libmesh_assert(), libMesh::Elem::n_sides(), and raw_boundary_ids().

1749 {
1750  libmesh_assert(elem);
1751 
1752  // Only touch BCs for sides that exist.
1753  libmesh_assert_less (side, elem->n_sides());
1754 
1755 #ifdef LIBMESH_ENABLE_AMR
1756  // Here we have to stop and check if somebody tries to remove an ancestor's boundary ID
1757  // through a child
1758  if (elem->level())
1759  {
1760  std::vector<boundary_id_type> bd_ids;
1761  this->boundary_ids(elem,side,bd_ids);
1762  if(std::find(bd_ids.begin(), bd_ids.end(), id) != bd_ids.end())
1763  {
1764  std::vector<boundary_id_type> raw_bd_ids;
1765  this->raw_boundary_ids(elem, side, raw_bd_ids);
1766  if(std::find(raw_bd_ids.begin(), raw_bd_ids.end(), id) == raw_bd_ids.end())
1767  libmesh_not_implemented_msg("We cannot delete boundary ID "
1768  + std::to_string(id) +
1769  " using a child because it is inherited from an ancestor.");
1770  }
1771  }
1772 #endif
1773 
1774  // Erase (elem, side, id) entries from map.
1775  erase_if(_boundary_side_id, elem,
1776  [side, id](decltype(_boundary_side_id)::mapped_type & pr)
1777  {return pr.first == side && pr.second == id;});
1778 }
void raw_boundary_ids(const Elem *const elem, const unsigned short int side, std::vector< boundary_id_type > &vec_to_fill) const
void boundary_ids(const Node *node, std::vector< boundary_id_type > &vec_to_fill) const
Fills a user-provided std::vector with the boundary ids associated with Node node.
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_side_id
Data structure that maps sides of elements to boundary ids.
libmesh_assert(ctx)

◆ renumber_id()

void libMesh::BoundaryInfo::renumber_id ( boundary_id_type  old_id,
boundary_id_type  new_id 
)

Changes all entities (nodes, sides, edges, shellfaces) with boundary id old_id to instead be labeled by boundary id new_id.

Definition at line 1819 of file boundary_info.C.

References _boundary_edge_id, _boundary_ids, _boundary_node_id, _boundary_shellface_id, _boundary_side_id, _edge_boundary_ids, _es_id_to_name, _node_boundary_ids, _ns_id_to_name, _shellface_boundary_ids, _side_boundary_ids, _ss_id_to_name, libmesh_assert_valid_multimaps(), remove_edge(), remove_node(), remove_shellface(), and remove_side().

Referenced by libMesh::MeshTools::Modification::change_boundary_id(), and BoundaryInfoTest::testRenumber().

1821 {
1822  if (old_id == new_id)
1823  {
1824  // If the IDs are the same, this is a no-op.
1825  return;
1826  }
1827 
1828  bool found_node = false;
1829  for (auto & p : _boundary_node_id)
1830  if (p.second == old_id)
1831  {
1832  // If we already have this id on this node, we don't want to
1833  // create a duplicate in our multimap
1834  this->remove_node(p.first, new_id);
1835  p.second = new_id;
1836  found_node = true;
1837  }
1838  if (found_node)
1839  {
1840  _node_boundary_ids.erase(old_id);
1841  _node_boundary_ids.insert(new_id);
1842  }
1843 
1844  bool found_edge = false;
1845  for (auto & p : _boundary_edge_id)
1846  if (p.second.second == old_id)
1847  {
1848  // If we already have this id on this edge, we don't want to
1849  // create a duplicate in our multimap
1850  this->remove_edge(p.first, p.second.first, new_id);
1851  p.second.second = new_id;
1852  found_edge = true;
1853  }
1854  if (found_edge)
1855  {
1856  _edge_boundary_ids.erase(old_id);
1857  _edge_boundary_ids.insert(new_id);
1858  }
1859 
1860  bool found_shellface = false;
1861  for (auto & p : _boundary_shellface_id)
1862  if (p.second.second == old_id)
1863  {
1864  // If we already have this id on this shellface, we don't want
1865  // to create a duplicate in our multimap
1866  this->remove_shellface(p.first, p.second.first, new_id);
1867  p.second.second = new_id;
1868  found_shellface = true;
1869  }
1870  if (found_shellface)
1871  {
1872  _shellface_boundary_ids.erase(old_id);
1873  _shellface_boundary_ids.insert(new_id);
1874  }
1875 
1876  bool found_side = false;
1877  for (auto & p : _boundary_side_id)
1878  if (p.second.second == old_id)
1879  {
1880  // If we already have this id on this side, we don't want to
1881  // create a duplicate in our multimap
1882  this->remove_side(p.first, p.second.first, new_id);
1883  p.second.second = new_id;
1884  found_side = true;
1885  }
1886  if (found_side)
1887  {
1888  _side_boundary_ids.erase(old_id);
1889  _side_boundary_ids.insert(new_id);
1890  }
1891 
1892  if (found_node || found_edge || found_shellface || found_side)
1893  {
1894  _boundary_ids.erase(old_id);
1895  _boundary_ids.insert(new_id);
1896  }
1897 
1898  renumber_name(_ss_id_to_name, old_id, new_id);
1899  renumber_name(_ns_id_to_name, old_id, new_id);
1900  renumber_name(_es_id_to_name, old_id, new_id);
1901 
1903 }
void libmesh_assert_valid_multimaps() const
Helper method for ensuring that our multimaps don&#39;t contain entries with duplicate keys and values...
std::map< boundary_id_type, std::string > _ns_id_to_name
This structure maintains the mapping of named node sets for file formats (Exodus, Gmsh) that support ...
std::set< boundary_id_type > _node_boundary_ids
Set of user-specified boundary IDs for nodes only.
void remove_edge(const Elem *elem, const unsigned short int edge)
Removes all boundary conditions associated with edge edge of element elem, if any exist...
std::set< boundary_id_type > _edge_boundary_ids
Set of user-specified boundary IDs for edges only.
void remove_node(const Node *node, const boundary_id_type id)
Removes boundary id id from node node, if it exists.
void remove_shellface(const Elem *elem, const unsigned short int shellface)
Removes all boundary conditions associated with shell face shellface of element elem, if any exist.
std::set< boundary_id_type > _boundary_ids
A collection of user-specified boundary ids for sides, edges, nodes, and shell faces.
std::set< boundary_id_type > _side_boundary_ids
Set of user-specified boundary IDs for sides only.
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_side_id
Data structure that maps sides of elements to boundary ids.
std::map< boundary_id_type, std::string > _ss_id_to_name
This structure maintains the mapping of named side sets for file formats (Exodus, Gmsh) that support ...
std::map< boundary_id_type, std::string > _es_id_to_name
This structure maintains the mapping of named edge sets for file formats (Exodus, Gmsh) that support ...
std::multimap< const Node *, boundary_id_type > _boundary_node_id
Data structure that maps nodes in the mesh to boundary ids.
void remove_side(const Elem *elem, const unsigned short int side)
Removes all boundary conditions associated with side side of element elem, if any exist...
std::set< boundary_id_type > _shellface_boundary_ids
Set of user-specified boundary IDs for shellfaces only.
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_shellface_id
Data structure that maps faces of shell elements to boundary ids.
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_edge_id
Data structure that maps edges of elements to boundary ids.

◆ set_edgeset_name_map()

std::map<boundary_id_type, std::string>& libMesh::BoundaryInfo::set_edgeset_name_map ( )
inline
Returns
Writable/const reference to the edgeset name map.

Definition at line 885 of file boundary_info.h.

References _es_id_to_name.

Referenced by libMesh::MeshTools::Generation::build_extrusion(), and libMesh::UnstructuredMesh::stitching_helper().

886  { return _es_id_to_name; }
std::map< boundary_id_type, std::string > _es_id_to_name
This structure maintains the mapping of named edge sets for file formats (Exodus, Gmsh) that support ...

◆ set_mesh()

void libMesh::BoundaryInfo::set_mesh ( MeshBase m)
inlineprotected

Definition at line 70 of file boundary_info.h.

References _mesh.

70 { _mesh = &m; }
MeshBase * _mesh
A pointer to the Mesh this boundary info pertains to.

◆ set_nodeset_name_map()

std::map<boundary_id_type, std::string>& libMesh::BoundaryInfo::set_nodeset_name_map ( )
inline
Returns
A writable reference to the nodeset name map.

Definition at line 877 of file boundary_info.h.

References _ns_id_to_name.

Referenced by libMesh::MeshTools::Generation::build_extrusion(), libMesh::CheckpointIO::read_header(), and libMesh::UnstructuredMesh::stitching_helper().

878  { return _ns_id_to_name; }
std::map< boundary_id_type, std::string > _ns_id_to_name
This structure maintains the mapping of named node sets for file formats (Exodus, Gmsh) that support ...

◆ set_sideset_name_map()

std::map<boundary_id_type, std::string>& libMesh::BoundaryInfo::set_sideset_name_map ( )
inline
Returns
A writable reference to the sideset name map.

Definition at line 869 of file boundary_info.h.

References _ss_id_to_name.

Referenced by libMesh::MeshTools::Generation::build_extrusion(), libMesh::CheckpointIO::read_header(), and libMesh::UnstructuredMesh::stitching_helper().

870  { return _ss_id_to_name; }
std::map< boundary_id_type, std::string > _ss_id_to_name
This structure maintains the mapping of named side sets for file formats (Exodus, Gmsh) that support ...

◆ shellface_boundary_ids()

void libMesh::BoundaryInfo::shellface_boundary_ids ( const Elem *const  elem,
const unsigned short int  shellface,
std::vector< boundary_id_type > &  vec_to_fill 
) const
Returns
The list of boundary ids associated with the specified shell face of element elem.
Note
This is only relevant for shell elements.

Definition at line 1392 of file boundary_info.C.

References _boundary_shellface_id, libMesh::as_range(), libMesh::Elem::level(), libMesh::libmesh_assert(), and libMesh::Elem::parent().

Referenced by assemble_shell(), n_shellface_boundary_ids(), operator==(), and libMesh::XdrIO::write_serialized_bcs_helper().

1395 {
1396  libmesh_assert(elem);
1397 
1398  // Shells only have 2 faces
1399  libmesh_assert_less(shellface, 2);
1400 
1401  // Clear out any previous contents
1402  vec_to_fill.clear();
1403 
1404  // Only level-0 elements store BCs. If this is not a level-0
1405  // element get its level-0 parent and infer the BCs.
1406  const Elem * searched_elem = elem;
1407 #ifdef LIBMESH_ENABLE_AMR
1408  if (elem->level() != 0)
1409  {
1410  while (searched_elem->parent() != nullptr)
1411  {
1412  const Elem * parent = searched_elem->parent();
1413  searched_elem = parent;
1414  }
1415  }
1416 #endif
1417 
1418  // Check each element in the range to see if its shellface matches the requested shellface.
1419  for (const auto & pr : as_range(_boundary_shellface_id.equal_range(searched_elem)))
1420  if (pr.second.first == shellface)
1421  vec_to_fill.push_back(pr.second.second);
1422 }
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
Helper function that allows us to treat a homogenous pair as a range.
Definition: simple_range.h:57
libmesh_assert(ctx)
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_shellface_id
Data structure that maps faces of shell elements to boundary ids.

◆ side_with_boundary_id()

unsigned int libMesh::BoundaryInfo::side_with_boundary_id ( const Elem *const  elem,
const boundary_id_type  boundary_id 
) const
Returns
A side of element elem whose associated boundary id is boundary_id if such a side exists, and invalid_uint otherwise.
Note
If multiple sides of elem have the same id, only the lowest numbered such side is returned.

Definition at line 1907 of file boundary_info.C.

References _boundary_side_id, _children_on_boundary, libMesh::as_range(), libMesh::invalid_uint, libMesh::Elem::is_child_on_side(), libMesh::Elem::level(), libMesh::make_range(), libMesh::Elem::n_sides(), libMesh::Elem::neighbor_ptr(), libMesh::Elem::parent(), libMesh::Elem::top_parent(), and libMesh::Elem::which_child_am_i().

Referenced by BoundaryInfoTest::testBoundaryOnChildrenBoundarySides().

1909 {
1910  const Elem * searched_elem = elem;
1911 
1912  // If we don't have a time-dependent domain, we can just go ahead and use the top parent
1913  // (since only those contain boundary conditions). Otherwise, we keep the element
1914  if (elem->level() != 0 && !_children_on_boundary)
1915  searched_elem = elem->top_parent();
1916 
1917  // elem may have zero or multiple occurrences
1918  for (const auto & pr : as_range(_boundary_side_id.equal_range(searched_elem)))
1919  {
1920  // if this is true we found the requested boundary_id
1921  // of the element and want to return the side
1922  if (pr.second.second == boundary_id_in)
1923  {
1924  unsigned int side = pr.second.first;
1925 
1926  // Here we branch out. If we don't allow time-dependent boundary domains,
1927  // we need to check if our parents are consistent.
1928  if (!_children_on_boundary)
1929  {
1930  // If we're on this external boundary then we share this
1931  // external boundary id
1932  if (elem->neighbor_ptr(side) == nullptr)
1933  return side;
1934 
1935  // If we're on an internal boundary then we need to be sure
1936  // it's the same internal boundary as our top_parent
1937  const Elem * p = elem;
1938 
1939 #ifdef LIBMESH_ENABLE_AMR
1940 
1941  while (p != nullptr)
1942  {
1943  const Elem * parent = p->parent();
1944  if (parent && !parent->is_child_on_side(parent->which_child_am_i(p), side))
1945  break;
1946  p = parent;
1947  }
1948 #endif
1949  // We're on that side of our top_parent; return it
1950  if (!p)
1951  return side;
1952  }
1953  // Otherwise we need to check if the child's ancestors have something on
1954  // the side of the child
1955  else
1956  return side;
1957  }
1958  }
1959 
1960 #ifdef LIBMESH_ENABLE_AMR
1961  // We might have instances (especially with moving boundary domains) when we
1962  // query the paren't boundary ID on a child. We only do this till we find the
1963  // the first side, for multiple sides see above.
1964  if (_children_on_boundary && elem->level() != 0)
1965  {
1966  for (auto side : make_range(elem->n_sides()))
1967  {
1968  const Elem * p = elem;
1969  while (p->parent() != nullptr)
1970  {
1971  const Elem * parent = p->parent();
1972 
1973  // First we make sure the parent shares this side
1974  if (parent->is_child_on_side(parent->which_child_am_i(p), side))
1975  {
1976  // parent may have multiple boundary ids
1977  for (const auto & pr : as_range(_boundary_side_id.equal_range(parent)))
1978  // if this is true we found the requested boundary_id
1979  // of the element and want to return the side
1980  if (pr.second.first == side && pr.second.second == boundary_id_in)
1981  return side;
1982 
1983  p = parent;
1984  }
1985  // If the parent is not on the same side, other ancestors won't be on the same side either
1986  else
1987  break;
1988  }
1989  }
1990  }
1991 #endif
1992 
1993  // if we get here, we found elem in the data structure but not
1994  // the requested boundary id, so return the default value
1995  return libMesh::invalid_uint;
1996 }
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
Definition: libmesh.h:286
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_side_id
Data structure that maps sides of elements to boundary ids.
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
Helper function that allows us to treat a homogenous pair as a range.
Definition: simple_range.h:57
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
Definition: int_range.h:134

◆ sides_with_boundary_id()

std::vector< unsigned int > libMesh::BoundaryInfo::sides_with_boundary_id ( const Elem *const  elem,
const boundary_id_type  boundary_id 
) const
Returns
All sides of element elem whose associated boundary id is boundary_id

Definition at line 2000 of file boundary_info.C.

References _boundary_side_id, _children_on_boundary, libMesh::as_range(), libMesh::Elem::is_child_on_side(), libMesh::Elem::level(), libMesh::make_range(), libMesh::Elem::n_sides(), libMesh::Elem::neighbor_ptr(), libMesh::Elem::parent(), libMesh::Elem::top_parent(), and libMesh::Elem::which_child_am_i().

Referenced by BoundaryInfoTest::testBoundaryOnChildrenBoundarySides().

2002 {
2003  std::vector<unsigned int> returnval;
2004 
2005  const Elem * searched_elem = elem;
2006  if (elem->level() != 0 && !_children_on_boundary)
2007  searched_elem = elem->top_parent();
2008 
2009  // elem may have zero or multiple occurrences
2010  for (const auto & pr : as_range(_boundary_side_id.equal_range(searched_elem)))
2011  {
2012  // if this is true we found the requested boundary_id
2013  // of the element and want to return the side
2014  if (pr.second.second == boundary_id_in)
2015  {
2016  unsigned int side = pr.second.first;
2017 
2018  // Here we branch out. If we don't allow time-dependent boundary domains,
2019  // we need to check if our parents are consistent.
2020  if (!_children_on_boundary)
2021  {
2022  // If we're on this external boundary then we share this
2023  // external boundary id
2024  if (elem->neighbor_ptr(side) == nullptr)
2025  {
2026  returnval.push_back(side);
2027  continue;
2028  }
2029 
2030  // If we're on an internal boundary then we need to be sure
2031  // it's the same internal boundary as our top_parent
2032  const Elem * p = elem;
2033 
2034 #ifdef LIBMESH_ENABLE_AMR
2035 
2036  while (p != nullptr)
2037  {
2038  const Elem * parent = p->parent();
2039  if (parent && !parent->is_child_on_side(parent->which_child_am_i(p), side))
2040  break;
2041  p = parent;
2042  }
2043 #endif
2044  // We're on that side of our top_parent; return it
2045  if (!p)
2046  returnval.push_back(side);
2047  }
2048  // Otherwise we trust what we got and return the side
2049  else
2050  returnval.push_back(side);
2051  }
2052  }
2053 
2054 #ifdef LIBMESH_ENABLE_AMR
2055  // We might have instances (especially with moving boundary domains) when we
2056  // query the parent boundary ID on a child.
2057  if (_children_on_boundary && elem->level() != 0)
2058  {
2059  for (auto side : make_range(elem->n_sides()))
2060  {
2061  const Elem * p = elem;
2062  while (p->parent() != nullptr)
2063  {
2064  const Elem * parent = p->parent();
2065  // First we make sure the parent shares this side
2066  if (parent->is_child_on_side(parent->which_child_am_i(p), side))
2067  {
2068  // parent may have multiple boundary ids
2069  for (const auto & pr : as_range(_boundary_side_id.equal_range(parent)))
2070  {
2071  // if this is true we found the requested boundary_id
2072  // of the element and want to add the side to the vector. We
2073  // also need to check if the side is already in the vector. This might
2074  // happen if the child inherits the boundary from the parent.
2075  if (pr.second.first == side && pr.second.second == boundary_id_in &&
2076  std::find(returnval.begin(), returnval.end(), side) == returnval.end())
2077  returnval.push_back(side);
2078  }
2079  }
2080  // If the parent is not on the same side, other ancestors won't be on the same side either
2081  else
2082  break;
2083  p = parent;
2084  }
2085  }
2086  }
2087 #endif
2088 
2089  return returnval;
2090 }
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_side_id
Data structure that maps sides of elements to boundary ids.
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
Helper function that allows us to treat a homogenous pair as a range.
Definition: simple_range.h:57
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
Definition: int_range.h:134

◆ sideset_name()

std::string & libMesh::BoundaryInfo::sideset_name ( boundary_id_type  id)
Returns
A writable reference for setting an optional name for a sideset.

Definition at line 2984 of file boundary_info.C.

References _ss_id_to_name.

Referenced by libMesh::AbaqusIO::assign_sideset_ids(), libMesh::MeshTools::Generation::build_cube(), build_side_list_from_node_list(), libMesh::UNVIO::groups_in(), libMesh::Nemesis_IO::read(), libMesh::ExodusII_IO::read(), libMesh::GmshIO::read_mesh(), MeshStitchTest::renameAndShift(), BoundaryInfoTest::testNameCopying(), BoundaryInfoTest::testRenumber(), and WriteSidesetData::testWriteImpl().

2985 {
2986  return _ss_id_to_name[id];
2987 }
std::map< boundary_id_type, std::string > _ss_id_to_name
This structure maintains the mapping of named side sets for file formats (Exodus, Gmsh) that support ...

◆ sync() [1/3]

void libMesh::BoundaryInfo::sync ( UnstructuredMesh boundary_mesh)

Generates boundary_mesh data structures corresponding to the mesh data structures.

Allows the boundary_mesh to be used like any other mesh, except with interior_parent() values defined for algorithms which couple boundary and interior mesh information. Any pre-existing boundary_mesh data is cleared.

Definition at line 428 of file boundary_info.C.

References _boundary_ids, _mesh, libMesh::ParallelObject::comm(), invalid_id, libMesh::MeshBase::is_serial(), and TIMPI::Communicator::set_union().

Referenced by main(), and sync().

429 {
430  std::set<boundary_id_type> request_boundary_ids(_boundary_ids);
431  request_boundary_ids.insert(invalid_id);
432  if (!_mesh->is_serial())
433  this->comm().set_union(request_boundary_ids);
434 
435  this->sync(request_boundary_ids,
436  boundary_mesh);
437 }
void sync(UnstructuredMesh &boundary_mesh)
Generates boundary_mesh data structures corresponding to the mesh data structures.
std::set< boundary_id_type > _boundary_ids
A collection of user-specified boundary ids for sides, edges, nodes, and shell faces.
const Parallel::Communicator & comm() const
MeshBase * _mesh
A pointer to the Mesh this boundary info pertains to.
virtual bool is_serial() const
Definition: mesh_base.h:205
static const boundary_id_type invalid_id
Number used for internal use.
void set_union(T &data, const unsigned int root_id) const

◆ sync() [2/3]

void libMesh::BoundaryInfo::sync ( const std::set< boundary_id_type > &  requested_boundary_ids,
UnstructuredMesh boundary_mesh 
)

Generates boundary_mesh data structures corresponding to the mesh data structures.

Allows the boundary_mesh to be used like any other mesh, except with interior_parent() values defined for algorithms which couple boundary and interior mesh information. Any pre-existing boundary_mesh data is cleared. Only boundary elements with the specified ids are extracted. Boundary IDs for the nodes on requested_boundary_ids will also be copied over to boundary_mesh. We do not currently copy edge boundary IDs over to boundary_mesh.

Definition at line 441 of file boundary_info.C.

References libMesh::Elem::invalid_subdomain_id, and sync().

443 {
444  // Call the 3 argument version of this function with a dummy value for the third set.
445  std::set<subdomain_id_type> subdomains_relative_to;
446  subdomains_relative_to.insert(Elem::invalid_subdomain_id);
447 
448  this->sync(requested_boundary_ids,
449  boundary_mesh,
450  subdomains_relative_to);
451 }
void sync(UnstructuredMesh &boundary_mesh)
Generates boundary_mesh data structures corresponding to the mesh data structures.
static const subdomain_id_type invalid_subdomain_id
A static integral constant representing an invalid subdomain id.
Definition: elem.h:238

◆ sync() [3/3]

void libMesh::BoundaryInfo::sync ( const std::set< boundary_id_type > &  requested_boundary_ids,
UnstructuredMesh boundary_mesh,
const std::set< subdomain_id_type > &  subdomains_relative_to 
)

Like the other sync() implementations, but specifically intended for building "boundary" meshes from internal sidesets.

In the case of an internal sideset, each side may belong to 2 higher-dimensional parent elements, and typically we do not want to add the same side to the boundary mesh twice. The std::set<subdomain_id_type> passed into this function specifies which subdomain the sides in question should relative to, so that they are only added once.

Deleting 0 elements seems weird, but it's better encapsulating than exposing a set_is_serial(false) capability that might be easily misused.

If the boundary_mesh is still serial, that means we can't parallelize it, so to make sure we can construct it in full on every processor we'll serialize the interior mesh. Use a temporary serializer here.

Re-create the boundary mesh.

Definition at line 455 of file boundary_info.C.

References _find_id_maps(), _mesh, add_elements(), add_node(), libMesh::MeshBase::add_point(), boundary_ids(), libMesh::MeshBase::clear(), libMesh::MeshBase::delete_remote_elements(), libMesh::MeshBase::get_boundary_info(), libMesh::DofObject::id(), libMesh::MeshBase::is_serial(), libMesh::libmesh_assert(), libMesh::MeshBase::n_partitions(), libMesh::MeshBase::node_ptr(), libMesh::MeshBase::partitioner(), libMesh::MeshBase::prepare_for_use(), libMesh::MeshBase::set_n_partitions(), and libMesh::Partitioner::set_node_processor_ids().

458 {
459  LOG_SCOPE("sync()", "BoundaryInfo");
460 
461  boundary_mesh.clear();
462 
468  if (!_mesh->is_serial())
469  boundary_mesh.delete_remote_elements();
470 
477  MeshSerializer serializer
478  (const_cast<MeshBase &>(*_mesh), boundary_mesh.is_serial());
479 
484  boundary_mesh.set_n_partitions() = _mesh->n_partitions();
485 
486  std::map<dof_id_type, dof_id_type> node_id_map;
487  std::map<std::pair<dof_id_type, unsigned char>, dof_id_type> side_id_map;
488 
489  this->_find_id_maps(requested_boundary_ids, 0, &node_id_map, 0, &side_id_map, subdomains_relative_to);
490 
491  // Let's add all the boundary nodes we found to the boundary mesh
492  for (const auto & node : _mesh->node_ptr_range())
493  {
494  dof_id_type node_id = node->id();
495  if (node_id_map.count(node_id))
496  {
497  boundary_mesh.add_point(*node, node_id_map[node_id], node->processor_id());
498 
499  // Copy over all the node's boundary IDs to boundary_mesh
500  std::vector<boundary_id_type> node_boundary_ids;
501  this->boundary_ids(node, node_boundary_ids);
502  for (const auto & node_bid : node_boundary_ids)
503  boundary_mesh.get_boundary_info().add_node(node_id_map[node_id], node_bid);
504  }
505  }
506 
507  // Add the elements. When syncing a boundary mesh, we also store the
508  // parent side ids in addition to the interior_parent pointers,
509  // since this information is frequently needed on boundary meshes.
510  this->add_elements(requested_boundary_ids,
511  boundary_mesh,
512  subdomains_relative_to,
513  /*store_parent_side_ids=*/true);
514 
515  // The new elements are currently using the interior mesh's nodes;
516  // we want them to use the boundary mesh's nodes instead.
517 
518  // This side's Node pointers still point to the nodes of the original mesh.
519  // We need to re-point them to the boundary mesh's nodes! Since we copied *ALL* of
520  // the original mesh's nodes over, we should be guaranteed to have the same ordering.
521  for (auto & new_elem : boundary_mesh.element_ptr_range())
522  {
523  for (auto nn : new_elem->node_index_range())
524  {
525  // Get the correct node pointer, based on the id()
526  Node * new_node =
527  boundary_mesh.node_ptr(node_id_map[new_elem->node_id(nn)]);
528 
529  // sanity check: be sure that the new Node exists and its
530  // global id really matches
531  libmesh_assert (new_node);
532  libmesh_assert_equal_to (new_node->id(),
533  node_id_map[new_elem->node_id(nn)]);
534 
535  // Assign the new node pointer
536  new_elem->set_node(nn) = new_node;
537  }
538  }
539 
540  // Don't repartition this mesh; we want it to stay in sync with the
541  // interior partitioning.
542  boundary_mesh.partitioner().reset(nullptr);
543 
544  // Make boundary_mesh nodes and elements contiguous
545  boundary_mesh.prepare_for_use();
546 
547  // and finally distribute element partitioning to the nodes
549 }
void add_elements(const std::set< boundary_id_type > &requested_boundary_ids, UnstructuredMesh &boundary_mesh, bool store_parent_side_ids=false)
Generates elements along the boundary of our _mesh, which use pre-existing nodes on the boundary_mesh...
static void set_node_processor_ids(MeshBase &mesh)
This function is called after partitioning to set the processor IDs for the nodes.
Definition: partitioner.C:851
void boundary_ids(const Node *node, std::vector< boundary_id_type > &vec_to_fill) const
Fills a user-provided std::vector with the boundary ids associated with Node node.
MeshBase * _mesh
A pointer to the Mesh this boundary info pertains to.
virtual bool is_serial() const
Definition: mesh_base.h:205
libmesh_assert(ctx)
unsigned int n_partitions() const
Definition: mesh_base.h:1322
void _find_id_maps(const std::set< boundary_id_type > &requested_boundary_ids, dof_id_type first_free_node_id, std::map< dof_id_type, dof_id_type > *node_id_map, dof_id_type first_free_elem_id, std::map< std::pair< dof_id_type, unsigned char >, dof_id_type > *side_id_map, const std::set< subdomain_id_type > &subdomains_relative_to)
Helper method for finding consistent maps of interior to boundary dof_object ids. ...
uint8_t dof_id_type
Definition: id_types.h:67

◆ transfer_boundary_ids_from_children()

void libMesh::BoundaryInfo::transfer_boundary_ids_from_children ( const Elem *const  parent)

Update parent's boundary id list so that this information is consistent with its children.

This is useful when _children_on_boundary = true, and is used when the element is about to get coarsened i.e., in MeshRefinement::_coarsen_elements()

Specifically, when we coarsen an element whose children have different boundary ids. In such scenarios, the parent will inherit the children's boundaries if at least 50% them own a boundary while sharing the side of the parent.

Definition at line 2136 of file boundary_info.C.

References _boundary_side_id, _children_on_boundary, libMesh::Elem::active(), add_side(), libMesh::as_range(), libMesh::Elem::child_ptr(), libMesh::Elem::COARSEN_INACTIVE, libMesh::Elem::dim(), libMesh::Elem::is_child_on_side(), libMesh::make_range(), libMesh::Elem::n_children(), libMesh::Elem::n_sides(), libMesh::Utility::pow(), and libMesh::Elem::refinement_flag().

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

2137 {
2138  // this is only needed when we allow boundary to be associated with children elements
2139  // also, we only transfer the parent's boundary ids when we are actually coarsen the child element
2140  if (!_children_on_boundary ||
2141  !(!parent->active() && parent->refinement_flag() == Elem::COARSEN_INACTIVE))
2142  return;
2143 
2144  // We assume that edges can be divided ito two pieces, while triangles and
2145  // quads can be divided into four smaller areas. This is double because we'll need
2146  // to convert the ratio of the children with given boundary id to a double.
2147  const double number_of_sides_on_children = std::pow(2, parent->dim()-1);
2148 
2149  // In this case the input argument elem is the parent element. We need to check all of its sides
2150  // to grab any potential boundary ids.
2151  for (unsigned int side_i = 0; side_i < parent->n_sides(); ++side_i)
2152  {
2153  // An temporary storage to count how many times the children's boundaries occur. the general
2154  // consensus is that if the boundary occurs more than once we propagate upon coarsening. Otherwise,
2155  // it will get deleted.
2156  std::map<unsigned short int, unsigned short int> boundary_counts;
2157 
2158  for (const auto & child_i : make_range(parent->n_children()))
2159  {
2160  // We only need to check the children which share the side
2161  if (parent->is_child_on_side(child_i, side_i))
2162  {
2163  // Fetching the boundary tags on the child's side
2164  for (const auto & pr : as_range(_boundary_side_id.equal_range(parent->child_ptr(child_i))))
2165  {
2166  // Making sure we are on the same boundary
2167  if (pr.second.first == side_i)
2168  ++boundary_counts[pr.second.second];
2169  }
2170  }
2171  }
2172 
2173  // This is where the decision is made. If 50% of the children have the tags,
2174  // we propagate them upwards upon coarsening. Otherwise, they are deleted.
2175  for (const auto & boundary : boundary_counts)
2176  if (boundary.second / number_of_sides_on_children > 0.5)
2177  this->add_side(parent, side_i, boundary.first);
2178  }
2179 
2180  for (const auto & child_i : make_range(parent->n_children()))
2181  this->remove(parent->child_ptr(child_i));
2182 }
std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > _boundary_side_id
Data structure that maps sides of elements to boundary ids.
T pow(const T &x)
Definition: utility.h:328
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
Helper function that allows us to treat a homogenous pair as a range.
Definition: simple_range.h:57
void add_side(const dof_id_type elem, const unsigned short int side, const boundary_id_type id)
Add side side of element number elem with boundary id id to the boundary information data structure...
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
Definition: int_range.h:134

Friends And Related Function Documentation

◆ MeshBase

friend class MeshBase
friend

Definition at line 60 of file boundary_info.h.

Member Data Documentation

◆ _boundary_edge_id

std::multimap<const Elem *, std::pair<unsigned short int, boundary_id_type> > libMesh::BoundaryInfo::_boundary_edge_id
private

◆ _boundary_ids

std::set<boundary_id_type> libMesh::BoundaryInfo::_boundary_ids
private

A collection of user-specified boundary ids for sides, edges, nodes, and shell faces.

See _side_boundary_ids, _edge_boundary_ids, _node_boundary_ids, and _shellface_boundary_ids for sets containing IDs for only sides, edges, nodes, and shell faces, respectively.

This only contains information related to this process's local and ghosted elements

Definition at line 1000 of file boundary_info.h.

Referenced by add_edge(), add_node(), add_shellface(), add_side(), clear(), get_boundary_ids(), n_boundary_ids(), operator=(), operator==(), regenerate_id_sets(), remove_id(), renumber_id(), and sync().

◆ _boundary_node_id

std::multimap<const Node *, boundary_id_type> libMesh::BoundaryInfo::_boundary_node_id
private

◆ _boundary_shellface_id

std::multimap<const Elem *, std::pair<unsigned short int, boundary_id_type> > libMesh::BoundaryInfo::_boundary_shellface_id
private

◆ _boundary_side_id

std::multimap<const Elem *, std::pair<unsigned short int, boundary_id_type> > libMesh::BoundaryInfo::_boundary_side_id
private

◆ _children_on_boundary

bool libMesh::BoundaryInfo::_children_on_boundary
private

◆ _communicator

const Parallel::Communicator& libMesh::ParallelObject::_communicator
protectedinherited

◆ _edge_boundary_ids

std::set<boundary_id_type> libMesh::BoundaryInfo::_edge_boundary_ids
private

Set of user-specified boundary IDs for edges only.

This is only relevant in 3D.

Note
_boundary_ids is the union of this set, _side_boundary_ids, _node_boundary_ids, and _shellface_boundary_ids.

This only contains information related to this process's local and ghosted elements

Definition at line 1034 of file boundary_info.h.

Referenced by add_edge(), clear(), get_edge_boundary_ids(), operator=(), operator==(), regenerate_id_sets(), remove_id(), and renumber_id().

◆ _es_id_to_name

std::map<boundary_id_type, std::string> libMesh::BoundaryInfo::_es_id_to_name
private

This structure maintains the mapping of named edge sets for file formats (Exodus, Gmsh) that support this.

This data is global in nature, meaning it should be an aggregate of information across processors

Definition at line 1084 of file boundary_info.h.

Referenced by clear(), edgeset_name(), get_edgeset_name(), get_edgeset_name_map(), get_id_by_name(), operator=(), operator==(), regenerate_id_sets(), remove_id(), renumber_id(), and set_edgeset_name_map().

◆ _global_boundary_ids

std::set<boundary_id_type> libMesh::BoundaryInfo::_global_boundary_ids
private

A collection of user-specified boundary ids for sides, edges, nodes, and shell faces.

See _side_boundary_ids, _edge_boundary_ids, _node_boundary_ids, and _shellface_boundary_ids for sets containing IDs for only sides, edges, nodes, and shell faces, respectively.

Unlike _boundary_ids, this member should contain boundary ids from across all processors after the mesh is prepared

Definition at line 1012 of file boundary_info.h.

Referenced by get_global_boundary_ids(), operator=(), operator==(), regenerate_id_sets(), and remove_id().

◆ _mesh

MeshBase* libMesh::BoundaryInfo::_mesh
private

◆ _node_boundary_ids

std::set<boundary_id_type> libMesh::BoundaryInfo::_node_boundary_ids
private

Set of user-specified boundary IDs for nodes only.

Note
_boundary_ids is the union of this set, _edge_boundary_ids, _side_boundary_ids, and _shellface_boundary_ids.

This only contains information related to this process's local and ghosted elements

Definition at line 1045 of file boundary_info.h.

Referenced by add_node(), clear(), get_node_boundary_ids(), operator=(), operator==(), regenerate_id_sets(), remove_id(), and renumber_id().

◆ _ns_id_to_name

std::map<boundary_id_type, std::string> libMesh::BoundaryInfo::_ns_id_to_name
private

This structure maintains the mapping of named node sets for file formats (Exodus, Gmsh) that support this.

This data is global in nature, meaning it should be an aggregate of information across processors

Definition at line 1075 of file boundary_info.h.

Referenced by clear(), get_id_by_name(), get_nodeset_name(), get_nodeset_name_map(), nodeset_name(), operator=(), operator==(), regenerate_id_sets(), remove_id(), renumber_id(), and set_nodeset_name_map().

◆ _shellface_boundary_ids

std::set<boundary_id_type> libMesh::BoundaryInfo::_shellface_boundary_ids
private

Set of user-specified boundary IDs for shellfaces only.

This is only relevant for shell elements.

Note
_boundary_ids is the union of this set, _side_boundary_ids, _edge_boundary_ids, and _node_boundary_ids.

This only contains information related to this process's local and ghosted elements

Definition at line 1057 of file boundary_info.h.

Referenced by add_shellface(), clear(), get_shellface_boundary_ids(), operator=(), operator==(), regenerate_id_sets(), remove_id(), and renumber_id().

◆ _side_boundary_ids

std::set<boundary_id_type> libMesh::BoundaryInfo::_side_boundary_ids
private

Set of user-specified boundary IDs for sides only.

Note
_boundary_ids is the union of this set, _edge_boundary_ids, _node_boundary_ids, and _shellface_boundary_ids.

This only contains information related to this process's local and ghosted elements

Definition at line 1023 of file boundary_info.h.

Referenced by add_side(), clear(), get_side_boundary_ids(), operator=(), operator==(), regenerate_id_sets(), remove_id(), and renumber_id().

◆ _ss_id_to_name

std::map<boundary_id_type, std::string> libMesh::BoundaryInfo::_ss_id_to_name
private

This structure maintains the mapping of named side sets for file formats (Exodus, Gmsh) that support this.

This data is global in nature, meaning it should be an aggregate of information across processors

Definition at line 1066 of file boundary_info.h.

Referenced by clear(), get_id_by_name(), get_sideset_name(), get_sideset_name_map(), operator=(), operator==(), regenerate_id_sets(), remove_id(), renumber_id(), set_sideset_name_map(), and sideset_name().

◆ invalid_id

const boundary_id_type libMesh::BoundaryInfo::invalid_id = -123
static

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