Flow123d  3.9.0-127d9ed9b
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | Friends | List of all members
MeshBase Class Referenceabstract

Base class for Mesh and BCMesh. More...

#include <mesh.h>

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

Public Member Functions

 TYPEDEF_ERR_INFO (EI_ElemId, int)
 
 TYPEDEF_ERR_INFO (EI_ElemIdOther, int)
 
 DECLARE_EXCEPTION (ExcTooMatchingIds,<< "Mesh: Duplicate dim-join lower dim elements: "<< EI_ElemId::val<< ", "<< EI_ElemIdOther::val<< ".\n")
 
 MeshBase ()
 
virtual ~MeshBase ()
 
unsigned int n_elements () const
 
unsigned int n_edges () const
 
unsigned int n_vb_neighbours () const
 
Distributionget_el_ds () const
 
LongIdxget_el_4_loc () const
 
LongIdxget_row_4_el () const
 
const Elementelement (unsigned idx) const
 
Edge edge (uint edge_idx) const
 Return edge with given index. More...
 
const Neighbourvb_neighbour (unsigned int nb) const
 Return neighbour with given index. More...
 
int find_elem_id (unsigned int pos) const
 Return element id (in GMSH file) of element of given position in element vector. More...
 
unsigned int max_edge_sides (unsigned int dim) const
 
const DuplicateNodesduplicate_nodes () const
 
const vector< vector< unsigned int > > & node_elements ()
 
int find_node_id (unsigned int pos) const
 Return node id (in GMSH file) of node of given position in node vector. More...
 
void check_element_size (unsigned int elem_idx) const
 Check if given index is in element_vec_. More...
 
const std::vector< unsigned int > & get_side_nodes (unsigned int dim, unsigned int side) const
 
unsigned int n_nodes () const
 
const RegionDBregion_db () const
 
NodeAccessor< 3 > node (unsigned int idx) const
 Create and return NodeAccessor to node of given idx. More...
 
ElementAccessor< 3 > element_accessor (unsigned int idx) const
 Create and return ElementAccessor to element of given idx. More...
 
Range< ElementAccessor< 3 > > elements_range () const
 Returns range of mesh elements. More...
 
Range< NodeAccessor< 3 > > node_range () const
 Returns range of nodes. More...
 
Range< Edgeedge_range () const
 Return range of edges. More...
 
virtual Boundary boundary (uint edge_idx) const =0
 
virtual BCMeshbc_mesh () const =0
 
virtual Partitioningget_part ()=0
 
virtual const LongIdxget_local_part ()=0
 
virtual std::shared_ptr< EquivalentMeshMapcheck_compatible_mesh (Mesh &input_mesh)=0
 
void intersect_element_lists (vector< unsigned int > const &nodes_list, vector< unsigned int > &intersection_element_list)
 
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...
 
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...
 
const std::vector< unsigned int > & node_permutations () const
 Return permutation vector of nodes. More...
 
const std::vector< unsigned int > & element_permutations () const
 Return permutation vector of elements. More...
 

Public Attributes

vector< vector< unsigned int > > node_elements_
 For each node the vector contains a list of elements that use this node. More...
 
vector< vector< vector< unsigned int > > > side_nodes
 

Static Public Attributes

static const unsigned int undef_idx =-1
 

Protected Member Functions

void canonical_faces ()
 
void create_node_element_lists ()
 
Elementadd_element_to_vector (int id, bool is_boundary=false)
 Adds element to mesh data structures (element_vec_, element_ids_), returns pointer to this element. More...
 
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)
 

Protected Attributes

vector< Elementelement_vec_
 
BidirectionalMap< int > element_ids_
 Maps element ids to indexes into vector element_vec_. More...
 
std::vector< EdgeDataedges
 Vector of MH edges, this should not be part of the geometrical mesh. More...
 
vector< Neighbourvb_neighbours_
 Vector of compatible neighbourings. More...
 
unsigned int max_edge_sides_ [3]
 Maximal number of sides per one edge in the actual mesh (set in make_neighbours_and_edges()). More...
 
shared_ptr< Armor::Array< double > > nodes_
 
shared_ptr< BidirectionalMap< int > > node_ids_
 Maps node ids to indexes into vector node_vec_. 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...
 
std::array< std::array< uint, 4 >, 64 > element_nodes_original_
 
LongIdxrow_4_el
 Index set assigning to global element index the local index used in parallel vectors. More...
 
LongIdxel_4_loc
 Index set assigning to local element index its global index. More...
 
Distributionel_ds
 Parallel distribution of elements. More...
 
DuplicateNodesduplicate_nodes_
 
