66 #define MESH_CRITICAL_VOLUME 1.0E-12 91 <<
"Duplicate boundary elements! \n" 92 <<
"Element id: " << EI_ElemLast::val <<
" on region name: " << EI_RegLast::val <<
"\n" 93 <<
"Element id: " << EI_ElemNew::val <<
" on region name: " << EI_RegNew::val <<
"\n");
95 <<
"Element IDs in non-increasing order, ID: " << EI_ElemId::val <<
"\n");
97 <<
"User defined region " << EI_Region::qval <<
" (id " << EI_RegIdx::val
98 <<
") by 'From_Elements' cannot have elements of different dimensions.\n" 99 <<
"Thrown due to: dim " << EI_Dim::val <<
" neq dim " << EI_DimOther::val <<
" (ele id " << EI_ElemId::val <<
").\n" 100 <<
"Split elements by dim, create separate regions and then possibly use Union.\n" );
102 <<
"Mesh: Duplicate dim-join lower dim elements: " << EI_ElemId::val <<
", " << EI_ElemIdOther::val <<
".\n" );
104 <<
"Boundary element (id: " << EI_ElemId::val <<
") match a regular element (id: " << EI_ElemIdOther::val <<
") of lower dimension.\n" );
121 static const unsigned int undef_idx=-1;
126 enum {x_coord=0, y_coord=1, z_coord=2};
144 return nodes_.size();
148 return boundary_.size();
158 unsigned int n_corners();
169 virtual const LongIdx *get_local_part();
184 {
return node_4_loc_; }
187 {
return n_local_nodes_; }
197 unsigned int n_sides()
const;
199 unsigned int n_vb_neighbours()
const;
205 unsigned int max_edge_sides(
unsigned int dim)
const {
return max_edge_sides_[dim-1]; }
212 void read_gmsh_from_stream(istream &in);
216 void init_from_input();
223 void setup_topology();
240 virtual std::shared_ptr<std::vector<LongIdx>> check_compatible_mesh(
Mesh & input_mesh);
309 void check_and_finish();
315 const BIHTree &get_bih_tree();\
325 void add_node(
unsigned int node_id,
arma::vec3 coords);
328 void add_element(
unsigned int elm_id,
unsigned int dim,
unsigned int region_id,
unsigned int partition_id,
332 void add_physical_name(
unsigned int dim,
unsigned int id, std::string name);
336 return in_record_.val<
FilePath>(
"mesh_file");
343 double global_snap_radius()
const;
346 void init_element_vector(
unsigned int size);
349 void init_node_vector(
unsigned int size);
371 return element_ids_.get_position(elem_id);
377 return element_ids_[pos];
383 return elem_permutation_;
389 return node_ids_.get_position(node_id);
395 return node_ids_[pos];
401 return node_permutation_;
405 void check_element_size(
unsigned int elem_idx)
const;
408 unsigned int create_boundary_elements();
435 : elm_id(e_id), dim(dm), region_idx(reg_idx), partition_id(part_id), node_ids(nodes) {}
456 void make_neighbours_and_edges();
462 void make_edge_permutations();
466 void create_node_element_lists();
472 bool find_lower_dim_element(
vector<unsigned int> &element_list,
unsigned int dim,
unsigned int &element_idx);
480 void element_to_neigh_vb();
482 void count_element_types();
483 void count_side_types();
488 void check_mesh_on_read();
500 Element * add_element_to_vector(
int id);
503 void init_element(
Element *ele,
unsigned int elm_id,
unsigned int dim,
RegionIdx region_idx,
unsigned int partition_id,
509 unsigned int max_edge_sides_[3];
512 void output_internal_ngh_data();
532 std::shared_ptr<Partitioning>
part_;
602 void distribute_nodes();
Distribution * el_ds
Parallel distribution of elements.
Class for the mesh partitioning. This should provide:
vector< Element > element_vec_
ElementTmpData(unsigned int e_id, unsigned int dm, RegionIdx reg_idx, unsigned int part_id, std::vector< unsigned int > nodes)
Constructor.
BidirectionalMap< int > node_ids_
Maps node ids to indexes into vector node_vec_.
unsigned int n_local_nodes_
Hold number of local nodes (own + ghost), value is equal with size of node_4_loc array.
LongIdx * get_row_4_el() const
unsigned int partition_id
BCMesh * bc_mesh_
Boundary mesh, object is created only if it's necessary.
LongIdx * get_node_4_loc() const
const std::vector< unsigned int > & element_permutations() const
Return permutation vector of elements.
BidirectionalMap< int > element_ids_
Maps element ids to indexes into vector element_vec_.
static Input::Type::Record input_type
LongIdx * node_4_loc_
Index set assigning to local node index its global index.
std::vector< unsigned int > elem_permutation_
Vector of element permutations of optimized mesh (see class MeshOptimizer)
Implementation of bidirectional map.
#define DECLARE_EXCEPTION(ExcName, Format)
Macro for simple definition of exceptions.
ofstream raw_ngh_output_file
virtual unsigned int n_elements() const
Returns count of boundary or bulk elements.
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...
std::shared_ptr< MixedMeshIntersections > intersections
Template Iter serves as general template for internal iterators.
unsigned int n_local_nodes() const
std::vector< EdgeData > edges
Vector of MH edges, this should not be part of the geometrical mesh.
std::vector< unsigned int > node_ids
vector< vector< vector< unsigned int > > > side_nodes
const RegionDB & region_db() const
virtual unsigned int n_nodes() const
vector< BoundaryData > boundary_
std::vector< unsigned int > node_permutation_
Vector of node permutations of optimized mesh (see class MeshOptimizer)
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.
const std::vector< unsigned int > & node_permutations() const
Return permutation vector of nodes.
Armor::Array< double > nodes_
unsigned int boundary_loaded_size_
Count of boundary elements loaded from mesh file.
int find_elem_id(unsigned int pos) const
Return element id (in GMSH file) of element of given position in element vector.
MPI_Comm get_comm() const
LongIdx * el_4_loc
Index set assigning to local element index its global index.
unsigned int n_boundaries() const
Class for O(log N) lookup for intersections with a set of bounding boxes.
LongIdx * row_4_el
Index set assigning to global element index the local index used in parallel vectors.
#define TYPEDEF_ERR_INFO(EI_Type, Type)
Macro to simplify declaration of error_info types.
std::shared_ptr< BIHTree > bih_tree_
Distribution * get_el_ds() const
vector< vector< unsigned int > > node_elements_
For each node the vector contains a list of elements that use this node.
Dedicated class for storing path to input and output files.
vector< vector< unsigned int > > master_elements
vector< Neighbour > vb_neighbours_
int LongIdx
Define type that represents indices of large arrays (elements, nodes, dofs etc.)
Distribution * node_ds_
Parallel distribution of nodes. Depends on elements distribution.
unsigned int max_edge_sides(unsigned int dim) const
FilePath mesh_file()
Return FilePath object representing "mesh_file" input key.
Class represents boundary part of mesh.
Internal mesh data classes.
IntersectionSearch
Types of search algorithm for finding intersection candidates.
unsigned int n_edges() const
Distribution * get_node_ds() const
LongIdx * get_el_4_loc() const
Implementation of range helper class.
unsigned int bulk_size_
Count of bulk elements.
std::shared_ptr< Partitioning > part_
vector< ElementTmpData > bc_element_tmp_
Hold data of boundary elements during reading mesh (allow to preserve correct order during reading of...
Main class for computation of intersection of meshes of combined dimensions.
int find_node_id(unsigned int pos) const
Return node id (in GMSH file) of node of given position in node vector.