Flow123d  JS_before_hm-1710-g489f4168f
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends | List of all members
Mesh Class Reference

#include <mesh.h>

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

Classes

struct  ElementTmpData
 

Public Types

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...
 

Public Member Functions

 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)
 
 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 (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)
 
virtual ~Mesh ()
 Destructor. More...
 
virtual unsigned int n_nodes () const
 
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
 
virtual Partitioningget_part ()
 
virtual const LongIdxget_local_part ()
 
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 setup_topology ()
 
void elements_id_maps (vector< LongIdx > &bulk_elements_id, vector< LongIdx > &boundary_elements_id) const
 
virtual std::shared_ptr< std::vector< LongIdx > > check_compatible_mesh (Mesh &input_mesh)
 
virtual std::shared_ptr< std::vector< LongIdx > > check_compatible_discont_mesh (Mesh &input_mesh)
 
virtual ElementAccessor< 3 > element_accessor (unsigned int idx) const
 Create and return ElementAccessor to element of given idx. More...
 
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...
 
virtual Range< ElementAccessor< 3 > > elements_range () const
 Returns range of bulk elements. More...
 
Range< NodeAccessor< 3 > > node_range () const
 Returns range of nodes. More...
 
Range< Edgeedge_range () const
 Returns range of edges. More...
 
virtual unsigned int n_elements () const
 Returns count of boundary or bulk elements. 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...
 
void permute_tetrahedron (unsigned int elm_idx, std::vector< unsigned int > permutation_vec)
 Permute nodes of 3D elements of given elm_idx. More...
 
void permute_triangle (unsigned int elm_idx, std::vector< unsigned int > permutation_vec)
 Permute nodes of 2D elements of given elm_idx. More...
 
BCMeshget_bc_mesh ()
 Create boundary mesh if doesn't exist and return it. More...
 

Static Public Member Functions

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

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_
 
int n_lines
 
int n_triangles
 
int n_tetrahedras
 
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...
 

Static Public Attributes

static const unsigned int undef_idx =-1
 

Protected Member Functions

void init ()
 
void make_neighbours_and_edges ()
 
void make_edge_permutations ()
 
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...
 

Protected Attributes

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...
 
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...
 

Private Member Functions

void distribute_nodes ()
 Fill array node_4_loc_ and create object node_ds_ according to element distribution. More...
 

Private Attributes

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...
 
LongIdxnode_4_loc_
 Index set assigning to local node index its global index. More...
 
Distributionnode_ds_
 Parallel distribution of nodes. Depends on elements distribution. More...
 
unsigned int n_local_nodes_
 Hold number of local nodes (own + ghost), value is equal with size of node_4_loc array. More...
 
BCMeshbc_mesh_
 Boundary mesh, object is created only if it's necessary. More...
 

Friends

class Edge
 
class Side
 
class RegionSetBase
 
class Element
 
class BIHTree
 
class Boundary
 
class BCMesh
 
template<int spacedim>
class ElementAccessor
 
template<int spacedim>
class NodeAccessor
 

Detailed Description

Definition at line 77 of file mesh.h.

Member Typedef Documentation

◆ IntersectionSearch

Types of search algorithm for finding intersection candidates.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Labels for coordinate indexes in arma::vec3 representing vectors and points.

Enumerator
x_coord 
y_coord 
z_coord 

Definition at line 126 of file mesh.h.

◆ IntersectionSearch

Types of search algorithm for finding intersection candidates.

Enumerator
BIHsearch 
BIHonly 
BBsearch 

Definition at line 110 of file mesh.h.

Constructor & Destructor Documentation

◆ Mesh() [1/2]

Mesh::Mesh ( )

Empty constructor.

Use only for unit tests!!!

Definition at line 103 of file mesh.cc.

◆ Mesh() [2/2]

Mesh::Mesh ( Input::Record  in_record,
MPI_Comm  com = MPI_COMM_WORLD 
)

Constructor from an input record. Do not process input record. That is done in init_from_input.

Definition at line 118 of file mesh.cc.

◆ ~Mesh()

