Flow123d  JS_before_hm-1878-g864746365
Public Member Functions | Private Attributes | List of all members
BCMesh Class Reference

Class represents boundary part of mesh. More...

#include <bc_mesh.hh>

Inheritance diagram for BCMesh:
Inheritance graph
[legend]
Collaboration diagram for BCMesh:
Collaboration graph
[legend]

Public Member Functions

 BCMesh (Mesh *parent_mesh)
 
 ~BCMesh ()
 Destructor. More...
 
Range< ElementAccessor< 3 > > elements_range () const override
 Returns range of boundary elements of parent mesh. More...
 
unsigned int n_elements () const override
 Returns count of boundary elements of parent mesh. More...
 
Partitioningget_part () override
 Overwrite Mesh::get_part() More...
 
const LongIdxget_local_part () override
 Overwrite Mesh::get_local_part() More...
 
std::shared_ptr< EquivalentMeshMapcheck_compatible_mesh (Mesh &input_mesh) override
 Overwrite Mesh::check_compatible_mesh() More...
 
unsigned int n_nodes () const override
 Overwrite Mesh::n_nodes() More...
 
ElementAccessor< 3 > element_accessor (unsigned int idx) const override
 Overwrite Mesh::element_accessor() More...
 
- Public Member Functions inherited from Mesh
 TYPEDEF_ERR_INFO (EI_ElemLast, int)
 
 TYPEDEF_ERR_INFO (EI_ElemNew, int)
 
 TYPEDEF_ERR_INFO (EI_RegLast, std::string)
 
 TYPEDEF_ERR_INFO (EI_RegNew, std::string)
 
 TYPEDEF_ERR_INFO (EI_ElemId, int)
 
 TYPEDEF_ERR_INFO (EI_ElemIdOther, int)
 
 TYPEDEF_ERR_INFO (EI_Region, std::string)
 
 TYPEDEF_ERR_INFO (EI_RegIdx, unsigned int)
 
 TYPEDEF_ERR_INFO (EI_Dim, unsigned int)
 
 TYPEDEF_ERR_INFO (EI_DimOther, unsigned int)
 
 TYPEDEF_ERR_INFO (EI_Quality, double)
 
 DECLARE_EXCEPTION (ExcDuplicateBoundary,<< "Duplicate boundary elements! \n"<< "Element id: "<< EI_ElemLast::val<< " on region name: "<< EI_RegLast::val<< "\n"<< "Element id: "<< EI_ElemNew::val<< " on region name: "<< EI_RegNew::val<< "\n")
 
 DECLARE_EXCEPTION (ExcElmWrongOrder,<< "Element IDs in non-increasing order, ID: "<< EI_ElemId::val<< "\n")
 
 DECLARE_EXCEPTION (ExcRegionElmDiffDim,<< "User defined region "<< EI_Region::qval<< " (id "<< EI_RegIdx::val<< ") by 'From_Elements' cannot have elements of different dimensions.\n"<< "Thrown due to: dim "<< EI_Dim::val<< " neq dim "<< EI_DimOther::val<< " (ele id "<< EI_ElemId::val<< ").\n"<< "Split elements by dim, create separate regions and then possibly use Union.\n")
 
 DECLARE_EXCEPTION (ExcBadElement,<< "Extremely bad quality element ID="<< EI_ElemId::val<< ",("<< EI_Quality::val<< "<4*epsilon).\n")
 
 DECLARE_EXCEPTION (ExcTooMatchingIds,<< "Mesh: Duplicate dim-join lower dim elements: "<< EI_ElemId::val<< ", "<< EI_ElemIdOther::val<< ".\n")
 
 DECLARE_EXCEPTION (ExcBdrElemMatchRegular,<< "Boundary element (id: "<< EI_ElemId::val<< ") match a regular element (id: "<< EI_ElemIdOther::val<< ") of lower dimension.\n")
 
 Mesh ()
 
 Mesh (Input::Record in_record, MPI_Comm com=MPI_COMM_WORLD)
 
 Mesh (Mesh &other)
 
virtual ~Mesh ()
 Destructor. More...
 
unsigned int n_boundaries () const
 
unsigned int n_edges () const
 
Edge edge (uint edge_idx) const
 
Boundary boundary (uint edge_idx) const
 
unsigned int n_corners ()
 
const RegionDBregion_db () const
 
Distributionget_el_ds () const
 
LongIdxget_row_4_el () const
 
LongIdxget_el_4_loc () const
 
Distributionget_node_ds () const
 
LongIdxget_node_4_loc () const
 
unsigned int n_local_nodes () const
 
MPI_Comm get_comm () const
 
MixedMeshIntersectionsmixed_intersections ()
 
unsigned int n_sides () const
 
unsigned int n_vb_neighbours () const
 
unsigned int max_edge_sides (unsigned int dim) const
 
void read_gmsh_from_stream (istream &in)
 
void init_from_input ()
 
void canonical_faces ()
 
