Go to the documentation of this file.
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;
120 void sync (
const std::set<boundary_id_type> & requested_boundary_ids,
133 void sync (
const std::set<boundary_id_type> & requested_boundary_ids,
135 const std::set<subdomain_id_type> & subdomains_relative_to);
149 std::map<dof_id_type, dof_id_type> & node_id_map,
150 std::map<dof_id_type, unsigned char> & side_id_map,
151 Real tolerance=1.e-6);
163 void add_elements (
const std::set<boundary_id_type> & requested_boundary_ids,
172 void add_elements(
const std::set<boundary_id_type> & requested_boundary_ids,
174 const std::set<subdomain_id_type> & subdomains_relative_to);
195 const std::vector<boundary_id_type> & ids);
208 const unsigned short int edge,
217 const unsigned short int edge,
226 const unsigned short int edge,
227 const std::vector<boundary_id_type> & ids);
235 const unsigned short int shellface,
244 const unsigned short int shellface,
253 const unsigned short int shellface,
254 const std::vector<boundary_id_type> & ids);
261 const unsigned short int side,
269 const unsigned short int side,
277 const unsigned short int side,
278 const std::vector<boundary_id_type> & ids);
303 const unsigned short int edge);
310 const unsigned short int edge,
318 const unsigned short int shellface);
325 const unsigned short int shellface,
333 const unsigned short int side);
340 const unsigned short int side,
374 #ifdef LIBMESH_ENABLE_DEPRECATED
385 std::vector<boundary_id_type> & vec_to_fill)
const;
399 const unsigned short int edge)
const;
410 #ifdef LIBMESH_ENABLE_DEPRECATED
412 const unsigned short int edge)
const;
424 const unsigned short int edge,
425 std::vector<boundary_id_type> & vec_to_fill)
const;
439 #ifdef LIBMESH_ENABLE_DEPRECATED
441 const unsigned short int edge)
const;
456 const unsigned short int edge,
457 std::vector<boundary_id_type> & vec_to_fill)
const;
466 const unsigned short int shellface)
const;
475 const unsigned short int shellface,
476 std::vector<boundary_id_type> & vec_to_fill)
const;
488 const unsigned short int shellface,
489 std::vector<boundary_id_type> & vec_to_fill)
const;
496 const unsigned short int side,
512 #ifdef LIBMESH_ENABLE_DEPRECATED
514 const unsigned short int side)
const;
522 const unsigned short int side)
const;
531 #ifdef LIBMESH_ENABLE_DEPRECATED
533 const unsigned short int side)
const;
543 const unsigned short int side,
544 std::vector<boundary_id_type> & vec_to_fill)
const;
556 #ifdef LIBMESH_ENABLE_DEPRECATED
558 const unsigned short int side)
const;
571 const unsigned short int side,
572 std::vector<boundary_id_type> & vec_to_fill)
const;
580 const Elem *
const old_elem,
581 const Elem *
const new_elem);
656 #ifdef LIBMESH_ENABLE_DEPRECATED
658 std::vector<boundary_id_type> & bc_id_list)
const;
668 std::vector<std::tuple<dof_id_type, boundary_id_type>>
693 #ifdef LIBMESH_ENABLE_DEPRECATED
695 std::vector<unsigned short int> & side_list,
696 std::vector<boundary_id_type> & bc_id_list)
const;
704 typedef std::tuple<dof_id_type, unsigned short int, boundary_id_type>
BCTuple;
717 #ifdef LIBMESH_ENABLE_DEPRECATED
719 std::vector<unsigned short int> & side_list,
720 std::vector<boundary_id_type> & bc_id_list)
const;
728 std::vector<std::tuple<dof_id_type, unsigned short int, boundary_id_type>>
741 #ifdef LIBMESH_ENABLE_DEPRECATED
743 std::vector<unsigned short int> & edge_list,
744 std::vector<boundary_id_type> & bc_id_list)
const;
752 std::vector<std::tuple<dof_id_type, unsigned short int, boundary_id_type>>
765 #ifdef LIBMESH_ENABLE_DEPRECATED
767 std::vector<unsigned short int> & shellface_list,
768 std::vector<boundary_id_type> & bc_id_list)
const;
776 std::vector<std::tuple<dof_id_type, unsigned short int, boundary_id_type>>
909 void _find_id_maps (
const std::set<boundary_id_type> & requested_boundary_ids,
911 std::map<dof_id_type, dof_id_type> * node_id_map,
913 std::map<std::pair<dof_id_type, unsigned char>,
dof_id_type> * side_id_map,
914 const std::set<subdomain_id_type> & subdomains_relative_to);
925 std::multimap<
const Node *,
932 std::multimap<
const Elem *,
933 std::pair<unsigned short int, boundary_id_type>>
940 std::multimap<
const Elem *,
941 std::pair<unsigned short int, boundary_id_type>>
948 std::multimap<
const Elem *,
949 std::pair<unsigned short int, boundary_id_type>>
1022 #endif // LIBMESH_BOUNDARY_INFO_H
MeshBase & _mesh
The Mesh this boundary info pertains to.
std::vector< boundary_id_type > boundary_ids(const Node *node) const
std::set< boundary_id_type > _node_boundary_ids
Set of user-specified boundary IDs for nodes only.
void remove_id(boundary_id_type id)
Removes all entities (nodes, sides, edges, shellfaces) with boundary id id from their respective cont...
The BoundaryInfo class contains information relevant to boundary conditions including storing faces,...
BoundaryInfo & operator=(const BoundaryInfo &other_boundary_info)
Actual copying operation.
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::string & get_edgeset_name(boundary_id_type id) const
boundary_id_type get_id_by_name(const std::string &name) const
std::size_t n_boundary_conds() const
void shellface_boundary_ids(const Elem *const elem, const unsigned short int shellface, std::vector< boundary_id_type > &vec_to_fill) const
std::vector< std::tuple< dof_id_type, unsigned short int, boundary_id_type > > 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...
std::vector< boundary_id_type > edge_boundary_ids(const Elem *const elem, const unsigned short int edge) const
The libMesh namespace provides an interface to certain functionality in the library.
std::string & sideset_name(boundary_id_type id)
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
const std::set< boundary_id_type > & get_side_boundary_ids() const
std::size_t n_shellface_conds() const
const std::set< boundary_id_type > & get_shellface_boundary_ids() const
std::vector< BCTuple > build_side_list() const
std::size_t n_edge_conds() const
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::string & edgeset_name(boundary_id_type id)
void remove(const Node *node)
Removes the boundary conditions associated with node node, if any exist.
std::set< boundary_id_type > _side_boundary_ids
Set of user-specified boundary IDs for sides only.
BoundaryInfo(MeshBase &m)
Constructor.
void copy_boundary_ids(const BoundaryInfo &old_boundary_info, const Elem *const old_elem, const Elem *const new_elem)
void build_node_boundary_ids(std::vector< boundary_id_type > &b_ids) const
Builds the list of unique node 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 that support named blocks.
const std::set< boundary_id_type > & get_boundary_ids() const
std::string & nodeset_name(boundary_id_type id)
std::set< boundary_id_type > _shellface_boundary_ids
Set of user-specified boundary IDs for shellfaces only.
std::map< boundary_id_type, std::string > & set_edgeset_name_map()
void print_summary(std::ostream &out=libMesh::out) const
Prints a summary of the boundary information.
std::vector< std::tuple< dof_id_type, unsigned short int, boundary_id_type > > 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 clear_boundary_node_ids()
Clears all the boundary information from all of the nodes in the mesh.
This is the MeshBase class.
void print_info(std::ostream &out=libMesh::out) const
Prints the boundary information data structure.
std::vector< boundary_id_type > raw_edge_boundary_ids(const Elem *const elem, const unsigned short int edge) const
void remove_node(const Node *node, const boundary_id_type id)
Removes boundary id id from node node, if it exists.
void build_side_list_from_node_list()
Adds sides to a sideset if every node on that side are in the same sideset.
std::set< boundary_id_type > _edge_boundary_ids
Set of user-specified boundary IDs for edges only.
const std::string & get_nodeset_name(boundary_id_type id) const
unsigned int side_with_boundary_id(const Elem *const elem, const boundary_id_type boundary_id) const
std::size_t n_nodeset_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
void build_shellface_boundary_ids(std::vector< boundary_id_type > &b_ids) const
Builds the list of unique shellface boundary ids.
const std::set< boundary_id_type > & get_node_boundary_ids() const
void clear()
Clears the underlying data structures and restores the object to a pristine state with no data stored...
A Node is like a Point, but with more information.
std::size_t n_boundary_ids() const
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 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.
void regenerate_id_sets()
Clears and regenerates the cached sets of ids.
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.
void add_elements(const std::set< boundary_id_type > &requested_boundary_ids, UnstructuredMesh &boundary_mesh)
Generates elements along the boundary of our _mesh, which use pre-existing nodes on the boundary_mesh...
std::map< boundary_id_type, std::string > _ns_id_to_name
This structure maintains the mapping of named node sets for file formats that support named blocks.
The UnstructuredMesh class is derived from the MeshBase class.
std::vector< boundary_id_type > raw_boundary_ids(const Elem *const elem, const unsigned short int side) const
std::map< boundary_id_type, std::string > & set_nodeset_name_map()
~BoundaryInfo()
Destructor.
const std::string & get_sideset_name(boundary_id_type 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.
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 build_side_boundary_ids(std::vector< boundary_id_type > &b_ids) const
Builds the list of unique side boundary ids.
std::vector< std::tuple< dof_id_type, boundary_id_type > > build_node_list() const
As above, but the library creates and fills in a vector of (node-id, bc-id) pairs and returns it to t...
void build_node_list_from_side_list()
Adds nodes with boundary ids based on the side's boundary ids they are connected 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.
const std::set< boundary_id_type > & get_edge_boundary_ids() const
const std::map< boundary_id_type, std::string > & get_edgeset_name_map() const
This is the base class from which all geometric element types are derived.
unsigned int n_shellface_boundary_ids(const Elem *const elem, const unsigned short int shellface) const
std::map< boundary_id_type, std::string > _es_id_to_name
This structure maintains the mapping of named edge sets for file formats that support named blocks.
unsigned int n_edge_boundary_ids(const Elem *const elem, const unsigned short int edge) 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 ...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
An object whose state is distributed along a set of processors.
bool has_boundary_id(const Node *const node, const boundary_id_type id) const
static const boundary_id_type invalid_id
Number used for internal use.
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.
std::vector< std::tuple< dof_id_type, unsigned short int, boundary_id_type > > 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...
const std::map< boundary_id_type, std::string > & get_nodeset_name_map() const
std::map< boundary_id_type, std::string > & set_sideset_name_map()
std::multimap< const Node *, boundary_id_type > _boundary_node_id
Data structure that maps nodes in the mesh to boundary ids.
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
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 remove_shellface(const Elem *elem, const unsigned short int shellface)
Removes all boundary conditions associated with shell face shellface of element elem,...
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...
void sync(UnstructuredMesh &boundary_mesh)
Generates boundary_mesh data structures corresponding to the mesh data structures.
boundary_id_type boundary_id(const Elem *const elem, const unsigned short int side) const