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" 43 class 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);
186 void add_elements (
const std::set<boundary_id_type> & requested_boundary_ids,
188 bool store_parent_side_ids =
false);
196 void add_elements(
const std::set<boundary_id_type> & requested_boundary_ids,
198 const std::set<subdomain_id_type> & subdomains_relative_to,
199 bool store_parent_side_ids =
false);
220 const std::vector<boundary_id_type> & ids);
233 const unsigned short int edge,
242 const unsigned short int edge,
251 const unsigned short int edge,
252 const std::vector<boundary_id_type> & ids);
260 const unsigned short int shellface,
269 const unsigned short int shellface,
278 const unsigned short int shellface,
279 const std::vector<boundary_id_type> & ids);
286 const unsigned short int side,
294 const unsigned short int side,
302 const unsigned short int side,
303 const std::vector<boundary_id_type> & ids);
309 void remove (
const Node * node);
315 void remove (
const Elem * elem);
328 const unsigned short int edge);
335 const unsigned short int edge,
343 const unsigned short int shellface);
350 const unsigned short int shellface,
358 const unsigned short int side);
365 const unsigned short int side,
377 bool clear_nodeset_data =
false);
488 std::vector<boundary_id_type> & vec_to_fill)
const;
502 const unsigned short int edge)
const;
511 const unsigned short int edge,
512 std::vector<boundary_id_type> & vec_to_fill)
const;
524 const unsigned short int edge,
525 std::vector<boundary_id_type> & vec_to_fill)
const;
534 const unsigned short int shellface)
const;
543 const unsigned short int shellface,
544 std::vector<boundary_id_type> & vec_to_fill)
const;
556 const unsigned short int shellface,
557 std::vector<boundary_id_type> & vec_to_fill)
const;
564 const unsigned short int side,
572 const unsigned short int side)
const;
579 const unsigned short int side)
const;
586 std::vector<std::vector<boundary_id_type>> & vec_to_fill)
const;
593 const unsigned short int side,
594 std::vector<boundary_id_type> & vec_to_fill)
const;
604 const unsigned short int side,
605 std::vector<boundary_id_type> & vec_to_fill)
const;
613 const Elem *
const old_elem,
614 const Elem *
const new_elem);
630 std::vector<unsigned int>
658 #ifdef LIBMESH_ENABLE_AMR 712 #ifdef LIBMESH_ENABLE_DEPRECATED 714 std::vector<boundary_id_type> & bc_id_list)
const;
761 #ifdef LIBMESH_ENABLE_DEPRECATED 763 std::vector<unsigned short int> & side_list,
764 std::vector<boundary_id_type> & bc_id_list)
const;
778 typedef std::tuple<dof_id_type, unsigned short int, boundary_id_type>
BCTuple;
792 #ifdef LIBMESH_ENABLE_DEPRECATED 794 std::vector<unsigned short int> & side_list,
795 std::vector<boundary_id_type> & bc_id_list)
const;
815 #ifdef LIBMESH_ENABLE_DEPRECATED 817 std::vector<unsigned short int> & edge_list,
818 std::vector<boundary_id_type> & bc_id_list)
const;
838 #ifdef LIBMESH_ENABLE_DEPRECATED 840 std::vector<unsigned short int> & shellface_list,
841 std::vector<boundary_id_type> & bc_id_list)
const;
997 const std::multimap<const Elem *, std::pair<unsigned short int, boundary_id_type>> &
get_edgeset_map ()
const 1003 const std::multimap<const Elem *, std::pair<unsigned short int, boundary_id_type>> &
get_sideset_map()
const 1033 void _find_id_maps (
const std::set<boundary_id_type> & requested_boundary_ids,
1035 std::map<dof_id_type, dof_id_type> * node_id_map,
1037 std::map<std::pair<dof_id_type, unsigned char>,
dof_id_type> * side_id_map,
1038 const std::set<subdomain_id_type> & subdomains_relative_to);
1049 std::multimap<
const Node *,
1056 std::multimap<
const Elem *,
1057 std::pair<unsigned short int, boundary_id_type>>
1064 std::multimap<
const Elem *,
1065 std::pair<unsigned short int, boundary_id_type>>
1072 std::multimap<
const Elem *,
1073 std::pair<unsigned short int, boundary_id_type>>
1181 #endif // LIBMESH_BOUNDARY_INFO_H 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...
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
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...
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...
void libmesh_assert_valid_multimaps() const
Helper method for ensuring that our multimaps don't contain entries with duplicate keys and values...
std::size_t n_boundary_conds() const
void allow_children_on_boundary_side(const bool children_on_boundary)
Whether or not to allow directly setting boundary sides on child elements.
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::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...
bool _children_on_boundary
std::set< boundary_id_type > _node_boundary_ids
Set of user-specified boundary IDs for nodes only.
const std::set< boundary_id_type > & get_side_boundary_ids() const
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...
void raw_boundary_ids(const Elem *const elem, const unsigned short int side, std::vector< boundary_id_type > &vec_to_fill) const
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...
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...
A Node is like a Point, but with more information.
std::string & nodeset_name(boundary_id_type id)
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.
void sync(UnstructuredMesh &boundary_mesh)
Generates boundary_mesh data structures corresponding to the mesh data structures.
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...
~BoundaryInfo()
Destructor.
std::vector< unsigned int > sides_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.
void synchronize_global_id_set()
Synchronizes the boundary_ids set on each processor to determine global_boundary_ids.
std::size_t n_edge_conds() const
void side_boundary_ids(const Elem *const elem, std::vector< std::vector< boundary_id_type >> &vec_to_fill) const
BoundaryInfo(MeshBase &m)
Constructor.
bool operator==(const BoundaryInfo &other_boundary_info) const
This tests for data equality via element ids.
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::size_t n_shellface_conds() 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 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.
std::set< boundary_id_type > _boundary_ids
A collection of user-specified boundary ids for sides, edges, nodes, and shell faces.
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::map< boundary_id_type, std::string > & get_sideset_name_map() const
unsigned int side_with_boundary_id(const Elem *const elem, const boundary_id_type boundary_id) const
This is the base class from which all geometric element types are derived.
std::set< boundary_id_type > _side_boundary_ids
Set of user-specified boundary IDs for sides only.
void build_side_boundary_ids(std::vector< boundary_id_type > &b_ids) const
Builds the list of unique side boundary ids.
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.
The libMesh namespace provides an interface to certain functionality in the library.
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 ...
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.
This is the MeshBase class.
std::size_t n_boundary_ids() const
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.
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.
const std::set< boundary_id_type > & get_node_boundary_ids() const
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::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...
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.
boundary_id_type get_id_by_name(std::string_view name) const
void clear_boundary_node_ids()
Clears all the boundary information from all of the nodes in the mesh.
std::map< boundary_id_type, std::string > & set_sideset_name_map()
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.
void add_node(const Node *node, const boundary_id_type id)
Add Node node with boundary id id to the boundary information data structures.
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...
const std::map< boundary_id_type, std::string > & get_nodeset_name_map() const
const std::string & get_edgeset_name(boundary_id_type id) const
static const boundary_id_type invalid_id
Number used for internal use.
unsigned int n_raw_boundary_ids(const Elem *const elem, const unsigned short int side) const
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.
The UnstructuredMesh class is derived from the MeshBase class.
void print_info(std::ostream &out_stream=libMesh::out) const
Prints the boundary information data structure.
void raw_shellface_boundary_ids(const Elem *const elem, const unsigned short int shellface, std::vector< boundary_id_type > &vec_to_fill) const
const std::map< boundary_id_type, std::string > & get_edgeset_name_map() const
void parallel_sync_side_ids()
Synchronize the boundary element side and node across processors.
The BoundaryInfo class contains information relevant to boundary conditions including storing faces...
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...
void parallel_sync_node_ids()
An object whose state is distributed along a set of processors.
void regenerate_id_sets()
Clears and regenerates the cached sets of ids.
const std::string & get_nodeset_name(boundary_id_type id) const
void clear()
Clears the underlying data structures and restores the object to a pristine state with no data stored...
const std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > & get_sideset_map() const
std::string & sideset_name(boundary_id_type id)
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.
BoundaryInfo & operator=(const BoundaryInfo &other_boundary_info)
Copy assignment operator.
const std::set< boundary_id_type > & get_boundary_ids() const
void build_node_boundary_ids(std::vector< boundary_id_type > &b_ids) const
Builds the list of unique node 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...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
unsigned int n_edge_boundary_ids(const Elem *const elem, const unsigned short int edge) const
void copy_boundary_ids(const BoundaryInfo &old_boundary_info, const Elem *const old_elem, const Elem *const new_elem)
std::map< boundary_id_type, std::string > & set_nodeset_name_map()
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.
const std::set< boundary_id_type > & get_edge_boundary_ids() 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...
const std::string & get_sideset_name(boundary_id_type id) const
const std::set< boundary_id_type > & get_global_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::size_t n_nodeset_conds() const
std::string & edgeset_name(boundary_id_type id)
const std::set< boundary_id_type > & get_shellface_boundary_ids() 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 set_mesh(MeshBase &m)
bool operator!=(const BoundaryInfo &other_boundary_info) const
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.
bool is_children_on_boundary_side() const
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::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 print_summary(std::ostream &out_stream=libMesh::out) const
Prints a summary of the boundary information.
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...
const std::multimap< const Node *, boundary_id_type > & get_nodeset_map() const
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_edge_id
Data structure that maps edges of elements to boundary ids.
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.
const std::multimap< const Elem *, std::pair< unsigned short int, boundary_id_type > > & get_edgeset_map() const
std::map< boundary_id_type, std::string > & set_edgeset_name_map()
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...
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.