Mesh::~Mesh ( )
virtual

Destructor.

Definition at line 195 of file mesh.cc.

Member Function Documentation

◆ add_element()

void Mesh::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.

Definition at line 1232 of file mesh.cc.

Here is the caller graph for this function:

◆ add_element_to_vector()

Element * Mesh::add_element_to_vector ( int  id)
protected

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

Definition at line 1307 of file mesh.cc.

Here is the caller graph for this function:

◆ add_node()

void Mesh::add_node ( unsigned int  node_id,
arma::vec3  coords 
)

Add new node of given id and coordinates to mesh.

Definition at line 1224 of file mesh.cc.

Here is the caller graph for this function:

◆ add_physical_name()

void Mesh::add_physical_name ( unsigned int  dim,
unsigned int  id,
std::string  name 
)

Add new node of given id and coordinates to mesh.

Definition at line 1219 of file mesh.cc.

Here is the caller graph for this function:

◆ boundary()

Boundary Mesh::boundary ( uint  edge_idx) const

Definition at line 250 of file mesh.cc.

Here is the caller graph for this function:

◆ check_and_finish()

void Mesh::check_and_finish ( )

Check usage of regions, set regions to elements defined by user, close RegionDB

Definition at line 1176 of file mesh.cc.

Here is the caller graph for this function:

◆ check_compatible_discont_mesh()

std::shared_ptr< std::vector< LongIdx > > Mesh::check_compatible_discont_mesh ( Mesh input_mesh)
virtual

Reimplemented in BCMesh.

Definition at line 1096 of file mesh.cc.

Here is the caller graph for this function:

◆ check_compatible_mesh()

std::shared_ptr< std::vector< LongIdx > > Mesh::check_compatible_mesh ( Mesh input_mesh)
virtual

Reimplemented in BCMesh.

Definition at line 961 of file mesh.cc.

Here is the caller graph for this function:

◆ check_element_size()

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

Check if given index is in element_vec_.

Definition at line 1333 of file mesh.cc.

Here is the caller graph for this function:

◆ check_mesh_on_read()

void Mesh::check_mesh_on_read ( )
protected

Check the element quality and remove unused nodes.

Definition at line 311 of file mesh.cc.

Here is the caller graph for this function:

◆ count_element_types()

void Mesh::count_element_types ( )
protected

Definition at line 269 of file mesh.cc.

Here is the caller graph for this function:

◆ count_side_types()

void Mesh::count_side_types ( )
protected

Definition at line 449 of file mesh.cc.

Here is the caller graph for this function:

◆ create_boundary_elements()

unsigned int Mesh::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.

Definition at line 1436 of file mesh.cc.

Here is the caller graph for this function:

◆ create_node_element_lists()

void Mesh::create_node_element_lists ( )
protected

Create element lists for nodes in Mesh::nodes_elements.

Definition at line 463 of file mesh.cc.

Here is the caller graph for this function:

◆ DECLARE_EXCEPTION() [1/5]

Mesh::DECLARE_EXCEPTION ( ExcBdrElemMatchRegular  ,
<< "Boundary element (id: "<< EI_ElemId::val<< ") match a regular element (id: "<< EI_ElemIdOther::val<< ") of lower dimension.\n"   
)

◆ DECLARE_EXCEPTION() [2/5]

Mesh::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() [3/5]

Mesh::DECLARE_EXCEPTION ( ExcElmWrongOrder  ,
<< "Element IDs in non-increasing  order,
ID:"<< EI_ElemId::val<< "\n"   
)

◆ DECLARE_EXCEPTION() [4/5]

Mesh::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() [5/5]

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

◆ distribute_nodes()

void Mesh::distribute_nodes ( )
private

Fill array node_4_loc_ and create object node_ds_ according to element distribution.

Definition at line 1490 of file mesh.cc.

Here is the caller graph for this function:

◆ edge()

Edge Mesh::edge ( uint  edge_idx) const

Definition at line 244 of file mesh.cc.

Here is the caller graph for this function:

◆ edge_range()

