Flow123d
release_2.2.0-914-gf1a3a4f
|
#include <mesh.h>
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) | |
void | reinit (Input::Record in_record) |
~Mesh () | |
Destructor. More... | |
unsigned int | n_nodes () const |
unsigned int | n_elements () const |
unsigned int | n_boundaries () const |
unsigned int | n_edges () const |
unsigned int | n_corners () |
const RegionDB & | region_db () const |
void | reserve_node_size (unsigned int n_nodes) |
Reserve size of node vector. More... | |
void | reserve_element_size (unsigned int n_elements) |
Reserve size of element vector. More... | |
Partitioning * | get_part () |
Distribution * | get_el_ds () const |
IdxInt * | get_row_4_el () const |
IdxInt * | get_el_4_loc () const |
MPI_Comm | get_comm () const |
MixedMeshIntersections & | mixed_intersections () |
unsigned int | n_sides () |
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< IdxInt > &bulk_elements_id, vector< IdxInt > &boundary_elements_id) const |
ElementAccessor< 3 > | element_accessor (unsigned int idx, bool boundary=false) |
void | read_regions_from_input (Input::Array region_list) |
vector< vector< unsigned int > > const & | node_elements () |
void | check_and_finish () |
void | compute_element_boxes () |
Precompute element bounding boxes if it is not done yet. More... | |
const BoundingBox & | get_mesh_boungin_box () |
Return the mesh bounding box. Is set after call compute_element_boxes(). More... | |
const BIHTree & | get_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_observe_radius () const |
Maximal distance of observe point from Mesh relative to its size. More... | |
Static Public Member Functions | |
static const Input::Type::Selection & | get_input_intersection_variant () |
The definition of input record for selection of variant of file format. More... | |
static const Input::Type::Record & | get_input_type () |
Public Attributes | |
NodeVector | node_vector |
Vector of nodes of the mesh. More... | |
ElementVector | element |
Vector of elements of the mesh. More... | |
vector< Boundary > | boundary_ |
ElementVector | bc_elements |
std::vector< Edge > | edges |
Vector of MH edges, this should not be part of the geometrical mesh. More... | |
std::shared_ptr< MixedMeshIntersections > | intersections |
vector< vector< unsigned int > > | master_elements |
vector< Neighbour > | vb_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 |
unsigned int | n_all_input_elements_ |
Number of elements read from input. More... | |
Static Public Attributes | |
static const unsigned int | undef_idx =-1 |
Protected Member Functions | |
void | make_neighbours_and_edges () |
void | make_edge_permutations () |
void | create_node_element_lists () |
bool | find_lower_dim_element (ElementVector &elements, 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 | modify_element_ids (const RegionDB::MapElementIDToRegionID &map) |
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< Partitioning > | part_ |
std::vector< BoundingBox > | element_box_ |
Auxiliary vector of mesh elements bounding boxes. More... | |
BoundingBox | mesh_box_ |
Bounding box of whole mesh. More... | |
std::shared_ptr< BIHTree > | bih_tree_ |
Input::Record | in_record_ |
MPI_Comm | comm_ |
vector< vector< unsigned int > > | node_elements_ |
Private Attributes | |
IdxInt * | row_4_el |
Index set assigning to global element index the local index used in parallel vectors. More... | |
IdxInt * | el_4_loc |
Index set assigning to local element index its global index. More... | |
Distribution * | el_ds |
Parallel distribution of elements. More... | |
Friends | |
class | RegionSetBase |
class | Element |
class | BIHTree |
typedef enum Mesh::IntersectionSearch Mesh::IntersectionSearch |
Types of search algorithm for finding intersection candidates.
anonymous enum |
Labels for coordinate indexes in arma::vec3 representing vectors and points.
Enumerator | |
---|---|
x_coord | |
y_coord | |
z_coord |
Mesh::Mesh | ( | Input::Record | in_record, |
MPI_Comm | com = MPI_COMM_WORLD |
||
) |
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 | ||
) |
void Mesh::add_node | ( | unsigned int | node_id, |
arma::vec3 | coords | ||
) |
void Mesh::add_physical_name | ( | unsigned int | dim, |
unsigned int | id, | ||
std::string | name | ||
) |
void Mesh::check_and_finish | ( | ) |
void Mesh::compute_element_boxes | ( | ) |
|
protected |
|
protected |
|
protected |
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" | |||
) |
ElementAccessor< 3 > Mesh::element_accessor | ( | unsigned int | idx, |
bool | boundary = false |
||
) |
|
protected |
|
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 336 of file mesh.cc.
const BIHTree & Mesh::get_bih_tree | ( | ) |
|
inline |
|
inline |
|
inline |
|
static |
|
static |
Mesh::IntersectionSearch Mesh::get_intersection_search | ( | ) |
|
inline |
Return the mesh bounding box. Is set after call compute_element_boxes().
Partitioning * Mesh::get_part | ( | ) |
Returns pointer to partitioning object. Partitioning is created during setup_topology.
Definition at line 218 of file mesh.cc.
|
inline |
double Mesh::global_observe_radius | ( | ) | const |
void Mesh::init_from_input | ( | ) |
Reads input record, creates regions, read the mesh, setup topology. creates region sets.
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 308 of file mesh.cc.
|
protected |
|
protected |
This replaces read_neighbours() in order to avoid using NGH preprocessor.
TODO:
Avoid maps:
4) replace EdgeVector by std::vector<Edge> (need not to know the size)
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:
Definition at line 373 of file mesh.cc.
|
inline |
|
inline |
MixedMeshIntersections & Mesh::mixed_intersections | ( | ) |
|
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 244 of file mesh.cc.
|
inline |
|
inline |
unsigned int Mesh::n_sides | ( | ) |
|
inline |
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()
region_list | Array input AbstractRecords which define regions, region sets and elements |
Definition at line 706 of file mesh.cc.
void Mesh::reinit | ( | Input::Record | in_record | ) |
|
inline |
|
inline |
void Mesh::setup_topology | ( | ) |
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 | |||
) |
|
friend |
ElementVector Mesh::bc_elements |
|
protected |
|
protected |
std::vector<Edge> Mesh::edges |
|
private |
|
private |
intersections array for every intersection in which El is master Mesh::element |
|
protected |
|
protected |
std::shared_ptr<MixedMeshIntersections> Mesh::intersections |
|
protected |
Maximal number of sides per one edge in the actual mesh (set in make_neighbours_and_edges()).
|
protected |
unsigned int Mesh::n_all_input_elements_ |
NodeVector Mesh::node_vector |
|
protected |
|
protected |
|
private |