void setup_topology ()
 
void elements_id_maps (vector< LongIdx > &bulk_elements_id, vector< LongIdx > &boundary_elements_id) const
 
NodeAccessor< 3 > node (unsigned int idx) const
 Create and return NodeAccessor to node of given idx. More...
 
void read_regions_from_input (Input::Array region_list)
 
const vector< vector< unsigned int > > & node_elements ()
 
void check_and_finish ()
 
std::vector< BoundingBoxget_element_boxes ()
 Compute bounding boxes of elements contained in mesh. More...
 
const BIHTreeget_bih_tree ()
 Getter for BIH. Creates and compute BIH at first call. More...
 
void intersect_element_lists (vector< unsigned int > const &nodes_list, vector< unsigned int > &intersection_element_list)
 
void add_node (unsigned int node_id, arma::vec3 coords)
 Add new node of given id and coordinates to mesh. More...
 
void add_element (unsigned int elm_id, unsigned int dim, unsigned int region_id, unsigned int partition_id, std::vector< unsigned int > node_ids)
 Add new element of given id to mesh. More...
 
void add_physical_name (unsigned int dim, unsigned int id, std::string name)
 Add new node of given id and coordinates to mesh. More...
 
FilePath mesh_file ()
 Return FilePath object representing "mesh_file" input key. More...
 
IntersectionSearch get_intersection_search ()
 Getter for input type selection for intersection search algorithm. More...
 
double global_snap_radius () const
 Maximal distance of observe point from Mesh relative to its size. More...
 
void init_element_vector (unsigned int size)
 Initialize element_vec_, set size and reset counters of boundary and bulk elements. More...
 
void init_node_vector (unsigned int size)
 Initialize node_vec_, set size. More...
 
Range< NodeAccessor< 3 > > node_range () const
 Returns range of nodes. More...
 
Range< Edgeedge_range () const
 Returns range of edges. More...
 
int elem_index (int elem_id) const
 For element of given elem_id returns index in element_vec_ or (-1) if element doesn't exist. More...
 
int find_elem_id (unsigned int pos) const
 Return element id (in GMSH file) of element of given position in element vector. More...
 
const std::vector< unsigned int > & element_permutations () const
 Return permutation vector of elements. More...
 
int node_index (int node_id) const
 For node of given node_id returns index in element_vec_ or (-1) if node doesn't exist. More...
 
int find_node_id (unsigned int pos) const
 Return node id (in GMSH file) of node of given position in node vector. More...
 
const std::vector< unsigned int > & node_permutations () const
 Return permutation vector of nodes. More...
 
void check_element_size (unsigned int elem_idx) const
 Check if given index is in element_vec_. More...
 
unsigned int create_boundary_elements ()
 Create boundary elements from data of temporary structure, this method MUST be call after read mesh from file, return number of read boundary elements. More...
 
BCMeshget_bc_mesh ()
 Create boundary mesh if doesn't exist and return it. More...
 

Private Attributes

Meshparent_mesh_
 Pointer to parent (bulk) mesh. More...
 
LongIdxlocal_part_
 Distribution of boundary elements to processors. More...
 

Additional Inherited Members

- Public Types inherited from Mesh
enum  IntersectionSearch { BIHsearch = 1, BIHonly = 2, BBsearch = 3 }
 Types of search algorithm for finding intersection candidates. More...
 
enum  { x_coord =0, y_coord =1, z_coord =2 }
 
typedef enum Mesh::IntersectionSearch IntersectionSearch
 Types of search algorithm for finding intersection candidates. More...
 
- Static Public Member Functions inherited from Mesh
static const Input::Type::Selectionget_input_intersection_variant ()
 The definition of input record for selection of variant of file format. More...
 
static const Input::Type::Recordget_input_type ()
 
- Public Attributes inherited from Mesh
vector< BoundaryDataboundary_
 
std::shared_ptr< MixedMeshIntersectionsintersections
 
vector< vector< unsigned int > > master_elements
 
DuplicateNodestree
 
vector< Neighbourvb_neighbours_
 
int n_insides
 
int n_exsides
 
int n_sides_
 
vector< vector< vector< unsigned int > > > side_nodes
 
vector< vector< unsigned int > > node_elements_
 For each node the vector contains a list of elements that use this node. More...
 
- Protected Member Functions inherited from Mesh
void init ()
 
void make_neighbours_and_edges ()
 
void create_node_element_lists ()
 
bool find_lower_dim_element (vector< unsigned int > &element_list, unsigned int dim, unsigned int &element_idx)
 
bool same_sides (const SideIter &si, vector< unsigned int > &side_nodes)
 
void element_to_neigh_vb ()
 
void count_element_types ()
 
void count_side_types ()
 
void check_mesh_on_read ()
 
void modify_element_ids (const RegionDB::MapElementIDToRegionID &map)
 
Elementadd_element_to_vector (int id)
 Adds element to mesh data structures (element_vec_, element_ids_), returns pointer to this element. More...
 