Range< Edge > Mesh::edge_range ( ) const

Returns range of edges.

Definition at line 1327 of file mesh.cc.

Here is the caller graph for this function:

◆ elem_index()

int Mesh::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 381 of file mesh.h.

Here is the caller graph for this function:

◆ element_accessor()

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

Create and return ElementAccessor to element of given idx.

Reimplemented in BCMesh.

Definition at line 908 of file mesh.cc.

◆ element_permutations()

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

Return permutation vector of elements.

Definition at line 393 of file mesh.h.

◆ element_to_neigh_vb()

void Mesh::element_to_neigh_vb ( )
protected

Definition at line 858 of file mesh.cc.

Here is the caller graph for this function:

◆ elements_id_maps()

void Mesh::elements_id_maps ( vector< LongIdx > &  bulk_elements_id,
vector< LongIdx > &  boundary_elements_id 
) const

Returns vector of ID numbers of elements, either bulk or bc elemnts.

Definition at line 920 of file mesh.cc.

Here is the caller graph for this function:

◆ elements_range()

Range< ElementAccessor< 3 > > Mesh::elements_range ( ) const
virtual

Returns range of bulk elements.

Reimplemented in BCMesh.

Definition at line 1315 of file mesh.cc.

◆ find_elem_id()

int Mesh::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 387 of file mesh.h.

Here is the caller graph for this function:

◆ find_lower_dim_element()

bool Mesh::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 508 of file mesh.cc.

Here is the caller graph for this function:

◆ find_node_id()

int Mesh::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 405 of file mesh.h.

Here is the caller graph for this function:

◆ get_bc_mesh()

BCMesh * Mesh::get_bc_mesh ( )

Create boundary mesh if doesn't exist and return it.

Definition at line 1484 of file mesh.cc.

Here is the caller graph for this function:

◆ get_bih_tree()

const BIHTree & Mesh::get_bih_tree ( )

Getter for BIH. Creates and compute BIH at first call.

Definition at line 1206 of file mesh.cc.

Here is the caller graph for this function:

◆ get_comm()

MPI_Comm Mesh::get_comm ( ) const
inline

Returns MPI communicator of the mesh.

Definition at line 192 of file mesh.h.

Here is the caller graph for this function:

◆ get_el_4_loc()

LongIdx* Mesh::get_el_4_loc ( ) const
inline

Definition at line 177 of file mesh.h.

Here is the caller graph for this function:

◆ get_el_ds()

Distribution* Mesh::get_el_ds ( ) const
inline

Definition at line 171 of file mesh.h.

Here is the caller graph for this function:

◆ get_element_boxes()

std::vector< BoundingBox > Mesh::get_element_boxes ( )

Compute bounding boxes of elements contained in mesh.

Definition at line 1191 of file mesh.cc.

Here is the caller graph for this function:

◆ get_input_intersection_variant()

const Input::Type::Selection & Mesh::get_input_intersection_variant ( )
static

The definition of input record for selection of variant of file format.

Definition at line 64 of file mesh.cc.

Here is the caller graph for this function:

◆ get_input_type()

const IT::Record & Mesh::get_input_type ( )
static

Definition at line 75 of file mesh.cc.

Here is the caller graph for this function:

◆ get_intersection_search()

Mesh::IntersectionSearch Mesh::get_intersection_search ( )

Getter for input type selection for intersection search algorithm.

Definition at line 144 of file mesh.cc.

Here is the caller graph for this function:

◆ get_local_part()

const LongIdx * Mesh::get_local_part ( )
virtual

Reimplemented in BCMesh.

Definition at line 260 of file mesh.cc.

Here is the caller graph for this function:

◆ get_node_4_loc()

LongIdx* Mesh::get_node_4_loc ( ) const
inline

Definition at line 183 of file mesh.h.

Here is the caller graph for this function:

◆ get_node_ds()

Distribution* Mesh::get_node_ds ( ) const
inline

Definition at line 180 of file mesh.h.

Here is the caller graph for this function:

◆ get_part()

Partitioning * Mesh::get_part ( )
virtual

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

