Flow123d  JS_before_hm-1576-g4d0b70e
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)
 
 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")
 
 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 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)
 
vector< vector< unsigned int > > const & 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...
 
ofstream raw_ngh_output_file
 

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

Types of search algorithm for finding intersection candidates.

Member Enumeration Documentation

anonymous enum

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

Enumerator
x_coord 
y_coord 
z_coord 

Definition at line 108 of file mesh.h.

Types of search algorithm for finding intersection candidates.

Enumerator
BIHsearch 
BIHonly 
BBsearch 

Definition at line 92 of file mesh.h.

Constructor & Destructor Documentation

Mesh::Mesh ( )

Empty constructor.

Use only for unit tests!!!

Definition at line 103 of file mesh.cc.

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 ( )
virtual

Destructor.

Definition at line 208 of file mesh.cc.

Member Function Documentation

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 1162 of file mesh.cc.

Here is the caller graph for this function:

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 1237 of file mesh.cc.

Here is the caller graph for this function:

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

Add new node of given id and coordinates to mesh.

Definition at line 1154 of file mesh.cc.

Here is the caller graph for this function:

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 1149 of file mesh.cc.

Here is the caller graph for this function:

Boundary Mesh::boundary ( uint  edge_idx) const

Definition at line 263 of file mesh.cc.

Here is the caller graph for this function:

void Mesh::check_and_finish ( )

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

Definition at line 1106 of file mesh.cc.

Here is the caller graph for this function:

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

Reimplemented in BCMesh.

Definition at line 978 of file mesh.cc.

Here is the caller graph for this function:

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

Check if given index is in element_vec_.

Definition at line 1263 of file mesh.cc.

Here is the caller graph for this function:

void Mesh::check_mesh_on_read ( )
protected

Check the element quality and remove unused nodes.

Definition at line 326 of file mesh.cc.

Here is the caller graph for this function:

void Mesh::count_element_types ( )
protected

Definition at line 282 of file mesh.cc.

Here is the caller graph for this function:

void Mesh::count_side_types ( )
protected

Definition at line 464 of file mesh.cc.

Here is the caller graph for this function:

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 1353 of file mesh.cc.

Here is the caller graph for this function:

void Mesh::create_node_element_lists ( )
protected

Create element lists for nodes in Mesh::nodes_elements.

Definition at line 478 of file mesh.cc.

Here is the caller graph for this function:

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"   
)
void Mesh::distribute_nodes ( )
private

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

Definition at line 1407 of file mesh.cc.

Here is the caller graph for this function:

Edge Mesh::edge ( uint  edge_idx) const

Definition at line 257 of file mesh.cc.

Here is the caller graph for this function:

Range< Edge > Mesh::edge_range ( ) const

Returns range of edges.

Definition at line 1257 of file mesh.cc.

Here is the caller graph for this function:

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 351 of file mesh.h.

Here is the caller graph for this function:

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 925 of file mesh.cc.

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

Return permutation vector of elements.

Definition at line 363 of file mesh.h.

void Mesh::element_to_neigh_vb ( )
protected

Definition at line 875 of file mesh.cc.

Here is the caller graph for this function:

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 937 of file mesh.cc.

Here is the caller graph for this function:

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

Returns range of bulk elements.

Reimplemented in BCMesh.

Definition at line 1245 of file mesh.cc.

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 357 of file mesh.h.

Here is the caller graph for this function:

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 523 of file mesh.cc.

Here is the caller graph for this function:

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 375 of file mesh.h.

Here is the caller graph for this function:

BCMesh * Mesh::get_bc_mesh ( )

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

Definition at line 1401 of file mesh.cc.

Here is the caller graph for this function:

const BIHTree & Mesh::get_bih_tree ( )

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

Definition at line 1136 of file mesh.cc.

Here is the caller graph for this function:

MPI_Comm Mesh::get_comm ( ) const
inline

Returns MPI communicator of the mesh.

Definition at line 174 of file mesh.h.

Here is the caller graph for this function:

LongIdx* Mesh::get_el_4_loc ( ) const
inline

Definition at line 159 of file mesh.h.

Here is the caller graph for this function:

Distribution* Mesh::get_el_ds ( ) const
inline

Definition at line 153 of file mesh.h.

Here is the caller graph for this function:

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

Compute bounding boxes of elements contained in mesh.

Definition at line 1121 of file mesh.cc.

Here is the caller graph for this function:

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:

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

Definition at line 75 of file mesh.cc.

Here is the caller graph for this function:

Mesh::IntersectionSearch Mesh::get_intersection_search ( )

Getter for input type selection for intersection search algorithm.