void init_element (Element *ele, unsigned int elm_id, unsigned int dim, RegionIdx region_idx, unsigned int partition_id, std::vector< unsigned int > node_ids)
 Initialize element. More...
 
void output_internal_ngh_data ()
 Output of neighboring data into raw output. More...
 
void optimize ()
 
void sort_permuted_nodes_elements (std::vector< int > new_node_ids, std::vector< int > new_elem_ids)
 Sort elements and nodes by order stored in permutation vectors. More...
 
unsigned int check_compatible_elements (Mesh *source_mesh, Mesh *target_mesh, const std::vector< unsigned int > &node_ids, std::vector< LongIdx > &map)
 
- Protected Attributes inherited from Mesh
unsigned int n_bb_neigh
 
unsigned int n_vb_neigh
 
unsigned int max_edge_sides_ [3]
 Maximal number of sides per one edge in the actual mesh (set in make_neighbours_and_edges()). More...
 
bool optimize_memory_locality
 
RegionDB region_db_
 
std::shared_ptr< Partitioningpart_
 
std::shared_ptr< BIHTreebih_tree_
 
Input::Record in_record_
 
MPI_Comm comm_
 
vector< Elementelement_vec_
 
vector< ElementTmpDatabc_element_tmp_
 Hold data of boundary elements during reading mesh (allow to preserve correct order during reading of mix bulk-boundary element) More...
 
unsigned int bulk_size_
 Count of bulk elements. More...
 
unsigned int boundary_loaded_size_
 Count of boundary elements loaded from mesh file. More...
 
BidirectionalMap< int > element_ids_
 Maps element ids to indexes into vector element_vec_. More...
 
Armor::Array< double > nodes_
 
BidirectionalMap< int > node_ids_
 Maps node ids to indexes into vector node_vec_. More...
 
std::vector< EdgeDataedges
 Vector of MH edges, this should not be part of the geometrical mesh. More...
 
std::vector< unsigned int > node_permutation_
 Vector of node permutations of optimized mesh (see class MeshOptimizer) More...
 
std::vector< unsigned int > elem_permutation_
 Vector of element permutations of optimized mesh (see class MeshOptimizer) More...
 

Detailed Description

Class represents boundary part of mesh.

Holds pointer to parent Mesh and overwrites methods, that allow access to boundary elements and other functionality and structures necessary to work above boundary part of mesh.

Definition at line 35 of file bc_mesh.hh.

Constructor & Destructor Documentation

◆ BCMesh()

BCMesh::BCMesh ( Mesh parent_mesh)

Constructor from parent (bulk) Mesh.

Definition at line 30 of file bc_mesh.cc.

◆ ~BCMesh()

BCMesh::~BCMesh ( )

Destructor.

Definition at line 39 of file bc_mesh.cc.

Member Function Documentation

◆ check_compatible_mesh()

std::shared_ptr< EquivalentMeshMap > BCMesh::check_compatible_mesh ( Mesh input_mesh)
overridevirtual

Overwrite Mesh::check_compatible_mesh()

Reimplemented from Mesh.

Definition at line 78 of file bc_mesh.cc.

◆ element_accessor()

ElementAccessor< 3 > BCMesh::element_accessor ( unsigned int  idx) const
overridevirtual

Overwrite Mesh::element_accessor()

Reimplemented from Mesh.

Definition at line 88 of file bc_mesh.cc.

◆ elements_range()

Range< ElementAccessor< 3 > > BCMesh::elements_range ( ) const
overridevirtual

Returns range of boundary elements of parent mesh.

Reimplemented from Mesh.

Definition at line 45 of file bc_mesh.cc.

Here is the caller graph for this function:

◆ get_local_part()

const LongIdx * BCMesh::get_local_part ( )
overridevirtual

Overwrite Mesh::get_local_part()

Reimplemented from Mesh.

Definition at line 62 of file bc_mesh.cc.

◆ get_part()

Partitioning * BCMesh::get_part ( )
overridevirtual

Overwrite Mesh::get_part()

Reimplemented from Mesh.

Definition at line 58 of file bc_mesh.cc.

◆ n_elements()

unsigned int BCMesh::n_elements ( ) const
overridevirtual

Returns count of boundary elements of parent mesh.

Reimplemented from Mesh.

Definition at line 53 of file bc_mesh.cc.

Here is the caller graph for this function:

◆ n_nodes()

unsigned int BCMesh::n_nodes ( ) const
overridevirtual

Overwrite Mesh::n_nodes()

Reimplemented from Mesh.

Definition at line 83 of file bc_mesh.cc.

Member Data Documentation

◆ local_part_

LongIdx* BCMesh::local_part_
private

Distribution of boundary elements to processors.

Definition at line 71 of file bc_mesh.hh.

◆ parent_mesh_

Mesh* BCMesh::parent_mesh_
private

Pointer to parent (bulk) mesh.

Definition at line 68 of file bc_mesh.hh.


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