Reimplemented in BCMesh.

Definition at line 256 of file mesh.cc.

Here is the caller graph for this function:

◆ get_row_4_el()

LongIdx* Mesh::get_row_4_el ( ) const
inline

Definition at line 174 of file mesh.h.

Here is the caller graph for this function:

◆ global_snap_radius()

double Mesh::global_snap_radius ( ) const

Maximal distance of observe point from Mesh relative to its size.

Definition at line 1215 of file mesh.cc.

Here is the caller graph for this function:

◆ init()

void Mesh::init ( )
protected

Part of the constructor whichdoes not depedn on input record. Initializes node-side numbering according to RefElement.

Definition at line 150 of file mesh.cc.

Here is the caller graph for this function:

◆ init_element()

void Mesh::init_element ( Element ele,
unsigned int  elm_id,
unsigned int  dim,
RegionIdx  region_idx,
unsigned int  partition_id,
std::vector< unsigned int >  node_ids 
)
protected

Initialize element.

Definition at line 1255 of file mesh.cc.

Here is the caller graph for this function:

◆ init_element_vector()

void Mesh::init_element_vector ( unsigned int  size)

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

Definition at line 1284 of file mesh.cc.

Here is the caller graph for this function:

◆ init_from_input()

void Mesh::init_from_input ( )

Reads input record, creates regions, read the mesh, setup topology. creates region sets.

◆ init_node_vector()

void Mesh::init_node_vector ( unsigned int  size)

Initialize node_vec_, set size.

Definition at line 1298 of file mesh.cc.

Here is the caller graph for this function:

◆ intersect_element_lists()

void Mesh::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 476 of file mesh.cc.

Here is the caller graph for this function:

◆ make_edge_permutations()

void Mesh::make_edge_permutations ( )
protected

On edges sharing sides of many elements it may happen that each side has its nodes ordered in a different way. This method finds the permutation for each side so as to obtain the ordering of side 0.

Definition at line 738 of file mesh.cc.

Here is the caller graph for this function:

◆ make_neighbours_and_edges()

void Mesh::make_neighbours_and_edges ( )
protected

This replaces read_neighbours() in order to avoid using NGH preprocessor.

TODO:

  • Avoid maps:

    5) need not to have temporary array for Edges, only postpone setting pointers in elements and set them after edges are found; we can temporary save Edge index instead of pointer in Neigbours and elements

    6) Try replace Edge * by indexes in Neigbours and elements (anyway we have mesh pointer in elements so it is accessible also from Neigbours)

TODO:

  • use std::is_any for setting is_neigbour
  • possibly make appropriate constructors for Edge and Neighbour
  • check side!=-1 when searching neigbouring element
  • process boundary elements first, there should be no Neigh, but check it set Edge and boundary there

Definition at line 544 of file mesh.cc.

Here is the caller graph for this function:

◆ max_edge_sides()

unsigned int Mesh::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 205 of file mesh.h.

◆ mesh_file()

FilePath Mesh::mesh_file ( )
inline

Return FilePath object representing "mesh_file" input key.

Definition at line 347 of file mesh.h.

◆ mixed_intersections()

MixedMeshIntersections & Mesh::mixed_intersections ( )

Definition at line 891 of file mesh.cc.

Here is the caller graph for this function:

◆ modify_element_ids()

void Mesh::modify_element_ids ( const RegionDB::MapElementIDToRegionID map)
protected

Possibly modify region id of elements sets by user in "regions" part of input file.

TODO: This method needs check in issue 'Review mesh setting'. Changes have been done during generalized region key and may be causing problems during the further development.

Definition at line 286 of file mesh.cc.

Here is the caller graph for this function:

◆ n_boundaries()

unsigned int Mesh::n_boundaries ( ) const
inline

Definition at line 147 of file mesh.h.

◆ n_corners()

unsigned int Mesh::n_corners ( )

Definition at line 234 of file mesh.cc.

◆ n_edges()

unsigned int Mesh::n_edges ( ) const
inline

Definition at line 151 of file mesh.h.