std::shared_ptr< RegionDBregion_db_
 

Friends

class Edge
 
class Element
 
template<int spacedim>
class ElementAccessor
 
template<int spacedim>
class NodeAccessor
 

Detailed Description

Base class for Mesh and BCMesh.

Definition at line 96 of file mesh.h.

Constructor & Destructor Documentation

◆ MeshBase()

MeshBase::MeshBase ( )

Definition at line 67 of file mesh.cc.

◆ ~MeshBase()

MeshBase::~MeshBase ( )
virtual

Definition at line 108 of file mesh.cc.

Member Function Documentation

◆ add_element_to_vector()

Element * MeshBase::add_element_to_vector ( int  id,
bool  is_boundary = false 
)
protected

Adds element to mesh data structures (element_vec_, element_ids_), returns pointer to this element.

Definition at line 1161 of file mesh.cc.

Here is the caller graph for this function:

◆ bc_mesh()

virtual BCMesh* MeshBase::bc_mesh ( ) const
pure virtual

Implemented in Mesh, and BCMesh.

Here is the caller graph for this function:

◆ boundary()

virtual Boundary MeshBase::boundary ( uint  edge_idx) const
pure virtual

Implemented in BCMesh, and Mesh.

Here is the caller graph for this function:

◆ canonical_faces()

void MeshBase::canonical_faces ( )
protected

Permute nodes of individual elements so that all elements have same edge orientations and aligned sides have same order of their nodes Canonical edge orientation in elements and faces is from nodes of lower local index to higher local index.

