22 #include <boost/exception/info.hpp> 52 template <
class Object>
class Range;
64 #define MESH_CRITICAL_VOLUME 1.0E-12 87 <<
"Duplicate boundary elements! \n" 88 <<
"Element id: " << EI_ElemLast::val <<
" on region name: " << EI_RegLast::val <<
"\n" 89 <<
"Element id: " << EI_ElemNew::val <<
" on region name: " << EI_RegNew::val <<
"\n");
106 static const unsigned int undef_idx=-1;
112 enum {x_coord=0, y_coord=1, z_coord=2};
134 return node_vec_.size();
138 return boundary_.size();
145 unsigned int n_corners();
166 virtual const LongIdx *get_local_part();
181 {
return node_4_loc_; }
184 {
return n_local_nodes_; }
194 unsigned int n_sides()
const;
196 unsigned int n_vb_neighbours()
const;
202 unsigned int max_edge_sides(
unsigned int dim)
const {
return max_edge_sides_[dim-1]; }
209 void read_gmsh_from_stream(istream &in);
213 void init_from_input();
220 void setup_topology();
306 void check_and_finish();
312 const BIHTree &get_bih_tree();\
322 void add_node(
unsigned int node_id,
arma::vec3 coords);
325 void add_element(
unsigned int elm_id,
unsigned int dim,
unsigned int region_id,
unsigned int partition_id,
329 void add_physical_name(
unsigned int dim,
unsigned int id, std::string name);
333 return in_record_.val<
FilePath>(
"mesh_file");
340 double global_snap_radius()
const;
343 void init_element_vector(
unsigned int size);
346 void init_node_vector(
unsigned int size);
356 if (boundary)
return element_ids_.size()-bulk_size_;
357 else return bulk_size_;
366 return element_ids_.get_position(elem_id);
372 return element_ids_[pos];
378 return node_ids_.get_position(node_id);
384 return node_ids_[pos];
388 void check_element_size(
unsigned int elem_idx)
const;
391 void create_boundary_elements();
412 : elm_id(e_id), dim(dm), region_idx(reg_idx), partition_id(part_id), node_ids(nodes) {}
433 void make_neighbours_and_edges();
439 void make_edge_permutations();
443 void create_node_element_lists();
449 bool find_lower_dim_element(
vector<unsigned int> &element_list,
unsigned int dim,
unsigned int &element_idx);
457 void element_to_neigh_vb();
459 void count_element_types();
460 void count_side_types();
472 Element * add_element_to_vector(
int id,
bool boundary=
false);
475 void init_element(
Element *ele,
unsigned int elm_id,
unsigned int dim,
RegionIdx region_idx,
unsigned int partition_id,
481 unsigned int max_edge_sides_[3];
484 void output_internal_ngh_data();
494 std::shared_ptr<Partitioning>
part_;
555 void distribute_nodes();
Distribution * el_ds
Parallel distribution of elements.
int LongIdx
Define type that represents indices of large arrays (elements, nodes, dofs etc.)
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.
Iter< ElementAccessor< 3 > > ElementIter
LongIdx * get_node_4_loc() const
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.
Implementation of bidirectional map.
#define DECLARE_EXCEPTION(ExcName, Format)
Macro for simple definition of exceptions.
ofstream raw_ngh_output_file
Iter< NodeAccessor< 3 > > NodeIter
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< unsigned int > node_ids
vector< vector< vector< unsigned int > > > side_nodes
const RegionDB & region_db() const
virtual unsigned int n_nodes() const
vector< Boundary > boundary_
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.
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.
General iterator template. Provides iterator over objects in some container.
Dedicated class for storing path to input and output files.
vector< vector< unsigned int > > master_elements
vector< Neighbour > vb_neighbours_
Distribution * node_ds_
Parallel distribution of nodes. Depends on elements distribution.
virtual unsigned int n_elements(bool boundary=false) const
Returns count of boundary or bulk elements.
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.
Vector classes to support both Iterator, index and Id access and creating co-located vectors...
std::vector< Edge > edges
Vector of MH edges, this should not be part of the geometrical mesh.
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.