#include <mesh.h>
|
| 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 |
|
int * | get_row_4_el () const |
|
int * | get_el_4_loc () const |
|
MPI_Comm | get_comm () const |
|
void | make_intersec_elements () |
|
unsigned int | n_sides () |
|
unsigned int | n_vb_neighbours () const |
|
unsigned int | max_edge_sides (unsigned int dim) const |
|
void | elements_id_maps (vector< int > &bulk_elements_id, vector< int > &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 | setup_topology () |
|
void | check_and_finish () |
|
const BIHTree & | get_bih_tree () |
|
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...
|
|
Definition at line 97 of file mesh.h.
Labels for coordinate indexes in arma::vec3 representing vectors and points.
Enumerator |
---|
x_coord |
|
y_coord |
|
z_coord |
|
Definition at line 116 of file mesh.h.
Empty constructor.
Use only for unit tests!!!
Definition at line 74 of file mesh.cc.
Constructor from an input record. Do not process input record. That is done in init_from_input.
Definition at line 82 of file mesh.cc.
Destructor.
Definition at line 149 of file mesh.cc.
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 753 of file mesh.cc.
void Mesh::add_node |
( |
unsigned int |
node_id, |
|
|
arma::vec3 |
coords |
|
) |
| |
Add new node of given id and coordinates to mesh.
Definition at line 747 of file mesh.cc.
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 742 of file mesh.cc.
void Mesh::check_and_finish |
( |
| ) |
|
Check usage of regions, set regions to elements defined by user, close RegionDB
Definition at line 720 of file mesh.cc.
void Mesh::count_element_types |
( |
| ) |
|
|
protected |
void Mesh::count_side_types |
( |
| ) |
|
|
protected |
void Mesh::create_node_element_lists |
( |
| ) |
|
|
protected |
Create element lists for nodes in Mesh::nodes_elements.
Definition at line 271 of file mesh.cc.
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 |
|
) |
| |
void Mesh::element_to_neigh_vb |
( |
| ) |
|
|
protected |
void Mesh::elements_id_maps |
( |
vector< int > & |
bulk_elements_id, |
|
|
vector< int > & |
boundary_elements_id |
|
) |
| const |
Fills vectors of ID numbers of bulk and bc elements.
Definition at line 675 of file mesh.cc.
bool Mesh::find_lower_dim_element |
( |
ElementVector & |
elements, |
|
|
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 312 of file mesh.cc.
const BIHTree & Mesh::get_bih_tree |
( |
| ) |
|
Returns MPI communicator of the mesh.
Definition at line 186 of file mesh.h.
int* Mesh::get_el_4_loc |
( |
| ) |
const |
|
inline |
Returns pointer to partitioning object. Partitioning is created during setup_topology.
Definition at line 194 of file mesh.cc.
int* Mesh::get_row_4_el |
( |
| ) |
const |
|
inline |
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 284 of file mesh.cc.
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 524 of file mesh.cc.
void Mesh::make_intersec_elements |
( |
| ) |
|
void Mesh::make_neighbours_and_edges |
( |
| ) |
|
|
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:
- use std::is_any for setting is_neigbour
- possibly make appropriate constructors for Edge and Neighbour
- check side!=-1 when searching neigbouring element
- process bc_elements first, there should be no Neigh, but check it set Edge and boundary there
Definition at line 349 of file mesh.cc.
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
-
dim | Dimension of elements sharing the edge. |
Definition at line 201 of file mesh.h.
Return FilePath object representing "mesh_file" input key.
Definition at line 310 of file mesh.h.
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 220 of file mesh.cc.
unsigned int Mesh::n_boundaries |
( |
| ) |
const |
|
inline |
unsigned int Mesh::n_corners |
( |
| ) |
|
unsigned int Mesh::n_edges |
( |
| ) |
const |
|
inline |
unsigned int Mesh::n_elements |
( |
| ) |
const |
|
inline |
unsigned int Mesh::n_nodes |
( |
| ) |
const |
|
inline |
unsigned int Mesh::n_sides |
( |
| ) |
|
unsigned int Mesh::n_vb_neighbours |
( |
| ) |
const |
|
inline |
vector< vector< unsigned int > > const & Mesh::node_elements |
( |
| ) |
|
Returns nodes_elements vector, if doesn't exist creates its.
Definition at line 787 of file mesh.cc.
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_list | Array input AbstractRecords which define regions, region sets and elements |
Definition at line 710 of file mesh.cc.
const RegionDB& Mesh::region_db |
( |
| ) |
const |
|
inline |
Common part of both previous constructors and way how to reinitialize a mesh from the given input record.
Definition at line 104 of file mesh.cc.
void Mesh::reserve_element_size |
( |
unsigned int |
n_elements | ) |
|
|
inline |
Reserve size of element vector.
Definition at line 165 of file mesh.h.
void Mesh::reserve_node_size |
( |
unsigned int |
n_nodes | ) |
|
|
inline |
Reserve size of node vector.
Definition at line 160 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 332 of file mesh.cc.
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 230 of file mesh.cc.
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 |
|
|
) |
| |
vector of boundary elements - should replace 'boundary' TODO: put both bulk and bc elements (on zero level) to the same vector or make better map id->element for field inputs that use element IDs the avoid usage of ElementVector etc.
Definition at line 236 of file mesh.h.
std::shared_ptr<BIHTree> Mesh::bih_tree_ |
|
protected |
BIH Tree for intersection and observe points lookup.
Definition at line 389 of file mesh.h.
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 232 of file mesh.h.
MPI communicator used for partitioning and ...
Definition at line 398 of file mesh.h.
Vector of MH edges, this should not be part of the geometrical mesh.
Definition at line 239 of file mesh.h.
Index set assigning to local element index its global index.
Definition at line 411 of file mesh.h.
Parallel distribution of elements.
Definition at line 413 of file mesh.h.
intersections array for every intersection in which El is master Mesh::element |
Vector of elements of the mesh.
For every element El we have vector of indices into This is necessary for true mortar.
Definition at line 228 of file mesh.h.
Accessor to the input record for the mesh.
Definition at line 393 of file mesh.h.
Vector of individual intersections of two elements. This is enough for local mortar.
Definition at line 247 of file mesh.h.
unsigned int Mesh::max_edge_sides_[3] |
|
protected |
unsigned int Mesh::n_all_input_elements_ |
Number of elements read from input.
Definition at line 315 of file mesh.h.
unsigned int Mesh::n_bb_neigh |
|
protected |
unsigned int Mesh::n_vb_neigh |
|
protected |
Vector of nodes of the mesh.
Definition at line 226 of file mesh.h.
Mesh partitioning. Created in setup_topology.
Definition at line 384 of file mesh.h.
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 380 of file mesh.h.
Index set assigning to global element index the local index used in parallel vectors.
Definition at line 409 of file mesh.h.
const unsigned int Mesh::undef_idx =-1 |
|
static |
Vector of compatible neighbourings.
Definition at line 258 of file mesh.h.
The documentation for this class was generated from the following files:
- /opt/flow123d/flow123d/src/mesh/mesh.h
- /opt/flow123d/flow123d/src/mesh/mesh.cc