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(); }
376 <<
"Duplicate boundary elements! \n"
377 <<
"Element id: " << EI_ElemLast::val <<
" on region name: " << EI_RegLast::val <<
"\n"
378 <<
"Element id: " << EI_ElemNew::val <<
" on region name: " << EI_RegNew::val <<
"\n");
380 <<
"Element IDs in non-increasing order, ID: " << EI_ElemId::val <<
"\n");
382 <<
"User defined region " << EI_Region::qval <<
" (id " << EI_RegIdx::val
383 <<
") by 'From_Elements' cannot have elements of different dimensions.\n"
384 <<
"Thrown due to: dim " << EI_Dim::val <<
" neq dim " << EI_DimOther::val <<
" (ele id " << EI_ElemId::val <<
").\n"
385 <<
"Split elements by dim, create separate regions and then possibly use Union.\n" );
387 <<
"Extremely bad quality element ID=" << EI_ElemId::val <<
",(" << EI_Quality::val <<
"<4*epsilon).\n");
389 <<
"Boundary element (id: " << EI_ElemId::val <<
") match a regular element (id: " << EI_ElemIdOther::val <<
") of lower dimension.\n" );
543 void add_element(
unsigned int elm_id,
unsigned int dim,
unsigned int region_id,
unsigned int partition_id,
669 std::shared_ptr<Partitioning>
part_;
Implementation of bidirectional map.
Class represents boundary part of mesh.
Class for O(log N) lookup for intersections with a set of bounding boxes.
int get_position(T val) const
Return position of item of given value.
static Input::Type::Record input_type
Dedicated class for storing path to input and output files.
Base class for Mesh and BCMesh.
vector< Element > element_vec_
shared_ptr< Armor::Array< double > > nodes_
vector< vector< vector< unsigned int > > > side_nodes
void intersect_element_lists(vector< unsigned int > const &nodes_list, vector< unsigned int > &intersection_element_list)
LongIdx * get_el_4_loc() const
const std::vector< unsigned int > & node_permutations() const
Return permutation vector of nodes.
std::array< std::array< uint, 4 >, 64 > element_nodes_original_
bool same_sides(const SideIter &si, vector< unsigned int > &side_nodes)
const RegionDB & region_db() const
Distribution * el_ds
Parallel distribution of elements.
Range< Edge > edge_range() const
Return range of edges.
const std::vector< unsigned int > & element_permutations() const
Return permutation vector of elements.
std::shared_ptr< RegionDB > region_db_
virtual const LongIdx * get_local_part()=0
shared_ptr< BidirectionalMap< int > > node_ids_
Maps node ids to indexes into vector node_vec_.
void init_element_vector(unsigned int size)
Initialize element_vec_, set size and reset counters of boundary and bulk elements.
virtual Boundary boundary(uint edge_idx) const =0
virtual std::shared_ptr< EquivalentMeshMap > check_compatible_mesh(Mesh &input_mesh)=0
TYPEDEF_ERR_INFO(EI_ElemId, int)
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.
vector< vector< unsigned int > > node_elements_
For each node the vector contains a list of elements that use this node.
NodeAccessor< 3 > node(unsigned int idx) const
Create and return NodeAccessor to node of given idx.
int find_elem_id(unsigned int pos) const
Return element id (in GMSH file) of element of given position in element vector.
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< unsigned int > elem_permutation_
Vector of element permutations of optimized mesh (see class MeshOptimizer)
unsigned int n_edges() const
LongIdx * get_row_4_el() const
LongIdx * el_4_loc
Index set assigning to local element index its global index.
bool find_lower_dim_element(vector< unsigned int > &element_list, unsigned int dim, unsigned int &element_idx)
TYPEDEF_ERR_INFO(EI_ElemIdOther, int)
const Element & element(unsigned idx) const
void create_node_element_lists()
void check_element_size(unsigned int elem_idx) const
Check if given index is in element_vec_.
BidirectionalMap< int > element_ids_
Maps element ids to indexes into vector element_vec_.
vector< Neighbour > vb_neighbours_
Vector of compatible neighbourings.
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.
DuplicateNodes * duplicate_nodes_
DECLARE_EXCEPTION(ExcTooMatchingIds,<< "Mesh: Duplicate dim-join lower dim elements: "<< EI_ElemId::val<< ", "<< EI_ElemIdOther::val<< ".\n")
const Neighbour & vb_neighbour(unsigned int nb) const
Return neighbour with given index.
std::vector< EdgeData > edges
Vector of MH edges, this should not be part of the geometrical mesh.
void init_node_vector(unsigned int size)
Initialize node_vec_, set size.
Distribution * get_el_ds() const
unsigned int n_elements() const
std::vector< unsigned int > node_permutation_
Vector of node permutations of optimized mesh (see class MeshOptimizer)
const std::vector< unsigned int > & get_side_nodes(unsigned int dim, unsigned int side) const
Edge edge(uint edge_idx) const
Return edge with given index.
vector< vector< unsigned int > > const & node_elements()
Range< ElementAccessor< 3 > > elements_range() const
Returns range of mesh elements.
Range< NodeAccessor< 3 > > node_range() const
Returns range of nodes.
unsigned int max_edge_sides(unsigned int dim) const
static const unsigned int undef_idx
unsigned int n_vb_neighbours() const
unsigned int max_edge_sides_[3]
Maximal number of sides per one edge in the actual mesh (set in make_neighbours_and_edges()).
virtual Partitioning * get_part()=0
virtual BCMesh * bc_mesh() const =0
const DuplicateNodes * duplicate_nodes() const
ElementAccessor< 3 > element_accessor(unsigned int idx) const
Create and return ElementAccessor to element of given idx.
std::shared_ptr< Partitioning > part_
IntersectionSearch get_intersection_search()
Getter for input type selection for intersection search algorithm.
unsigned int n_boundaries() const
void output_internal_ngh_data()
Output of neighboring data into raw output.
LongIdx * get_node_4_loc() const
Boundary boundary(uint edge_idx) const override
void element_to_neigh_vb()
bool optimize_memory_locality
TYPEDEF_ERR_INFO(EI_DimOther, unsigned int)
void count_element_types()
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.
DECLARE_EXCEPTION(ExcBdrElemMatchRegular,<< "Boundary element (id: "<< EI_ElemId::val<< ") match a regular element (id: "<< EI_ElemIdOther::val<< ") of lower dimension.\n")
vector< vector< unsigned int > > master_elements
unsigned int n_local_nodes_
Hold number of local nodes (own + ghost), value is equal with size of node_4_loc array.
DECLARE_EXCEPTION(ExcBadElement,<< "Extremely bad quality element ID="<< EI_ElemId::val<< ",("<< EI_Quality::val<< "<4*epsilon).\n")
void add_physical_name(unsigned int dim, unsigned int id, std::string name)
Add new node of given id and coordinates to mesh.
FilePath mesh_file()
Return FilePath object representing "mesh_file" input key.
DECLARE_EXCEPTION(ExcRegionElmDiffDim,<< "User defined region "<< EI_Region::qval<< " (id "<< EI_RegIdx::val<< ") by 'From_Elements' cannot have elements of different dimensions.\n"<< "Thrown due to: dim "<< EI_Dim::val<< " neq dim "<< EI_DimOther::val<< " (ele id "<< EI_ElemId::val<< ").\n"<< "Split elements by dim, create separate regions and then possibly use Union.\n")
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.
BCMesh * bc_mesh_
Boundary mesh, object is created only if it's necessary.
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")
const LongIdx * get_local_part() override
BCMesh * bc_mesh() const override
Implement MeshBase::bc_mesh(), getter of boundary mesh.
TYPEDEF_ERR_INFO(EI_Quality, double)
TYPEDEF_ERR_INFO(EI_RegLast, std::string)
DECLARE_EXCEPTION(ExcElmWrongOrder,<< "Element IDs in non-increasing order, ID: "<< EI_ElemId::val<< "\n")
void add_node(unsigned int node_id, arma::vec3 coords)
Add new node of given id and coordinates to mesh.
Partitioning * get_part() override
TYPEDEF_ERR_INFO(EI_RegNew, std::string)
~Mesh() override
Destructor.
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.
void distribute_nodes()
Fill array node_4_loc_ and create object node_ds_ according to element distribution.
Distribution * node_ds_
Parallel distribution of nodes. Depends on elements distribution.
unsigned int n_local_nodes() const
void make_neighbours_and_edges()
TYPEDEF_ERR_INFO(EI_RegIdx, unsigned int)
std::shared_ptr< MixedMeshIntersections > intersections
std::shared_ptr< BIHTree > bih_tree_
void check_mesh_on_read()
void elements_id_maps(vector< LongIdx > &bulk_elements_id, vector< LongIdx > &boundary_elements_id) const
double global_snap_radius() const
Maximal distance of observe point from Mesh relative to its size.
static const Input::Type::Selection & get_input_intersection_variant()
The definition of input record for selection of variant of file format.
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.
Distribution * get_node_ds() const
TYPEDEF_ERR_INFO(EI_Dim, unsigned int)
unsigned int check_compatible_elements(MeshBase *source_mesh, MeshBase *target_mesh, const std::vector< unsigned int > &node_ids, std::vector< LongIdx > &map)
MixedMeshIntersections & mixed_intersections()
void read_regions_from_input(Input::Array region_list)
unsigned int n_sides() const
vector< BoundaryData > boundary_
TYPEDEF_ERR_INFO(EI_ElemNew, int)
const BIHTree & get_bih_tree()
Getter for BIH. Creates and compute BIH at first call.
TYPEDEF_ERR_INFO(EI_Region, std::string)
IntersectionSearch
Types of search algorithm for finding intersection candidates.
void modify_element_ids(const RegionDB::MapElementIDToRegionID &map)
static const Input::Type::Record & get_input_type()
std::shared_ptr< EquivalentMeshMap > check_compatible_mesh(Mesh &input_mesh) override
LongIdx * node_4_loc_
Index set assigning to local node index its global index.
TYPEDEF_ERR_INFO(EI_ElemLast, int)
std::vector< BoundingBox > get_element_boxes()
Compute bounding boxes of elements contained in mesh.
void read_gmsh_from_stream(istream &in)
MPI_Comm get_comm() const
Main class for computation of intersection of meshes of combined dimensions.
Class for the mesh partitioning. This should provide:
Template Iter serves as general template for internal iterators.
int LongIdx
Define type that represents indices of large arrays (elements, nodes, dofs etc.)
Internal mesh data classes.
Implementation of range helper class.
std::vector< LongIdx > boundary
std::vector< LongIdx > bulk
EquivalentMeshMap(unsigned int bulk_size, unsigned int boundary_size, LongIdx def_val)
std::vector< unsigned int > node_ids
unsigned int partition_id
ElementTmpData(unsigned int e_id, unsigned int dm, RegionIdx reg_idx, unsigned int part_id, std::vector< unsigned int > nodes)
Constructor.