Here is the caller graph for this function:

◆ n_elements()

virtual unsigned int Mesh::n_elements ( ) const
inlinevirtual

Returns count of boundary or bulk elements.

Reimplemented in BCMesh.

Definition at line 373 of file mesh.h.

◆ n_local_nodes()

unsigned int Mesh::n_local_nodes ( ) const
inline

Definition at line 186 of file mesh.h.

Here is the caller graph for this function:

◆ n_nodes()

virtual unsigned int Mesh::n_nodes ( ) const
inlinevirtual

Reimplemented in BCMesh.

Definition at line 143 of file mesh.h.

Here is the caller graph for this function:

◆ n_sides()

unsigned int Mesh::n_sides ( ) const

Definition at line 220 of file mesh.cc.

Here is the caller graph for this function:

◆ n_vb_neighbours()

unsigned int Mesh::n_vb_neighbours ( ) const

Definition at line 229 of file mesh.cc.

Here is the caller graph for this function:

◆ node()

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

Create and return NodeAccessor to node of given idx.

Definition at line 914 of file mesh.cc.

Here is the caller graph for this function:

◆ node_elements()

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

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

Definition at line 1276 of file mesh.cc.

Here is the caller graph for this function:

◆ node_index()

int Mesh::node_index ( int  node_id) const
inline

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

Definition at line 399 of file mesh.h.

Here is the caller graph for this function:

◆ node_permutations()

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

Return permutation vector of nodes.

Definition at line 411 of file mesh.h.

◆ node_range()

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

Returns range of nodes.

Definition at line 1321 of file mesh.cc.

Here is the caller graph for this function:

◆ optimize()

void Mesh::optimize ( )
protected

Apply functionality of MeshOptimizer to sort nodes and elements.

Use Hilbert curve, need call sort_permuted_nodes_elements method.

Definition at line 412 of file mesh.cc.

Here is the caller graph for this function:

◆ output_internal_ngh_data()

void Mesh::output_internal_ngh_data ( )
protected

Output of neighboring data into raw output.

Definition at line 1341 of file mesh.cc.

Here is the caller graph for this function:

◆ permute_tetrahedron()

void Mesh::permute_tetrahedron ( unsigned int  elm_idx,
std::vector< unsigned int >  permutation_vec 
)

Permute nodes of 3D elements of given elm_idx.

Definition at line 1450 of file mesh.cc.

◆ permute_triangle()

void Mesh::permute_triangle ( unsigned int  elm_idx,
std::vector< unsigned int >  permutation_vec 
)

Permute nodes of 2D elements of given elm_idx.

Definition at line 1467 of file mesh.cc.

◆ read_gmsh_from_stream()

void Mesh::read_gmsh_from_stream ( istream &  in)

Reads mesh from stream.

Method is especially used in unit tests.

◆ read_regions_from_input()

void Mesh::read_regions_from_input ( Input::Array  region_list)

Reads elements and their affiliation to regions and region sets defined by user in input file Format of input record is defined in method RegionSetBase::get_input_type()

Parameters
region_listArray input AbstractRecords which define regions, region sets and elements

Definition at line 1166 of file mesh.cc.

Here is the caller graph for this function:

◆ region_db()

const RegionDB& Mesh::region_db ( ) const
inline

Definition at line 160 of file mesh.h.

◆ same_sides()

bool Mesh::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 527 of file mesh.cc.

Here is the caller graph for this function:

◆ setup_topology()

void Mesh::setup_topology ( )

Initialize all mesh structures from raw information about nodes and elements (including boundary elements). Namely: create remaining boundary elements and Boundary objects, find edges and compatible neighborings.

Definition at line 376 of file mesh.cc.

Here is the caller graph for this function:

◆ sort_permuted_nodes_elements()

void Mesh::sort_permuted_nodes_elements ( std::vector< int >  new_node_ids,
std::vector< int >  new_elem_ids 
)
protected

Sort elements and nodes by order stored in permutation vectors.

Definition at line 422 of file mesh.cc.

Here is the caller graph for this function:

