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);
134 void sync (
const std::set<boundary_id_type> & requested_boundary_ids,
147 void sync (
const std::set<boundary_id_type> & requested_boundary_ids,
149 const std::set<subdomain_id_type> & subdomains_relative_to);
163 std::map<dof_id_type, dof_id_type> & node_id_map,
164 std::map<dof_id_type, unsigned char> & side_id_map,
165 Real tolerance=1.e-6);
177 void add_elements (
const std::set<boundary_id_type> & requested_boundary_ids,
179 bool store_parent_side_ids =
false);
187 void add_elements(
const std::set<boundary_id_type> & requested_boundary_ids,
189 const std::set<subdomain_id_type> & subdomains_relative_to,
190 bool store_parent_side_ids =
false);
211 const std::vector<boundary_id_type> & ids);
224 const unsigned short int edge,
233 const unsigned short int edge,
242 const unsigned short int edge,
243 const std::vector<boundary_id_type> & ids);
251 const unsigned short int shellface,
260 const unsigned short int shellface,
269 const unsigned short int shellface,
270 const std::vector<boundary_id_type> & ids);
277 const unsigned short int side,
285 const unsigned short int side,
293 const unsigned short int side,
294 const std::vector<boundary_id_type> & ids);
300 void remove (
const Node * node);
306 void remove (
const Elem * elem);
319 const unsigned short int edge);
326 const unsigned short int edge,
334 const unsigned short int shellface);
341 const unsigned short int shellface,
349 const unsigned short int side);
356 const unsigned short int side,
368 bool clear_nodeset_data =
false);
409 std::vector<boundary_id_type> & vec_to_fill)
const;
423 const unsigned short int edge)
const;
432 const unsigned short int edge,
433 std::vector<boundary_id_type> & vec_to_fill)
const;
445 const unsigned short int edge,
446 std::vector<boundary_id_type> & vec_to_fill)
const;
455 const unsigned short int shellface)
const;
464 const unsigned short int shellface,
465 std::vector<boundary_id_type> & vec_to_fill)
const;
477 const unsigned short int shellface,
478 std::vector<boundary_id_type> & vec_to_fill)
const;
485 const unsigned short int side,
493 const unsigned short int side)
const;
500 const unsigned short int side)
const;
507 const unsigned short int side,
508 std::vector<boundary_id_type> & vec_to_fill)
const;
518 const unsigned short int side,
519 std::vector<boundary_id_type> & vec_to_fill)
const;
527 const Elem *
const old_elem,
528 const Elem *
const new_elem);
544 std::vector<unsigned int>
572 #ifdef LIBMESH_ENABLE_AMR 626 #ifdef LIBMESH_ENABLE_DEPRECATED 628 std::vector<boundary_id_type> & bc_id_list)
const;
669 #ifdef LIBMESH_ENABLE_DEPRECATED 671 std::vector<unsigned short int> & side_list,
672 std::vector<boundary_id_type> & bc_id_list)
const;
686 typedef std::tuple<dof_id_type, unsigned short int, boundary_id_type>
BCTuple;
700 #ifdef LIBMESH_ENABLE_DEPRECATED 702 std::vector<unsigned short int> & side_list,
703 std::vector<boundary_id_type> & bc_id_list)
const;
723 #ifdef LIBMESH_ENABLE_DEPRECATED 725 std::vector<unsigned short int> & edge_list,
726 std::vector<boundary_id_type> & bc_id_list)
const;
746 #ifdef LIBMESH_ENABLE_DEPRECATED 748 std::vector<unsigned short int> & shellface_list,
749 std::vector<boundary_id_type> & bc_id_list)
const;
905 const std::multimap<const Elem *, std::pair<unsigned short int, boundary_id_type>> &
get_edgeset_map ()
const 911 const std::multimap<const Elem *, std::pair<unsigned short int, boundary_id_type>> &
get_sideset_map()
const 941 void _find_id_maps (
const std::set<boundary_id_type> & requested_boundary_ids,
943 std::map<dof_id_type, dof_id_type> * node_id_map,
945 std::map<std::pair<dof_id_type, unsigned char>,
dof_id_type> * side_id_map,
946 const std::set<subdomain_id_type> & subdomains_relative_to);
957 std::multimap<
const Node *,
964 std::multimap<
const Elem *,
965 std::pair<unsigned short int, boundary_id_type>>
972 std::multimap<
const Elem *,
973 std::pair<unsigned short int, boundary_id_type>>
980 std::multimap<
const Elem *,
981 std::pair<unsigned short int, boundary_id_type>>
1089 #endif // LIBMESH_BOUNDARY_INFO_H std::string name(const ElemQuality q)
This function returns a string containing some name for q.
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 build_node_list_from_side_list()
Adds nodes with boundary ids based on the side's boundary ids they are connected to.
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.
std::size_t n_edge_conds() 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
std::set< boundary_id_type > _boundary_ids
A collection of user-specified boundary ids for sides, edges, nodes, and shell faces.
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.
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...
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.
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 build_side_list_from_node_list()
Adds sides to a sideset if every node on that side are in the same sideset.
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)
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 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.
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.