Algorithm detals:

  1. Orient all edges from lowe global node id to higher node id, fictional step. (substantial is orientation of yet non-oriented edges of a node in direction out of the node. Can be proven (!?) that this prevents edge cycles of the length 3 (faces with cyclic edges).
  2. Having all faces non-cyclic there exists a permutation of any element to the reference element. Pass through the elements. Sort nodes by global ID.

Definition at line 152 of file mesh.cc.

Here is the caller graph for this function:

◆ check_compatible_mesh()

virtual std::shared_ptr<EquivalentMeshMap> MeshBase::check_compatible_mesh ( Mesh input_mesh)
pure virtual

Implemented in Mesh, and BCMesh.

◆ check_element_size()

void MeshBase::check_element_size ( unsigned int  elem_idx) const
inline

Check if given index is in element_vec_.

Definition at line 162 of file mesh.h.

Here is the caller graph for this function:

◆ create_node_element_lists()

void MeshBase::create_node_element_lists ( )
protected

Create element lists for nodes in Mesh::nodes_elements.

Definition at line 539 of file mesh.cc.

Here is the caller graph for this function:

◆ DECLARE_EXCEPTION()

MeshBase::DECLARE_EXCEPTION ( ExcTooMatchingIds  ,
<< "Mesh: Duplicate dim-join lower dim elements: "<< EI_ElemId::val<< "  ,
"<< EI_ElemIdOther::val<< ".\n"   
)

◆ duplicate_nodes()

const DuplicateNodes* MeshBase::duplicate_nodes ( ) const
inline

Definition at line 147 of file mesh.h.

Here is the caller graph for this function:

◆ edge()

Edge MeshBase::edge ( uint  edge_idx) const

Return edge with given index.

Definition at line 131 of file mesh.cc.

Here is the caller graph for this function:

◆ edge_range()

Range< Edge > MeshBase::edge_range ( ) const

Return range of edges.

Definition at line 125 of file mesh.cc.

Here is the caller graph for this function:

◆ elem_index()

int MeshBase::elem_index ( int  elem_id) const
inline

For element of given elem_id returns index in element_vec_ or (-1) if element doesn't exist.

Definition at line 222 of file mesh.h.

Here is the caller graph for this function:

◆ element()

const Element& MeshBase::element ( unsigned  idx) const
inline

Definition at line 128 of file mesh.h.

Here is the caller graph for this function:

◆ element_accessor()

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

Create and return ElementAccessor to element of given idx.

Definition at line 866 of file mesh.cc.

◆ element_permutations()

const std::vector<unsigned int>& MeshBase::element_permutations ( ) const
inline

Return permutation vector of elements.

Definition at line 237 of file mesh.h.

◆ elements_range()

Range< ElementAccessor< 3 > > MeshBase::elements_range ( ) const

Returns range of mesh elements.

Definition at line 1174 of file mesh.cc.

◆ find_elem_id()

int MeshBase::find_elem_id ( unsigned int  pos) const
inline

Return element id (in GMSH file) of element of given position in element vector.

Definition at line 138 of file mesh.h.

Here is the caller graph for this function:

◆ find_lower_dim_element()

bool MeshBase::find_lower_dim_element ( vector< unsigned int > &  element_list,
unsigned int  dim,
unsigned int &  element_idx 
)
protected

Remove elements with dimension not equal to dim from element_list. Index of the first element of dimension dim-1, is returned in element_idx. If no such element is found the method returns false, if one such element is found the method returns true, if more elements are found we report an user input error.

Definition at line 584 of file mesh.cc.

Here is the caller graph for this function:

◆ find_node_id()

int MeshBase::find_node_id ( unsigned int  pos) const
inline

Return node id (in GMSH file) of node of given position in node vector.

Definition at line 156 of file mesh.h.

Here is the caller graph for this function:

◆ get_el_4_loc()

LongIdx* MeshBase::get_el_4_loc ( ) const
inline

Definition at line 122 of file mesh.h.

Here is the caller graph for this function:

◆ get_el_ds()

Distribution* MeshBase::get_el_ds ( ) const
inline

Definition at line 119 of file mesh.h.

Here is the caller graph for this function:

◆ get_local_part()

virtual const LongIdx* MeshBase::get_local_part ( )
pure virtual

Implemented in Mesh, and BCMesh.

◆ get_part()

virtual Partitioning* MeshBase::get_part ( )
pure virtual

Returns pointer to partitioning object. Partitioning is created during setup_topology.

Implemented in Mesh, and BCMesh.

◆ get_row_4_el()

LongIdx* MeshBase::get_row_4_el ( ) const
inline

Definition at line 125 of file mesh.h.

Here is the caller graph for this function:

◆ get_side_nodes()

const std::vector<unsigned int>& MeshBase::get_side_nodes ( unsigned int  dim,
unsigned int  side 
) const
inline

Definition at line 168 of file mesh.h.

Here is the caller graph for this function:

◆ init_element_vector()

void MeshBase::init_element_vector ( unsigned int  size)

Initialize element_vec_, set size and reset counters of boundary and bulk elements.

Definition at line 1142 of file mesh.cc.

Here is the caller graph for this function:

◆ init_node_vector()

void MeshBase::init_node_vector ( unsigned int  size)

Initialize node_vec_, set size.

Definition at line 1152 of file mesh.cc.

Here is the caller graph for this function:

◆ intersect_element_lists()

void MeshBase::intersect_element_lists ( vector< unsigned int > const &  nodes_list,
vector< unsigned int > &  intersection_element_list 
)

Find intersection of element lists given by Mesh::node_elements_ for elements givne by nodes_list parameter. The result is placed into vector intersection_element_list. If the node_list is empty, and empty intersection is returned.

Definition at line 552 of file mesh.cc.

Here is the caller graph for this function:

◆ max_edge_sides()

unsigned int MeshBase::max_edge_sides ( unsigned int  dim) const
inline

Returns maximal number of sides of one edge, which connects elements of dimension dim.

Parameters
dimDimension of elements sharing the edge.

Definition at line 145 of file mesh.h.

Here is the caller graph for this function:

◆ n_edges()

unsigned int MeshBase::n_edges ( ) const
inline

Definition at line 114 of file mesh.h.

Here is the caller graph for this function:

◆ n_elements()

unsigned int MeshBase::n_elements ( ) const
inline

Definition at line 111 of file mesh.h.

◆ n_nodes()

unsigned int MeshBase::n_nodes ( ) const
inline

Definition at line 171 of file mesh.h.

Here is the caller graph for this function:

◆ n_vb_neighbours()

unsigned int MeshBase::n_vb_neighbours ( ) const

Definition at line 137 of file mesh.cc.

Here is the caller graph for this function:

◆ node()

NodeAccessor< 3 > MeshBase::node ( unsigned int  idx) const

Create and return NodeAccessor to node of given idx.

Definition at line 872 of file mesh.cc.

Here is the caller graph for this function:

◆ node_elements()

const vector< vector< unsigned int > > & MeshBase::node_elements ( )

Returns nodes_elements vector, if doesn't exist creates its.

Definition at line 1134 of file mesh.cc.

Here is the caller graph for this function:

◆ node_permutations()

const std::vector<unsigned int>& MeshBase::node_permutations ( ) const
inline

Return permutation vector of nodes.

Definition at line 233 of file mesh.h.

◆ node_range()

Range< NodeAccessor< 3 > > MeshBase::node_range ( ) const

Returns range of nodes.

Definition at line 1180 of file mesh.cc.

Here is the caller graph for this function:

◆ region_db()

const RegionDB& MeshBase::region_db ( ) const
inline

Definition at line 175 of file mesh.h.

◆ same_sides()

bool MeshBase::same_sides ( const SideIter si,
vector< unsigned int > &  side_nodes 
)
protected

Returns true if side si has same nodes as in the list side_nodes.

Definition at line 606 of file mesh.cc.

Here is the caller graph for this function:

◆ TYPEDEF_ERR_INFO() [1/2]

MeshBase::TYPEDEF_ERR_INFO ( EI_ElemId  ,
int   
)

◆ TYPEDEF_ERR_INFO() [2/2]

MeshBase::TYPEDEF_ERR_INFO ( EI_ElemIdOther  ,
int   
)

◆ vb_neighbour()

const Neighbour & MeshBase::vb_neighbour ( unsigned int  nb) const

Return neighbour with given index.

Definition at line 1362 of file mesh.cc.

Here is the caller graph for this function:

Friends And Related Function Documentation

◆ Edge

friend class Edge
friend

Definition at line 345 of file mesh.h.

◆ Element

friend class Element
friend

Definition at line 348 of file mesh.h.

◆ ElementAccessor

template<int spacedim>
friend class ElementAccessor
friend

Definition at line 352 of file mesh.h.

◆ NodeAccessor

template<int spacedim>
friend class NodeAccessor
friend

Definition at line 353 of file mesh.h.

Member Data Documentation

◆ duplicate_nodes_

DuplicateNodes* MeshBase::duplicate_nodes_
protected

Definition at line 336 of file mesh.h.

◆ edges

std::vector<EdgeData> MeshBase::edges
protected

Vector of MH edges, this should not be part of the geometrical mesh.

Definition at line 301 of file mesh.h.

◆ el_4_loc

LongIdx* MeshBase::el_4_loc
protected

Index set assigning to local element index its global index.

Definition at line 331 of file mesh.h.

◆ el_ds

Distribution* MeshBase::el_ds
protected

Parallel distribution of elements.

Definition at line 333 of file mesh.h.

◆ elem_permutation_

std::vector<unsigned int> MeshBase::elem_permutation_
protected

Vector of element permutations of optimized mesh (see class MeshOptimizer)

Definition at line 321 of file mesh.h.

◆ element_ids_

BidirectionalMap<int> MeshBase::element_ids_
protected

Maps element ids to indexes into vector element_vec_.

Definition at line 298 of file mesh.h.

◆ element_nodes_original_

std::array<std::array<uint, 4>, 64> MeshBase::element_nodes_original_
protected

Definition at line 325 of file mesh.h.

◆ element_vec_

vector<Element> MeshBase::element_vec_
protected

Vector of elements of the mesh.

Store all elements of the mesh in order bulk elements - boundary elements

Definition at line 295 of file mesh.h.

◆ max_edge_sides_

unsigned int MeshBase::max_edge_sides_[3]
protected

Maximal number of sides per one edge in the actual mesh (set in make_neighbours_and_edges()).

Definition at line 307 of file mesh.h.

◆ node_elements_

vector<vector<unsigned int> > MeshBase::node_elements_

For each node the vector contains a list of elements that use this node.

Definition at line 242 of file mesh.h.

◆ node_ids_

shared_ptr<BidirectionalMap<int> > MeshBase::node_ids_
protected

Maps node ids to indexes into vector node_vec_.

Definition at line 315 of file mesh.h.

◆ node_permutation_

std::vector<unsigned int> MeshBase::node_permutation_
protected

Vector of node permutations of optimized mesh (see class MeshOptimizer)

Definition at line 318 of file mesh.h.

◆ nodes_

shared_ptr<Armor::Array<double> > MeshBase::nodes_
protected

Vector of nodes of the mesh.

Definition at line 312 of file mesh.h.

◆ region_db_

std::shared_ptr<RegionDB> MeshBase::region_db_
protected

Database of regions (both bulk and boundary) of the mesh. Regions are logical parts of the domain that allows setting of different data and boundary conditions on them.

Definition at line 342 of file mesh.h.

◆ row_4_el

LongIdx* MeshBase::row_4_el
protected

Index set assigning to global element index the local index used in parallel vectors.

Definition at line 329 of file mesh.h.

◆ side_nodes

vector< vector< vector<unsigned int> > > MeshBase::side_nodes

Definition at line 254 of file mesh.h.

◆ undef_idx

const unsigned int MeshBase::undef_idx =-1
static

Definition at line 105 of file mesh.h.

◆ vb_neighbours_

vector<Neighbour> MeshBase::vb_neighbours_
protected

Vector of compatible neighbourings.

Definition at line 304 of file mesh.h.


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