◆ TYPEDEF_ERR_INFO() [1/10]

Mesh::TYPEDEF_ERR_INFO ( EI_Dim  ,
unsigned int   
)

◆ TYPEDEF_ERR_INFO() [2/10]

Mesh::TYPEDEF_ERR_INFO ( EI_DimOther  ,
unsigned int   
)

◆ TYPEDEF_ERR_INFO() [3/10]

Mesh::TYPEDEF_ERR_INFO ( EI_ElemId  ,
int   
)

◆ TYPEDEF_ERR_INFO() [4/10]

Mesh::TYPEDEF_ERR_INFO ( EI_ElemIdOther  ,
int   
)

◆ TYPEDEF_ERR_INFO() [5/10]

Mesh::TYPEDEF_ERR_INFO ( EI_ElemLast  ,
int   
)

◆ TYPEDEF_ERR_INFO() [6/10]

Mesh::TYPEDEF_ERR_INFO ( EI_ElemNew  ,
int   
)

◆ TYPEDEF_ERR_INFO() [7/10]

Mesh::TYPEDEF_ERR_INFO ( EI_RegIdx  ,
unsigned int   
)

◆ TYPEDEF_ERR_INFO() [8/10]

Mesh::TYPEDEF_ERR_INFO ( EI_Region  ,
std::string   
)

◆ TYPEDEF_ERR_INFO() [9/10]

Mesh::TYPEDEF_ERR_INFO ( EI_RegLast  ,
std::string   
)

◆ TYPEDEF_ERR_INFO() [10/10]

Mesh::TYPEDEF_ERR_INFO ( EI_RegNew  ,
std::string   
)

Friends And Related Function Documentation

◆ BCMesh

friend class BCMesh
friend

Definition at line 605 of file mesh.h.

◆ BIHTree

friend class BIHTree
friend

Definition at line 603 of file mesh.h.

◆ Boundary

friend class Boundary
friend

Definition at line 604 of file mesh.h.

◆ Edge

friend class Edge
friend

Definition at line 599 of file mesh.h.

◆ Element

friend class Element
friend

Definition at line 602 of file mesh.h.

◆ ElementAccessor

template<int spacedim>
friend class ElementAccessor
friend

Definition at line 606 of file mesh.h.

◆ NodeAccessor

template<int spacedim>
friend class NodeAccessor
friend

Definition at line 607 of file mesh.h.

◆ RegionSetBase

friend class RegionSetBase
friend

Definition at line 601 of file mesh.h.

◆ Side

friend class Side
friend

Definition at line 600 of file mesh.h.

Member Data Documentation

◆ bc_element_tmp_

vector<ElementTmpData> Mesh::bc_element_tmp_
protected

Hold data of boundary elements during reading mesh (allow to preserve correct order during reading of mix bulk-boundary element)

Definition at line 570 of file mesh.h.

◆ bc_mesh_

BCMesh* Mesh::bc_mesh_
private

Boundary mesh, object is created only if it's necessary.

Definition at line 629 of file mesh.h.

◆ bih_tree_

std::shared_ptr<BIHTree> Mesh::bih_tree_
protected

BIH Tree for intersection and observe points lookup.

Definition at line 549 of file mesh.h.

◆ boundary_

vector<BoundaryData> Mesh::boundary_
mutable

Vector of boundary sides where is prescribed boundary condition. TODO: apply all boundary conditions in the main assembling cycle over elements and remove this Vector.

Definition at line 275 of file mesh.h.

◆ boundary_loaded_size_

unsigned int Mesh::boundary_loaded_size_
protected

Count of boundary elements loaded from mesh file.

Definition at line 576 of file mesh.h.

◆ bulk_size_

unsigned int Mesh::bulk_size_
protected

Count of bulk elements.

Definition at line 573 of file mesh.h.

◆ comm_

MPI_Comm Mesh::comm_
protected

MPI communicator used for partitioning and ...

Definition at line 560 of file mesh.h.

◆ edges

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

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

Definition at line 590 of file mesh.h.

◆ el_4_loc

