Flow123d
JS_before_hm-1804-gf2ad740aa
|
Go to the documentation of this file.
66 #define MESH_CRITICAL_VOLUME 1.0E-12
85 :
bulk(bulk_size, def_val),
114 <<
"Duplicate boundary elements! \n"
115 <<
"Element id: " << EI_ElemLast::val <<
" on region name: " << EI_RegLast::val <<
"\n"
116 <<
"Element id: " << EI_ElemNew::val <<
" on region name: " << EI_RegNew::val <<
"\n");
118 <<
"Element IDs in non-increasing order, ID: " << EI_ElemId::val <<
"\n");
120 <<
"User defined region " << EI_Region::qval <<
" (id " << EI_RegIdx::val
121 <<
") by 'From_Elements' cannot have elements of different dimensions.\n"
122 <<
"Thrown due to: dim " << EI_Dim::val <<
" neq dim " << EI_DimOther::val <<
" (ele id " << EI_ElemId::val <<
").\n"
123 <<
"Split elements by dim, create separate regions and then possibly use Union.\n" );
125 <<
"Extremely bad quality element ID=" << EI_ElemId::val <<
",(" << EI_Quality::val <<
"<4*epsilon).\n");
127 <<
"Mesh: Duplicate dim-join lower dim elements: " << EI_ElemId::val <<
", " << EI_ElemIdOther::val <<
".\n" );
129 <<
"Boundary element (id: " << EI_ElemId::val <<
") match a regular element (id: " << EI_ElemIdOther::val <<
") of lower dimension.\n" );
363 void add_element(
unsigned int elm_id,
unsigned int dim,
unsigned int region_id,
unsigned int partition_id,
575 std::shared_ptr<Partitioning>
part_;
const std::vector< unsigned int > & node_permutations() const
Return permutation vector of nodes.
unsigned int partition_id
Distribution * get_el_ds() const
unsigned int create_boundary_elements()
Create boundary elements from data of temporary structure, this method MUST be call after read mesh f...
Template Iter serves as general template for internal iterators.
Armor::Array< double > nodes_
static const Input::Type::Selection & get_input_intersection_variant()
The definition of input record for selection of variant of file format.
std::vector< BoundingBox > get_element_boxes()
Compute bounding boxes of elements contained in mesh.
std::vector< LongIdx > boundary
LongIdx * node_4_loc_
Index set assigning to local node index its global index.
void init_element_vector(unsigned int size)
Initialize element_vec_, set size and reset counters of boundary and bulk elements.
ElementTmpData(unsigned int e_id, unsigned int dm, RegionIdx reg_idx, unsigned int part_id, std::vector< unsigned int > nodes)
Constructor.
void init_element(Element *ele, unsigned int elm_id, unsigned int dim, RegionIdx region_idx, unsigned int partition_id, std::vector< unsigned int > node_ids)
Initialize element.
std::vector< LongIdx > bulk
virtual Range< ElementAccessor< 3 > > elements_range() const
Returns range of bulk elements.
unsigned int n_sides() const
const std::vector< unsigned int > & element_permutations() const
Return permutation vector of elements.
virtual std::shared_ptr< EquivalentMeshMap > check_compatible_mesh(Mesh &input_mesh)
Main class for computation of intersection of meshes of combined dimensions.
unsigned int boundary_loaded_size_
Count of boundary elements loaded from mesh file.
vector< Element > element_vec_
Dedicated class for storing path to input and output files.
void sort_permuted_nodes_elements(std::vector< int > new_node_ids, std::vector< int > new_elem_ids)
Sort elements and nodes by order stored in permutation vectors.
static const Input::Type::Record & get_input_type()
Class for O(log N) lookup for intersections with a set of bounding boxes.
unsigned int max_edge_sides_[3]
Maximal number of sides per one edge in the actual mesh (set in make_neighbours_and_edges()).
unsigned int n_edges() const
TYPEDEF_ERR_INFO(EI_ElemLast, int)
Class for the mesh partitioning. This should provide:
LongIdx * get_row_4_el() const
Range< NodeAccessor< 3 > > node_range() const
Returns range of nodes.
Boundary boundary(uint edge_idx) const
unsigned int n_local_nodes_
Hold number of local nodes (own + ghost), value is equal with size of node_4_loc array.
void read_regions_from_input(Input::Array region_list)
IntersectionSearch get_intersection_search()
Getter for input type selection for intersection search algorithm.
bool optimize_memory_locality
unsigned int n_vb_neighbours() const
virtual unsigned int n_elements() const
Returns count of boundary or bulk elements.
Distribution * get_node_ds() const
Distribution * el_ds
Parallel distribution of elements.
void intersect_element_lists(vector< unsigned int > const &nodes_list, vector< unsigned int > &intersection_element_list)
int get_position(T val) const
Return position of item of given value.
void output_internal_ngh_data()
Output of neighboring data into raw output.
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")
std::vector< unsigned int > node_ids
virtual const LongIdx * get_local_part()
BidirectionalMap< int > node_ids_
Maps node ids to indexes into vector node_vec_.
void check_mesh_on_read()
bool find_lower_dim_element(vector< unsigned int > &element_list, unsigned int dim, unsigned int &element_idx)
void count_element_types()
const BIHTree & get_bih_tree()
Getter for BIH. Creates and compute BIH at first call.
void distribute_nodes()
Fill array node_4_loc_ and create object node_ds_ according to element distribution.
LongIdx * get_node_4_loc() const
void read_gmsh_from_stream(istream &in)
BCMesh * get_bc_mesh()
Create boundary mesh if doesn't exist and return it.
LongIdx * el_4_loc
Index set assigning to local element index its global index.
void elements_id_maps(vector< LongIdx > &bulk_elements_id, vector< LongIdx > &boundary_elements_id) const
vector< vector< vector< unsigned int > > > side_nodes
std::vector< unsigned int > node_permutation_
Vector of node permutations of optimized mesh (see class MeshOptimizer)
Implementation of bidirectional map.
IntersectionSearch
Types of search algorithm for finding intersection candidates.
int find_elem_id(unsigned int pos) const
Return element id (in GMSH file) of element of given position in element vector.
const RegionDB & region_db() const
vector< vector< unsigned int > > master_elements
FilePath mesh_file()
Return FilePath object representing "mesh_file" input key.
std::shared_ptr< BIHTree > bih_tree_
Distribution * node_ds_
Parallel distribution of nodes. Depends on elements distribution.
bool same_sides(const SideIter &si, vector< unsigned int > &side_nodes)
void element_to_neigh_vb()
unsigned int size() const
void check_element_size(unsigned int elem_idx) const
Check if given index is in element_vec_.
MPI_Comm get_comm() const
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.
virtual ~Mesh()
Destructor.
void create_node_element_lists()
int LongIdx
Define type that represents indices of large arrays (elements, nodes, dofs etc.)
Element * add_element_to_vector(int id)
Adds element to mesh data structures (element_vec_, element_ids_), returns pointer to this element.
EquivalentMeshMap(unsigned int bulk_size, unsigned int boundary_size, LongIdx def_val)
void modify_element_ids(const RegionDB::MapElementIDToRegionID &map)
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::vector< EdgeData > edges
Vector of MH edges, this should not be part of the geometrical mesh.
void make_neighbours_and_edges()
void init_node_vector(unsigned int size)
Initialize node_vec_, set size.
std::vector< unsigned int > elem_permutation_
Vector of element permutations of optimized mesh (see class MeshOptimizer)
unsigned int n_boundaries() const
Internal mesh data classes.
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.
Class represents boundary part of mesh.
Range< Edge > edge_range() const
Returns range of edges.
static Input::Type::Record input_type
vector< vector< unsigned int > > node_elements_
For each node the vector contains a list of elements that use this node.
BidirectionalMap< int > element_ids_
Maps element ids to indexes into vector element_vec_.
void add_node(unsigned int node_id, arma::vec3 coords)
Add new node of given id and coordinates to mesh.
unsigned int max_edge_sides(unsigned int dim) const
vector< ElementTmpData > bc_element_tmp_
Hold data of boundary elements during reading mesh (allow to preserve correct order during reading of...
std::shared_ptr< Partitioning > part_
unsigned int check_compatible_elements(Mesh *source_mesh, Mesh *target_mesh, const std::vector< unsigned int > &node_ids, std::vector< LongIdx > &map)
unsigned int bulk_size_
Count of bulk elements.
LongIdx * row_4_el
Index set assigning to global element index the local index used in parallel vectors.
const vector< vector< unsigned int > > & node_elements()
double global_snap_radius() const
Maximal distance of observe point from Mesh relative to its size.
vector< BoundaryData > boundary_
unsigned int n_local_nodes() const
virtual Partitioning * get_part()
BCMesh * bc_mesh_
Boundary mesh, object is created only if it's necessary.
MixedMeshIntersections & mixed_intersections()
NodeAccessor< 3 > node(unsigned int idx) const
Create and return NodeAccessor to node of given idx.
virtual ElementAccessor< 3 > element_accessor(unsigned int idx) const
Create and return ElementAccessor to element of given idx.
virtual unsigned int n_nodes() const
int find_node_id(unsigned int pos) const
Return node id (in GMSH file) of node of given position in node vector.
Edge edge(uint edge_idx) const
void add_physical_name(unsigned int dim, unsigned int id, std::string name)
Add new node of given id and coordinates to mesh.
vector< Neighbour > vb_neighbours_
Implementation of range helper class.
LongIdx * get_el_4_loc() const
std::shared_ptr< MixedMeshIntersections > intersections