Flow123d
master-d6c300039
|
Go to the documentation of this file.
66 #define MESH_CRITICAL_VOLUME 1.0E-12
86 :
bulk(bulk_size, def_val),
103 <<
"Mesh: Duplicate dim-join lower dim elements: " << EI_ElemId::val <<
", " << EI_ElemIdOther::val <<
".\n" );
115 {
return edges.size(); }
375 <<
"Duplicate boundary elements! \n"
376 <<
"Element id: " << EI_ElemLast::val <<
" on region name: " << EI_RegLast::val <<
"\n"
377 <<
"Element id: " << EI_ElemNew::val <<
" on region name: " << EI_RegNew::val <<
"\n");
379 <<
"Element IDs in non-increasing order, ID: " << EI_ElemId::val <<
"\n");
381 <<
"User defined region " << EI_Region::qval <<
" (id " << EI_RegIdx::val
382 <<
") by 'From_Elements' cannot have elements of different dimensions.\n"
383 <<
"Thrown due to: dim " << EI_Dim::val <<
" neq dim " << EI_DimOther::val <<
" (ele id " << EI_ElemId::val <<
").\n"
384 <<
"Split elements by dim, create separate regions and then possibly use Union.\n" );
386 <<
"Extremely bad quality element ID=" << EI_ElemId::val <<
",(" << EI_Quality::val <<
"<4*epsilon).\n");
388 <<
"Boundary element (id: " << EI_ElemId::val <<
") match a regular element (id: " << EI_ElemIdOther::val <<
") of lower dimension.\n" );
542 void add_element(
unsigned int elm_id,
unsigned int dim,
unsigned int region_id,
unsigned int partition_id,
668 std::shared_ptr<Partitioning>
part_;
LongIdx * get_row_4_el() const
unsigned int partition_id
shared_ptr< Armor::Array< double > > nodes_
unsigned int max_edge_sides(unsigned int dim) const
std::shared_ptr< RegionDB > region_db_
std::vector< unsigned int > node_permutation_
Vector of node permutations of optimized mesh (see class MeshOptimizer)
const Element & element(unsigned idx) const
Template Iter serves as general template for internal iterators.
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.
LongIdx * row_4_el
Index set assigning to global element index the local index used in parallel vectors.
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.
const RegionDB & region_db() const
std::vector< LongIdx > bulk
Distribution * get_el_ds() const
std::shared_ptr< EquivalentMeshMap > check_compatible_mesh(Mesh &input_mesh) override
unsigned int n_sides() const
Main class for computation of intersection of meshes of combined dimensions.
Dedicated class for storing path to input and output files.
LongIdx * el_4_loc
Index set assigning to local element index its global index.
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()
Boundary boundary(uint edge_idx) const override
static const unsigned int undef_idx
unsigned int n_edges() const
Class for O(log N) lookup for intersections with a set of bounding boxes.
shared_ptr< BidirectionalMap< int > > node_ids_
Maps node ids to indexes into vector node_vec_.
TYPEDEF_ERR_INFO(EI_ElemLast, int)
Class for the mesh partitioning. This should provide:
virtual std::shared_ptr< EquivalentMeshMap > check_compatible_mesh(Mesh &input_mesh)=0
unsigned int n_local_nodes_
Hold number of local nodes (own + ghost), value is equal with size of node_4_loc array.
Range< ElementAccessor< 3 > > elements_range() const
Returns range of mesh elements.
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
Distribution * get_node_ds() const
DuplicateNodes * duplicate_nodes_
const Neighbour & vb_neighbour(unsigned int nb) const
Return neighbour with given index.
int get_position(T val) const
Return position of item of given value.
bool same_sides(const SideIter &si, vector< unsigned int > &side_nodes)
void output_internal_ngh_data()
Output of neighboring data into raw output.
void check_element_size(unsigned int elem_idx) const
Check if given index is in element_vec_.
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
BCMesh * bc_mesh() const override
Implement MeshBase::bc_mesh(), getter of boundary mesh.
std::vector< EdgeData > edges
Vector of MH edges, this should not be part of the geometrical mesh.
void check_mesh_on_read()
const LongIdx * get_local_part() override
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)
const vector< vector< unsigned int > > & node_elements()
vector< Neighbour > vb_neighbours_
Vector of compatible neighbourings.
Range< NodeAccessor< 3 > > node_range() const
Returns range of nodes.
void elements_id_maps(vector< LongIdx > &bulk_elements_id, vector< LongIdx > &boundary_elements_id) const
Element * add_element_to_vector(int id, bool is_boundary=false)
Adds element to mesh data structures (element_vec_, element_ids_), returns pointer to this element.
ElementAccessor< 3 > element_accessor(unsigned int idx) const
Create and return ElementAccessor to element of given idx.
NodeAccessor< 3 > node(unsigned int idx) const
Create and return NodeAccessor to node of given idx.
Implementation of bidirectional map.
IntersectionSearch
Types of search algorithm for finding intersection candidates.
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.
~Mesh() override
Destructor.
void element_to_neigh_vb()
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.
const std::vector< unsigned int > & get_side_nodes(unsigned int dim, unsigned int side) const
void init_node_vector(unsigned int size)
Initialize node_vec_, set size.
Partitioning * get_part() override
int find_elem_id(unsigned int pos) const
Return element id (in GMSH file) of element of given position in element vector.
int LongIdx
Define type that represents indices of large arrays (elements, nodes, dofs etc.)
Edge edge(uint edge_idx) const
Return edge with given index.
EquivalentMeshMap(unsigned int bulk_size, unsigned int boundary_size, LongIdx def_val)
void modify_element_ids(const RegionDB::MapElementIDToRegionID &map)
void intersect_element_lists(vector< unsigned int > const &nodes_list, vector< unsigned int > &intersection_element_list)
Distribution * el_ds
Parallel distribution of elements.
unsigned int check_compatible_elements(MeshBase *source_mesh, MeshBase *target_mesh, const std::vector< unsigned int > &node_ids, std::vector< LongIdx > &map)
void init_element_vector(unsigned int size)
Initialize element_vec_, set size and reset counters of boundary and bulk elements.
void make_neighbours_and_edges()
std::vector< unsigned int > elem_permutation_
Vector of element permutations of optimized mesh (see class MeshOptimizer)
const std::vector< unsigned int > & element_permutations() const
Return permutation vector of elements.
LongIdx * get_el_4_loc() const
TYPEDEF_ERR_INFO(EI_ElemId, int)
unsigned int n_boundaries() const
Internal mesh data classes.
vector< vector< unsigned int > > node_elements_
For each node the vector contains a list of elements that use this node.
Base class for Mesh and BCMesh.
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.
static Input::Type::Record input_type
unsigned int n_vb_neighbours() const
vector< vector< vector< unsigned int > > > side_nodes
bool find_lower_dim_element(vector< unsigned int > &element_list, unsigned int dim, unsigned int &element_idx)
void add_node(unsigned int node_id, arma::vec3 coords)
Add new node of given id and coordinates to mesh.
Range< Edge > edge_range() const
Return range of edges.
virtual Partitioning * get_part()=0
std::shared_ptr< Partitioning > part_
virtual Boundary boundary(uint edge_idx) const =0
BidirectionalMap< int > element_ids_
Maps element ids to indexes into vector element_vec_.
DECLARE_EXCEPTION(ExcTooMatchingIds,<< "Mesh: Duplicate dim-join lower dim elements: "<< EI_ElemId::val<< ", "<< EI_ElemIdOther::val<< ".\n")
double global_snap_radius() const
Maximal distance of observe point from Mesh relative to its size.
unsigned int n_elements() const
const std::vector< unsigned int > & node_permutations() const
Return permutation vector of nodes.
vector< BoundaryData > boundary_
unsigned int n_local_nodes() const
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.
void create_node_element_lists()
BCMesh * bc_mesh_
Boundary mesh, object is created only if it's necessary.
MixedMeshIntersections & mixed_intersections()
int find_node_id(unsigned int pos) const
Return node id (in GMSH file) of node of given position in node vector.
unsigned int max_edge_sides_[3]
Maximal number of sides per one edge in the actual mesh (set in make_neighbours_and_edges()).
vector< Element > element_vec_
unsigned int n_nodes() const
virtual const LongIdx * get_local_part()=0
virtual BCMesh * bc_mesh() const =0
const DuplicateNodes * duplicate_nodes() const
std::array< std::array< uint, 4 >, 64 > element_nodes_original_
void add_physical_name(unsigned int dim, unsigned int id, std::string name)
Add new node of given id and coordinates to mesh.
Implementation of range helper class.
std::shared_ptr< MixedMeshIntersections > intersections