LongIdx* Mesh::el_4_loc
private

Index set assigning to local element index its global index.

Definition at line 619 of file mesh.h.

◆ el_ds

Distribution* Mesh::el_ds
private

Parallel distribution of elements.

Definition at line 621 of file mesh.h.

◆ elem_permutation_

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

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

Definition at line 596 of file mesh.h.

◆ element_ids_

BidirectionalMap<int> Mesh::element_ids_
protected

Maps element ids to indexes into vector element_vec_.

Definition at line 579 of file mesh.h.

◆ element_vec_

vector<Element> Mesh::element_vec_
protected

Vector of elements of the mesh.

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

Definition at line 567 of file mesh.h.

◆ in_record_

Input::Record Mesh::in_record_
protected

Accessor to the input record for the mesh.

Definition at line 555 of file mesh.h.

◆ intersections

std::shared_ptr<MixedMeshIntersections> Mesh::intersections

Vector of individual intersections of two elements. This is enough for local mortar.

Definition at line 283 of file mesh.h.

◆ master_elements

vector<vector<unsigned int> > Mesh::master_elements

Definition at line 289 of file mesh.h.

◆ max_edge_sides_

unsigned int Mesh::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 521 of file mesh.h.

◆ n_bb_neigh

unsigned int Mesh::n_bb_neigh
protected

Definition at line 518 of file mesh.h.

◆ n_exsides

int Mesh::n_exsides

Definition at line 299 of file mesh.h.

◆ n_insides

int Mesh::n_insides

Definition at line 298 of file mesh.h.

◆ n_lines

int Mesh::n_lines

Definition at line 302 of file mesh.h.

◆ n_local_nodes_

unsigned int Mesh::n_local_nodes_
private

Hold number of local nodes (own + ghost), value is equal with size of node_4_loc array.

Definition at line 627 of file mesh.h.

◆ n_sides_

int Mesh::n_sides_
mutable

Definition at line 300 of file mesh.h.

◆ n_tetrahedras

int Mesh::n_tetrahedras

Definition at line 304 of file mesh.h.

◆ n_triangles

int Mesh::n_triangles

Definition at line 303 of file mesh.h.

◆ n_vb_neigh

unsigned int Mesh::n_vb_neigh
protected

Definition at line 518 of file mesh.h.

◆ node_4_loc_

LongIdx* Mesh::node_4_loc_
private

Index set assigning to local node index its global index.

Definition at line 623 of file mesh.h.

◆ node_ds_

Distribution* Mesh::node_ds_
private

Parallel distribution of nodes. Depends on elements distribution.

Definition at line 625 of file mesh.h.

◆ node_elements_

vector<vector<unsigned int> > Mesh::node_elements_

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

Definition at line 378 of file mesh.h.

◆ node_ids_

BidirectionalMap<int> Mesh::node_ids_
protected

Maps node ids to indexes into vector node_vec_.

Definition at line 587 of file mesh.h.

◆ node_permutation_

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

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

Definition at line 593 of file mesh.h.

◆ nodes_

Armor::Array<double> Mesh::nodes_
protected

Vector of nodes of the mesh.

Definition at line 584 of file mesh.h.

◆ part_

std::shared_ptr<Partitioning> Mesh::part_
protected

Mesh partitioning. Created in setup_topology.

Definition at line 544 of file mesh.h.

◆ region_db_

RegionDB Mesh::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 540 of file mesh.h.

◆ row_4_el

LongIdx* Mesh::row_4_el
private

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

Definition at line 617 of file mesh.h.

◆ side_nodes

vector< vector< vector<unsigned int> > > Mesh::side_nodes

Definition at line 316 of file mesh.h.

◆ tree

DuplicateNodes* Mesh::tree

Definition at line 291 of file mesh.h.

◆ undef_idx

const unsigned int Mesh::undef_idx =-1
static

Definition at line 121 of file mesh.h.

◆ vb_neighbours_

vector<Neighbour> Mesh::vb_neighbours_

Vector of compatible neighbourings.

Definition at line 296 of file mesh.h.


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