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();
185 unsigned int n_sides()
const;
187 unsigned int n_vb_neighbours()
const;
193 unsigned int max_edge_sides(
unsigned int dim)
const {
return max_edge_sides_[dim-1]; }
200 void read_gmsh_from_stream(istream &in);
204 void init_from_input();
211 void setup_topology();
297 void check_and_finish();
303 const BIHTree &get_bih_tree();\
313 void add_node(
unsigned int node_id,
arma::vec3 coords);
316 void add_element(
unsigned int elm_id,
unsigned int dim,
unsigned int region_id,
unsigned int partition_id,
320 void add_physical_name(
unsigned int dim,
unsigned int id, std::string name);
324 return in_record_.val<
FilePath>(
"mesh_file");
331 double global_snap_radius()
const;
334 void init_element_vector(
unsigned int size);
337 void init_node_vector(
unsigned int size);
347 if (boundary)
return element_ids_.size()-bulk_size_;
348 else return bulk_size_;
357 return element_ids_.get_position(elem_id);
363 return element_ids_[pos];
369 return node_ids_.get_position(node_id);
375 return node_ids_[pos];
379 void check_element_size(
unsigned int elem_idx)
const;
382 void create_boundary_elements();
403 : elm_id(e_id), dim(dm), region_idx(reg_idx), partition_id(part_id), node_ids(nodes) {}
424 void make_neighbours_and_edges();
430 void make_edge_permutations();
434 void create_node_element_lists();
440 bool find_lower_dim_element(
vector<unsigned int> &element_list,
unsigned int dim,
unsigned int &element_idx);
448 void element_to_neigh_vb();
450 void count_element_types();
451 void count_side_types();
463 Element * add_element_to_vector(
int id,
bool boundary=
false);
466 void init_element(
Element *ele,
unsigned int elm_id,
unsigned int dim,
RegionIdx region_idx,
unsigned int partition_id,
472 unsigned int max_edge_sides_[3];
475 void output_internal_ngh_data();
485 std::shared_ptr<Partitioning>
part_;
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_.
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
BidirectionalMap< int > element_ids_
Maps element ids to indexes into vector element_vec_.
static Input::Type::Record input_type
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.
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_
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
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.