20#ifndef LIBMESH_BOUNDARY_INFO_H
21#define LIBMESH_BOUNDARY_INFO_H
24#include "libmesh/libmesh_common.h"
25#include "libmesh/id_types.h"
26#include "libmesh/parallel_object.h"
43class UnstructuredMesh;
90 return !(*
this == other_boundary_info);
143 void sync (
const std::set<boundary_id_type> & requested_boundary_ids,
156 void sync (
const std::set<boundary_id_type> & requested_boundary_ids,
158 const std::set<subdomain_id_type> & subdomains_relative_to);
172 std::map<dof_id_type, dof_id_type> & node_id_map,
173 std::map<dof_id_type, unsigned char> & side_id_map,
174 Real tolerance=1.e-6);
194 void add_elements (
const std::set<boundary_id_type> & requested_boundary_ids,
196 bool store_parent_side_ids =
false,
197 const std::vector<subdomain_id_type> & new_subdomain_ids = {});
205 void add_elements(
const std::set<boundary_id_type> & requested_boundary_ids,
207 const std::set<subdomain_id_type> & subdomains_relative_to,
208 bool store_parent_side_ids =
false,
209 const std::vector<subdomain_id_type> & new_subdomain_ids = {});
230 const std::vector<boundary_id_type> & ids);
243 const unsigned short int edge,
252 const unsigned short int edge,
261 const unsigned short int edge,
262 const std::vector<boundary_id_type> & ids);
270 const unsigned short int shellface,
279 const unsigned short int shellface,
288 const unsigned short int shellface,
289 const std::vector<boundary_id_type> & ids);
296 const unsigned short int side,
304 const unsigned short int side,
312 const unsigned short int side,
313 const std::vector<boundary_id_type> & ids);
319 void remove (
const Node * node);
325 void remove (
const Elem * elem);
338 const unsigned short int edge);
345 const unsigned short int edge,
353 const unsigned short int shellface);
360 const unsigned short int shellface,
368 const unsigned short int side);
375 const unsigned short int side,
387 bool clear_nodeset_data =
false);
498 std::vector<boundary_id_type> & vec_to_fill)
const;
512 const unsigned short int edge)
const;
521 const unsigned short int edge,
522 std::vector<boundary_id_type> & vec_to_fill)
const;
534 const unsigned short int edge,
535 std::vector<boundary_id_type> & vec_to_fill)
const;
544 const unsigned short int shellface)
const;
553 const unsigned short int shellface,
554 std::vector<boundary_id_type> & vec_to_fill)
const;
566 const unsigned short int shellface,
567 std::vector<boundary_id_type> & vec_to_fill)
const;
574 const unsigned short int side,
582 const unsigned short int side)
const;
589 const unsigned short int side)
const;
596 std::vector<std::vector<boundary_id_type>> & vec_to_fill)
const;
603 const unsigned short int side,
604 std::vector<boundary_id_type> & vec_to_fill)
const;
614 const unsigned short int side,
615 std::vector<boundary_id_type> & vec_to_fill)
const;
623 const Elem *
const old_elem,
624 const Elem *
const new_elem);
640 std::vector<unsigned int>
668#ifdef LIBMESH_ENABLE_AMR
759 typedef std::tuple<dof_id_type, unsigned short int, boundary_id_type>
BCTuple;
933 const std::multimap<const Elem *, std::pair<unsigned short int, boundary_id_type>> &
get_edgeset_map ()
const
939 const std::multimap<const Elem *, std::pair<unsigned short int, boundary_id_type>> &
get_sideset_map()
const
969 void _find_id_maps (
const std::set<boundary_id_type> & requested_boundary_ids,
971 std::map<dof_id_type, dof_id_type> * node_id_map,
973 std::map<std::pair<dof_id_type, unsigned char>,
dof_id_type> * side_id_map,
974 const std::set<subdomain_id_type> & subdomains_relative_to);
985 std::multimap<
const Node *,
992 std::multimap<
const Elem *,
993 std::pair<unsigned short int, boundary_id_type>>
1000 std::multimap<
const Elem *,
1001 std::pair<unsigned short int, boundary_id_type>>
1008 std::multimap<
const Elem *,
1009 std::pair<unsigned short int, boundary_id_type>>
The BoundaryInfo class contains information relevant to boundary conditions including storing faces,...
std::size_t n_boundary_ids() const
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 ...
std::string & sideset_name(boundary_id_type id)
void shellface_boundary_ids(const Elem *const elem, const unsigned short int shellface, std::vector< boundary_id_type > &vec_to_fill) const
void side_boundary_ids(const Elem *const elem, std::vector< std::vector< boundary_id_type > > &vec_to_fill) const
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.
unsigned int n_raw_boundary_ids(const Elem *const elem, const unsigned short int side) const
void add_elements(const std::set< boundary_id_type > &requested_boundary_ids, UnstructuredMesh &boundary_mesh, bool store_parent_side_ids=false, const std::vector< subdomain_id_type > &new_subdomain_ids={})
Generates elements along the boundary of our _mesh, which use pre-existing nodes on the boundary_mesh...
std::size_t n_nodeset_conds() const
void renumber_edge_id(boundary_id_type old_id, boundary_id_type new_id)
Changes all edges with boundary id old_id to instead be labeled by boundary id new_id.
void synchronize_global_id_set()
Synchronizes the boundary_ids set on each processor to determine global_boundary_ids.
void allow_children_on_boundary_side(const bool children_on_boundary)
Whether or not to allow directly setting boundary sides on child elements.
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.
std::set< boundary_id_type > _node_boundary_ids
Set of user-specified boundary IDs for nodes only.
void build_side_list_from_node_list(const std::set< boundary_id_type > &nodeset_list={})
Adds sides to a sideset if every node on that side are in the same sideset.
std::tuple< dof_id_type, unsigned short int, boundary_id_type > BCTuple
Create a list of (element_id, side_id, boundary_id) tuples for relevant sides.
void remove_shellface_id(boundary_id_type id, bool global=false)
Removes all shellfaces with boundary id id from the BoundaryInfo object, removes it from the set of s...
const std::set< boundary_id_type > & get_global_boundary_ids() const
unsigned int side_with_boundary_id(const Elem *const elem, const boundary_id_type boundary_id) const
void remove_node(const Node *node, const boundary_id_type id)
Removes boundary id id from node node, if it exists.
MeshBase * _mesh
A pointer to the Mesh this boundary info pertains to.
void sync(UnstructuredMesh &boundary_mesh)
Generates boundary_mesh data structures corresponding to the mesh data structures.
std::vector< BCTuple > build_side_list(BCTupleSortBy sort_by=BCTupleSortBy::ELEM_ID) const
std::size_t n_boundary_conds() const
void raw_shellface_boundary_ids(const Elem *const elem, const unsigned short int shellface, std::vector< boundary_id_type > &vec_to_fill) const
std::set< boundary_id_type > _boundary_ids
A collection of user-specified boundary ids for sides, edges, nodes, and shell faces.
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.
std::set< boundary_id_type > _global_boundary_ids
A collection of user-specified boundary ids for sides, edges, nodes, and shell faces.
std::size_t n_edge_conds() const
void remove_node_id(boundary_id_type id, bool global=false)
Removes all nodes with boundary id id from the BoundaryInfo object, removes it from the set of node b...
std::vector< unsigned int > sides_with_boundary_id(const Elem *const elem, const boundary_id_type boundary_id) const
void set_mesh(MeshBase &m)
bool operator==(const BoundaryInfo &other_boundary_info) const
This tests for data equality via element ids.
std::vector< NodeBCTuple > build_node_list(NodeBCTupleSortBy sort_by=NodeBCTupleSortBy::NODE_ID) const
bool has_boundary_id(const Node *const node, const boundary_id_type id) const
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.
void edge_boundary_ids(const Elem *const elem, const unsigned short int edge, std::vector< boundary_id_type > &vec_to_fill) const
void print_summary(std::ostream &out_stream=libMesh::out) const
Prints a summary of the boundary information.
std::set< boundary_id_type > _side_boundary_ids
Set of user-specified boundary IDs for sides only.
boundary_id_type get_id_by_name(std::string_view name) const
const std::set< boundary_id_type > & get_edge_boundary_ids() const
unsigned int n_shellface_boundary_ids(const Elem *const elem, const unsigned short int shellface) 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.
bool _children_on_boundary
std::string & nodeset_name(boundary_id_type id)
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 ...
void remove_id(boundary_id_type id, bool global=false)
Removes all entities (nodes, sides, edges, shellfaces) with boundary id id from their respective cont...
std::set< boundary_id_type > _shellface_boundary_ids
Set of user-specified boundary IDs for shellfaces only.
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.
std::map< boundary_id_type, std::string > & set_sideset_name_map()
std::vector< BCTuple > build_shellface_list() const
Create a list of (element_id, shellface_id, boundary_id) tuples for all relevant shellfaces.
void remove_shellface(const Elem *elem, const unsigned short int shellface)
Removes all boundary conditions associated with shell face shellface of element elem,...
unsigned int n_edge_boundary_ids(const Elem *const elem, const unsigned short int edge) const
std::multimap< const Node *, boundary_id_type > _boundary_node_id
Data structure that maps nodes in the mesh to boundary ids.
void raw_boundary_ids(const Elem *const elem, const unsigned short int side, std::vector< boundary_id_type > &vec_to_fill) const
std::size_t n_shellface_conds() const
const std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > & get_edgeset_map() const
void clear_boundary_node_ids()
Clears all the boundary information from all of the nodes in the mesh.
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 remove_side_id(boundary_id_type id, bool global=false)
Removes all sides with boundary id id from the BoundaryInfo object, removes it from the set of side b...
const std::multimap< const Node *, boundary_id_type > & get_nodeset_map() const
void clear()
Clears the underlying data structures and restores the object to a pristine state with no data stored...
const std::string & get_nodeset_name(boundary_id_type id) const
void print_info(std::ostream &out_stream=libMesh::out) const
Prints the boundary information data structure.
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.
void copy_boundary_ids(const BoundaryInfo &old_boundary_info, const Elem *const old_elem, const Elem *const new_elem)
const std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > & get_sideset_map() const
const std::set< boundary_id_type > & get_boundary_ids() const
const std::set< boundary_id_type > & get_node_boundary_ids() const
std::tuple< dof_id_type, boundary_id_type > NodeBCTuple
Create a list of (node_id, boundary_id) tuples for all relevant nodes.
void remove_edge_id(boundary_id_type id, bool global=false)
Removes all edges with boundary id id from the BoundaryInfo object, removes it from the set of edge b...
void parallel_sync_side_ids()
Synchronize the boundary element side and node across processors.
~BoundaryInfo()
Destructor.
void build_node_list_from_side_list(const std::set< boundary_id_type > &sideset_list={})
Adds nodes with boundary ids based on the side's boundary ids they are connected to.
void renumber_shellface_id(boundary_id_type old_id, boundary_id_type new_id)
Changes all shellfaces with boundary id old_id to instead be labeled by boundary id new_id.
const std::string & get_sideset_name(boundary_id_type id) const
std::string & edgeset_name(boundary_id_type id)
void parallel_sync_node_ids()
void raw_edge_boundary_ids(const Elem *const elem, const unsigned short int edge, std::vector< boundary_id_type > &vec_to_fill) const
const std::set< boundary_id_type > & get_side_boundary_ids() const
void add_node(const Node *node, const boundary_id_type id)
Add Node node with boundary id id to the boundary information data structures.
bool is_children_on_boundary_side() const
static const boundary_id_type invalid_id
Number used for internal use.
std::map< boundary_id_type, std::string > & set_edgeset_name_map()
std::set< boundary_id_type > _edge_boundary_ids
Set of user-specified boundary IDs for edges only.
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 ...
const std::string & get_edgeset_name(boundary_id_type id) const
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 regenerate_id_sets()
Clears and regenerates the cached sets of ids.
void build_node_boundary_ids(std::vector< boundary_id_type > &b_ids) const
Builds the list of unique node boundary ids.
const std::set< boundary_id_type > & get_shellface_boundary_ids() const
void renumber_node_id(boundary_id_type old_id, boundary_id_type new_id)
Changes all nodes with boundary id old_id to instead be labeled by boundary id new_id.
void build_side_boundary_ids(std::vector< boundary_id_type > &b_ids) const
Builds the list of unique side boundary ids.
BoundaryInfo & operator=(const BoundaryInfo &other_boundary_info)
Copy assignment operator.
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.
void remove(const Node *node)
Removes the boundary conditions associated with node node, if any exist.
bool operator!=(const BoundaryInfo &other_boundary_info) const
void renumber_side_id(boundary_id_type old_id, boundary_id_type new_id)
Changes all sides with boundary id old_id to instead be labeled by boundary id new_id.
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 ...
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.
std::vector< BCTuple > build_edge_list() const
Create a list of (element_id, edge_id, boundary_id) tuples for all relevant edges.
void build_shellface_boundary_ids(std::vector< boundary_id_type > &b_ids) const
Builds the list of unique shellface 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.
void libmesh_assert_valid_multimaps() const
Helper method for ensuring that our multimaps don't contain entries with duplicate keys and values.
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 ...
const std::map< boundary_id_type, std::string > & get_edgeset_name_map() const
const std::map< boundary_id_type, std::string > & get_nodeset_name_map() const
std::vector< BCTuple > build_active_side_list() const
Create a list of (element_id, side_id, boundary_id) tuples for all relevant active sides.
std::map< boundary_id_type, std::string > & set_nodeset_name_map()
const std::map< boundary_id_type, std::string > & get_sideset_name_map() const
This is the base class from which all geometric element types are derived.
This is the MeshBase class.
A Node is like a Point, but with more information.
An object whose state is distributed along a set of processors.
The UnstructuredMesh class is derived from the MeshBase class.
The libMesh namespace provides an interface to certain functionality in the library.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real