Definition at line 157 of file mesh.cc.

Here is the caller graph for this function:

const LongIdx * Mesh::get_local_part ( )
virtual

Reimplemented in BCMesh.

Definition at line 273 of file mesh.cc.

Here is the caller graph for this function:

LongIdx* Mesh::get_node_4_loc ( ) const
inline

Definition at line 165 of file mesh.h.

Here is the caller graph for this function:

Distribution* Mesh::get_node_ds ( ) const
inline

Definition at line 162 of file mesh.h.

Here is the caller graph for this function:

Partitioning * Mesh::get_part ( )
virtual

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

Reimplemented in BCMesh.

Definition at line 269 of file mesh.cc.

Here is the caller graph for this function:

LongIdx* Mesh::get_row_4_el ( ) const
inline

Definition at line 156 of file mesh.h.

Here is the caller graph for this function:

double Mesh::global_snap_radius ( ) const

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

Definition at line 1145 of file mesh.cc.

Here is the caller graph for this function:

void Mesh::init ( )
protected

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

Definition at line 163 of file mesh.cc.

Here is the caller graph for this function:

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 1185 of file mesh.cc.

Here is the caller graph for this function:

void Mesh::init_element_vector ( unsigned int  size)

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

Definition at line 1214 of file mesh.cc.

Here is the caller graph for this function:

void Mesh::init_from_input ( )

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

void Mesh::init_node_vector ( unsigned int  size)

Initialize node_vec_, set size.

Definition at line 1228 of file mesh.cc.

Here is the caller graph for this function:

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 491 of file mesh.cc.

Here is the caller graph for this function:

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 755 of file mesh.cc.

Here is the caller graph for this function:

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 560 of file mesh.cc.

Here is the caller graph for this function:

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 187 of file mesh.h.

FilePath Mesh::mesh_file ( )
inline

Return FilePath object representing "mesh_file" input key.

Definition at line 317 of file mesh.h.

MixedMeshIntersections & Mesh::mixed_intersections ( )

Definition at line 908 of file mesh.cc.

Here is the caller graph for this function:

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 299 of file mesh.cc.

Here is the caller graph for this function:

unsigned int Mesh::n_boundaries ( ) const
inline

Definition at line 129 of file mesh.h.

unsigned int Mesh::n_corners ( )

Definition at line 247 of file mesh.cc.

unsigned int Mesh::n_edges ( ) const
inline

Definition at line 133 of file mesh.h.

Here is the caller graph for this function:

virtual unsigned int Mesh::n_elements ( ) const
inlinevirtual

Returns count of boundary or bulk elements.

Reimplemented in BCMesh.

Definition at line 343 of file mesh.h.

unsigned int Mesh::n_local_nodes ( ) const
inline

Definition at line 168 of file mesh.h.

Here is the caller graph for this function:

virtual unsigned int Mesh::n_nodes ( ) const
inlinevirtual

Reimplemented in BCMesh.

Definition at line 125 of file mesh.h.

Here is the caller graph for this function:

unsigned int Mesh::n_sides ( ) const

Definition at line 233 of file mesh.cc.

Here is the caller graph for this function:

unsigned int Mesh::n_vb_neighbours ( ) const

Definition at line 242 of file mesh.cc.

Here is the caller graph for this function:

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

Create and return NodeAccessor to node of given idx.

Definition at line 931 of file mesh.cc.

Here is the caller graph for this function:

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

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

Definition at line 1206 of file mesh.cc.

Here is the caller graph for this function:

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 369 of file mesh.h.

Here is the caller graph for this function:

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

Return permutation vector of nodes.

Definition at line 381 of file mesh.h.

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

Returns range of nodes.

Definition at line 1251 of file mesh.cc.

Here is the caller graph for this function:

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 427 of file mesh.cc.

Here is the caller graph for this function:

void Mesh::output_internal_ngh_data ( )
protected

Output of neighboring data into raw output.

Definition at line 1271 of file mesh.cc.

Here is the caller graph for this function:

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 1367 of file mesh.cc.

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 1384 of file mesh.cc.

void Mesh::read_gmsh_from_stream ( istream &  in)

Reads mesh from stream.

Method is especially used in unit tests.

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 1096 of file mesh.cc.

Here is the caller graph for this function:

const RegionDB& Mesh::region_db ( ) const
inline

Definition at line 142 of file mesh.h.

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 543 of file mesh.cc.

Here is the caller graph for this function:

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 391 of file mesh.cc.

Here is the caller graph for this function:

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 437 of file mesh.cc.

Here is the caller graph for this function:

Mesh::TYPEDEF_ERR_INFO ( EI_ElemLast  ,
int   
)
Mesh::TYPEDEF_ERR_INFO ( EI_ElemNew  ,
int   
)
Mesh::TYPEDEF_ERR_INFO ( EI_RegLast  ,
std::string   
)
Mesh::TYPEDEF_ERR_INFO ( EI_RegNew  ,
std::string   
)

Friends And Related Function Documentation

friend class BCMesh
friend

Definition at line 575 of file mesh.h.

friend class BIHTree
friend

Definition at line 573 of file mesh.h.

friend class Boundary
friend

Definition at line 574 of file mesh.h.

friend class Edge
friend

Definition at line 569 of file mesh.h.

friend class Element
friend

Definition at line 572 of file mesh.h.

template<int spacedim>
friend class ElementAccessor
friend

Definition at line 576 of file mesh.h.

template<int spacedim>
friend class NodeAccessor
friend

Definition at line 577 of file mesh.h.

friend class RegionSetBase
friend

Definition at line 571 of file mesh.h.

friend class Side
friend

Definition at line 570 of file mesh.h.

Member Data Documentation

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

BCMesh* Mesh::bc_mesh_
private

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

Definition at line 599 of file mesh.h.

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

BIH Tree for intersection and observe points lookup.

Definition at line 519 of file mesh.h.

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 245 of file mesh.h.

unsigned int Mesh::boundary_loaded_size_
protected

Count of boundary elements loaded from mesh file.

Definition at line 546 of file mesh.h.

unsigned int Mesh::bulk_size_
protected

Count of bulk elements.

Definition at line 543 of file mesh.h.

MPI_Comm Mesh::comm_
protected

MPI communicator used for partitioning and ...

Definition at line 530 of file mesh.h.

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

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

Definition at line 560 of file mesh.h.

LongIdx* Mesh::el_4_loc
private

Index set assigning to local element index its global index.

Definition at line 589 of file mesh.h.

Distribution* Mesh::el_ds
private

Parallel distribution of elements.

Definition at line 591 of file mesh.h.

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

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

Definition at line 566 of file mesh.h.

BidirectionalMap<int> Mesh::element_ids_
protected

Maps element ids to indexes into vector element_vec_.

Definition at line 549 of file mesh.h.

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 537 of file mesh.h.

Input::Record Mesh::in_record_
protected

Accessor to the input record for the mesh.

Definition at line 525 of file mesh.h.

std::shared_ptr<MixedMeshIntersections> Mesh::intersections

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

Definition at line 253 of file mesh.h.

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

Definition at line 259 of file mesh.h.

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 491 of file mesh.h.

unsigned int Mesh::n_bb_neigh
protected

Definition at line 488 of file mesh.h.

int Mesh::n_exsides

Definition at line 269 of file mesh.h.

int Mesh::n_insides

Definition at line 268 of file mesh.h.

int Mesh::n_lines

Definition at line 272 of file mesh.h.

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 597 of file mesh.h.

int Mesh::n_sides_
mutable

Definition at line 270 of file mesh.h.

int Mesh::n_tetrahedras

Definition at line 274 of file mesh.h.

int Mesh::n_triangles

Definition at line 273 of file mesh.h.

unsigned int Mesh::n_vb_neigh
protected

Definition at line 488 of file mesh.h.

LongIdx* Mesh::node_4_loc_
private

Index set assigning to local node index its global index.

Definition at line 593 of file mesh.h.

Distribution* Mesh::node_ds_
private

Parallel distribution of nodes. Depends on elements distribution.

Definition at line 595 of file mesh.h.

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

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

Definition at line 348 of file mesh.h.

BidirectionalMap<int> Mesh::node_ids_
protected

Maps node ids to indexes into vector node_vec_.

Definition at line 557 of file mesh.h.

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

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

Definition at line 563 of file mesh.h.

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

Vector of nodes of the mesh.

Definition at line 554 of file mesh.h.

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

Mesh partitioning. Created in setup_topology.

Definition at line 514 of file mesh.h.

ofstream Mesh::raw_ngh_output_file
private

Definition at line 601 of file mesh.h.

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 510 of file mesh.h.

LongIdx* Mesh::row_4_el
private

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

Definition at line 587 of file mesh.h.

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

Definition at line 286 of file mesh.h.

DuplicateNodes* Mesh::tree

Definition at line 261 of file mesh.h.

const unsigned int Mesh::undef_idx =-1
static

Definition at line 103 of file mesh.h.

vector<Neighbour> Mesh::vb_neighbours_

Vector of compatible neighbourings.

Definition at line 266 of file mesh.h.


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