21 #include <unordered_map> 67 "Use BIH for finding initial candidates, then continue by prolongation.")
69 "Use BIH for finding all candidates.")
71 "Use bounding boxes for finding initial candidates, then continue by prolongation.")
76 return IT::Record(
"Mesh",
"Record with mesh related data." )
79 "Input file with mesh description.")
81 "List of additional region and region set definitions not contained in the mesh. " 82 "There are three region sets implicitly defined:\n\n" 83 "- ALL (all regions of the mesh)\n" 84 "- .BOUNDARY (all boundary regions)\n" 85 "- BULK (all bulk regions)")
89 IT::Default(
"\"BIHsearch\""),
"Search algorithm for element intersections.")
91 "Maximal snapping distance from the mesh in various search operations. In particular, it is used " 92 "to find the closest mesh element of an observe point; and in FieldFormula to find closest surface " 93 "element in plan view (Z projection).")
95 "Output file with neighboring data from mesh.")
97 "This will speed up the calculations in assembations.")
133 istringstream is(
"{mesh_file=\"\"}");
147 MessageOut() <<
"Opening raw ngh output: " << raw_output_file_path <<
"\n";
188 for(
int dim=0; dim < 3; dim++) {
190 for(
int i_side=0; i_side < dim+2; i_side++)
194 for (
unsigned int sid=0; sid<RefElement<1>::n_sides; sid++)
195 for (
unsigned int nid=0; nid<RefElement<1>::n_nodes_per_side; nid++)
198 for (
unsigned int sid=0; sid<RefElement<2>::n_sides; sid++)
199 for (
unsigned int nid=0; nid<RefElement<2>::n_nodes_per_side; nid++)
202 for (
unsigned int sid=0; sid<RefElement<3>::n_sides; sid++)
203 for (
unsigned int nid=0; nid<RefElement<3>::n_nodes_per_side; nid++)
210 if (edg.side_)
delete[] edg.side_;
212 for (
unsigned int idx=0; idx <
bulk_size_; idx++) {
218 for(
unsigned int idx=bulk_size_; idx <
element_vec_.size(); idx++) {
248 unsigned int li, count = 0;
250 for (li=0; li<ele->n_nodes(); li++) {
260 return Edge(
this, edge_idx);
284 switch (elm->dim()) {
303 std::string reg_name =
"UndefinedRegion";
306 dim_to_check = ele.
dim();
310 for (
auto elem_to_region : map) {
313 if( ele.
dim() != dim_to_check){
314 xprintf(
UsrErr,
"User defined region '%s' (id %d) by 'From_Elements' cannot have elements of different dimensions.\n" 315 "Thrown due to: dim %d neq dim %d (ele id %d).\n" 316 "Split elements by dim, create separate regions and then possibly use Union.\n",
317 reg_name.c_str(), elem_to_region.second, dim_to_check, ele.
dim(), elem_to_region.first);
332 double quality = ele.quality_measure_smooth();
334 WarningOut().fmt(
"Bad quality (<0.001) of the element {}.\n", ele.idx());
337 for (
uint ele_node=0; ele_node<ele->n_nodes(); ele_node++) {
338 uint inode = ele->node_idx(ele_node);
339 nodes_new_idx[inode] = inode;
349 for(
uint inode = 0; inode < nodes_new_idx.size(); inode++) {
351 WarningOut().fmt(
"A node {} does not belong to any element " 352 " and will be removed.",
357 nodes_new_idx[inode] = inode_new;
367 uint n_nodes_new = inode_new;
370 if(n_nodes_new < nodes_new_idx.size()){
372 DebugOut() <<
"Updating node-element numbering due to unused nodes: " 381 for (
uint ele_node=0; ele_node<ele->n_nodes(); ele_node++) {
382 uint inode_orig = ele->node_idx(ele_node);
383 uint inode = nodes_new_idx[inode_orig];
385 const_cast<Element*
>(ele.element())->
nodes_[ele_node] = inode;
416 id_4_old[i++] = ele.idx();
483 for (
unsigned int n=0; n<ele->n_nodes(); n++)
487 stable_sort(n->begin(), n->end());
497 if (nodes_list.size() == 0) {
498 intersection_element_list.clear();
499 }
else if (nodes_list.size() == 1) {
506 it1=set_intersection(
509 intersection_element_list.begin());
510 intersection_element_list.resize(it1-intersection_element_list.begin());
512 for(;it2<nodes_list.end();++it2) {
513 it1=set_intersection(
514 intersection_element_list.begin(), intersection_element_list.end(),
516 intersection_element_list.begin());
517 intersection_element_list.resize(it1-intersection_element_list.begin());
524 bool is_neighbour =
false;
532 if (is_neighbour)
xprintf(
UsrErr,
"Too matching elements id: %d and id: %d in the same mesh.\n",
539 element_list.resize( e_dest - element_list.begin());
547 && find(side_nodes.begin(), side_nodes.end(), si->
node(ni).idx() ) != side_nodes.end() ) ni++;
548 return ( ni == si->
n_nodes() );
563 .error(
"Temporary structure of boundary element data is not empty. Did you call create_boundary_elements?");
567 unsigned int ngh_element_idx;
570 neighbour.
mesh_ =
this;
586 side_nodes.resize(bc_ele->
n_nodes());
587 for (
unsigned n=0; n<bc_ele->
n_nodes(); n++) side_nodes[n] = bc_ele->
node_idx(n);
591 xprintf(
UsrErr,
"Boundary element (id: %d) match a regular element (id: %d) of lower dimension.\n",
594 if (intersection_list.size() == 0) {
596 WarningOut().fmt(
"Lonely boundary element, id: {}, region: {}, dimension {}.\n",
600 last_edge_idx=
edges.size();
601 edges.resize(last_edge_idx+1);
602 edg = &(
edges.back() );
604 edg->
side_ =
new struct SideIter[ intersection_list.size() ];
618 for (
unsigned int ecs=0; ecs<elem->
n_sides(); ecs++) {
624 int new_bc_ele_idx=i;
625 THROW( ExcDuplicateBoundary()
652 for (
unsigned int s=0; s<e->n_sides(); s++)
659 side_nodes.resize(e.side(s)->n_nodes());
660 for (
unsigned n=0; n<e.side(s)->n_nodes(); n++) side_nodes[n] = e.side(s)->node(n).idx();
670 last_edge_idx=
edges.size();
671 edges.resize(last_edge_idx+1);
672 edg = &(
edges.back() );
674 edg->
side_ =
new struct SideIter[ intersection_list.size() ];
678 if (intersection_list.size() == 1) {
682 edg->
side_[0] = e.side(s);
685 if (e->boundary_idx_ == NULL) {
700 for(
unsigned int ni = 0; ni< side_nodes.size(); ni++) bc_ele->
nodes_[ni] = side_nodes[ni];
716 for (
unsigned int ecs=0; ecs<elem->
n_sides(); ecs++) {
722 last_edge_idx=
edges.size();
723 edges.resize(last_edge_idx+1);
724 edg = &(
edges.back() );
746 ASSERT_EQ( (
unsigned int) edg->
n_sides, intersection_list.size())(e.index())(s).error(
"Missing edge sides.");
759 std::unordered_map<unsigned int,unsigned int> node_numbers;
763 unsigned int n_side_nodes = edg.side(0)->n_nodes();
765 edg.side(0)->element()->permutation_idx_[edg.side(0)->side_idx()] = 0;
767 if (edg.n_sides() > 1)
770 unsigned int permutation[n_side_nodes];
773 node_numbers.clear();
774 for (
uint i=0; i<n_side_nodes; i++)
775 node_numbers[edg.side(0)->node(i).idx()] = i;
777 for (
uint sid=1; sid<edg.n_sides(); sid++)
779 for (
uint i=0; i<n_side_nodes; i++)
780 permutation[node_numbers[edg.side(sid)->node(i).idx()]] = i;
782 switch (edg.side(0)->dim())
802 unsigned int n_side_nodes = nb->element()->n_nodes();
803 unsigned int permutation[n_side_nodes];
804 node_numbers.clear();
808 for (
unsigned int i=0; i<n_side_nodes; i++)
809 node_numbers[nb->element().node(i).idx()] = i;
811 for (
unsigned int i=0; i<n_side_nodes; i++)
812 permutation[node_numbers[nb->side()->node(i).idx()]] = i;
814 switch (nb->side()->dim())
831 Edge edg = this->
edge(bdr->edge_idx_);
836 unsigned int n_side_nodes = bdr_elm->
n_nodes();
837 unsigned int permutation[n_side_nodes];
838 node_numbers.clear();
842 for (
unsigned int i=0; i<n_side_nodes; i++) {
843 node_numbers[bdr_elm.
node(i).idx()] = i;
848 for (
uint i=0; i<n_side_nodes; i++) {
849 permutation[node_numbers[edg.
side(sid)->
node(i).idx()]] = i;
852 switch (bdr_elm.
dim())
881 ele->n_neighs_vb_ =0;
884 for (
auto & ngh : this->
vb_neighbours_) ngh.element()->n_neighs_vb_++;
888 if( ele->n_neighs_vb() > 0 ) {
889 ele->neigh_vb =
new struct Neighbour* [ele->n_neighs_vb()];
895 for (
auto & ngh : this->vb_neighbours_) {
917 intersections = std::make_shared<MixedMeshIntersections>(
this);
939 if (bulk_elements_id.size() ==0) {
944 map_it = bulk_elements_id.begin();
946 for(
unsigned int idx=0; idx <
n_elements(); idx++, ++map_it) {
948 last_id=*map_it = id;
950 std::sort(bulk_elements_id.begin(), bulk_elements_id.end());
953 map_it = boundary_elements_id.begin();
960 if (
id < 0) last_id=*map_it=-1;
962 if (last_id >=
id)
xprintf(
UsrErr,
"Element IDs in non-increasing order, ID: %d\n",
id);
963 last_id=*map_it = id;
971 static const double point_tolerance = 1E-10;
972 return fabs(p1[0]-p2[0]) < point_tolerance
973 && fabs(p1[1]-p2[1]) < point_tolerance
974 && fabs(p1[2]-p2[2]) < point_tolerance;
985 std::shared_ptr<std::vector<LongIdx>> map_ptr = std::make_shared<std::vector<LongIdx>>(
element_vec_.size());
993 unsigned int i_node, i_elm_node;
1001 bih_tree.
find_point(*nod, searched_elements);
1005 for (i_node=0; i_node<ele->
n_nodes(); i_node++)
1007 static const double point_tolerance = 1E-10;
1008 if ( arma::norm(*ele.
node(i_node) - *nod, 1) < point_tolerance) {
1009 i_elm_node = ele.
node(i_node).idx();
1011 else if (found_i_node != i_elm_node) {
1013 return std::make_shared<std::vector<LongIdx>>(0);
1019 searched_elements.clear();
1029 unsigned int n_found=0;
1033 for (
unsigned int j=0; j<elm->n_nodes(); j++) {
1034 if (node_ids[ elm->node_idx(j) ] ==
Mesh::undef_idx) valid_nodes =
false;
1035 node_list.push_back( node_ids[ elm->node_idx(j) ] );
1039 for (
auto i_elm : candidate_list) {
1040 if ( input_mesh.
element_accessor(i_elm)->
dim() == elm.dim() ) result_list.push_back(i_elm);
1043 if (result_list.size() == 1) {
1044 element_ids_map[i] = (
LongIdx)result_list[0];
1050 result_list.clear();
1056 return std::make_shared<std::vector<LongIdx>>(0);
1070 for (
auto elm : bc_mesh->elements_range()) {
1072 for (
unsigned int j=0; j<elm->n_nodes(); j++) {
1073 if (node_ids[ elm->node_idx(j) ] ==
Mesh::undef_idx) valid_nodes =
false;
1074 node_list.push_back( node_ids[ elm->node_idx(j) ] );
1077 input_bc_mesh->intersect_element_lists(node_list, candidate_list);
1078 for (
auto i_elm : candidate_list) {
1079 if ( input_bc_mesh->element_accessor(i_elm)->dim() == elm.dim() ) result_list.push_back(i_elm);
1082 if (result_list.size() == 1) {
1083 element_ids_map[i] = (
LongIdx)result_list[0];
1088 result_list.clear();
1099 it != region_list.
end();
1138 bih_tree_ = std::make_shared<BIHTree>();
1162 void Mesh::add_element(
unsigned int elm_id,
unsigned int dim,
unsigned int region_id,
unsigned int partition_id,
1174 WarningOut().fmt(
"Bulk elements of zero size(dim=0) are not supported. Element ID: {}.\n", elm_id);
1179 this->
init_element(ele, elm_id, dim, region_idx, partition_id, node_ids);
1187 ele->
init(dim, region_idx);
1188 ele->
pid_ = partition_id;
1190 for (
unsigned int ni=0; ni<ele->
n_nodes(); ni++) {
1200 WarningOut().fmt(
"Tetrahedron element with id {} has wrong numbering or is degenerated (Jacobian = {}).",elm_id, jac);
1247 auto end_it = make_iter<ElementAccessor<3>>( ElementAccessor<3>(
this,
bulk_size_) );
1253 auto end_it = make_iter<NodeAccessor<3>>( NodeAccessor<3>(
this,
n_nodes()) );
1258 auto bgn_it = make_iter<Edge>(
Edge(
this, 0) );
1259 auto end_it = make_iter<Edge>(
Edge(
this,
edges.size()) );
1278 raw_ngh_output_file <<
"// fields:\n//ele_id n_sides ns_side_neighbors[n] neighbors[n*ns] n_vb_neighbors vb_neighbors[n_vb]\n";
1284 unsigned int undefined_ele_id = -1;
1287 if(ele->n_neighs_vb() > 0){
1288 for (
unsigned int i = 0; i < ele->n_neighs_vb(); i++){
1291 auto search = neigh_vb_map.find(higher_ele.
idx());
1292 if(search != neigh_vb_map.end()){
1294 search->second[ele->neigh_vb[i]->side()->side_idx()] = ele.idx();
1299 higher_ele_side_ngh[ele->neigh_vb[i]->side()->side_idx()] = ele.idx();
1300 neigh_vb_map[higher_ele.
idx()] = higher_ele_side_ngh;
1310 auto search_neigh = neigh_vb_map.end();
1311 for (
unsigned int i = 0; i < ele->n_sides(); i++) {
1312 unsigned int n_side_neighs = ele.side(i)->edge().n_sides()-1;
1314 if(n_side_neighs == 0){
1316 if(search_neigh == neigh_vb_map.end())
1317 search_neigh = neigh_vb_map.find(ele.idx());
1319 if(search_neigh != neigh_vb_map.end())
1320 if(search_neigh->second[i] != undefined_ele_id)
1326 for (
unsigned int i = 0; i < ele->n_sides(); i++) {
1330 if(edge.
side(j) != ele.side(i))
1335 else if(search_neigh != neigh_vb_map.end()
1336 && search_neigh->second[i] != undefined_ele_id){
1343 for (
unsigned int i = 0; i < ele->n_neighs_vb(); i++)
1358 e_data.partition_id, e_data.node_ids);
1361 unsigned int bdr_size = bc_element_tmp_.size();
1372 std::array<unsigned int, 4> tmp_nodes;
1376 for(
unsigned int i=0; i<elem.
n_nodes(); i++)
1378 tmp_nodes[i] = elem.
nodes_[permutation_vec[i]];
1389 std::array<unsigned int, 4> tmp_nodes;
1393 for(
unsigned int i=0; i<elem.
n_nodes(); i++)
1395 tmp_nodes[i] = elem.
nodes_[permutation_vec[i]];
1408 ASSERT_PTR(
el_4_loc).error(
"Array 'el_4_loc' is not initialized. Did you call Partitioning::id_maps?\n");
1410 unsigned int i_proc, i_node, i_ghost_node, elm_node;
1411 unsigned int my_proc =
el_ds->
myp();
1412 unsigned int n_proc =
el_ds->
np();
1420 i_proc = elm.proc();
1421 for (elm_node=0; elm_node<elm->n_nodes(); elm_node++) {
1422 i_node = elm->node_idx(elm_node);
1423 if (i_proc == my_proc) local_node_flag[i_node] =
true;
1424 if (i_proc < node_proc[i_node]) node_proc[i_node] = i_proc;
1430 for(
uint i_proc : node_proc) {
1431 if (i_proc == my_proc)
1433 else if (i_proc == n_proc)
1434 ASSERT(0)(
find_node_id(n_own_nodes)).error(
"A node does not belong to any element!");
1441 i_ghost_node = n_own_nodes;
1442 for (
unsigned int i=0; i<this->
n_nodes(); ++i) {
1443 if (local_node_flag[i]) {
1444 if (node_proc[i]==my_proc)
Distribution * el_ds
Parallel distribution of elements.
Class for the mesh partitioning. This should provide:
unsigned int n_sides() const
Returns number of sides aligned with the edge.
void output_internal_ngh_data()
Output of neighboring data into raw output.
const Element * element() const
unsigned int n_nodes() const
std::array< unsigned int, 4 > nodes_
indices to element's nodes
vector< Element > element_vec_
BidirectionalMap< int > node_ids_
Maps node ids to indexes into vector node_vec_.
vector< vector< unsigned int > > const & node_elements()
#define ASSERT_EQ_DBG(a, b)
Definition of comparative assert macro (EQual) only for debug mode.
unsigned int size() const
Return size of map.
void reserve(unsigned int init_size=0)
Reset data of map, reserve space for given size.
unsigned int n_local_nodes_
Hold number of local nodes (own + ghost), value is equal with size of node_4_loc array.
unsigned int * boundary_idx_
void permute_tetrahedron(unsigned int elm_idx, std::vector< unsigned int > permutation_vec)
Permute nodes of 3D elements of given elm_idx.
bool is_boundary() const
Returns true if it is a Boundary region and false if it is a Bulk region.
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.
std::vector< int > sort_nodes(std::vector< unsigned int > &node_permutation)
unsigned int side_idx() const
Returns local index of the side on the element.
MapElementIDToRegionID el_to_reg_map_
void init_element_vector(unsigned int size)
Initialize element_vec_, set size and reset counters of boundary and bulk elements.
virtual const LongIdx * get_local_part()
MixedMeshIntersections & mixed_intersections()
BidirectionalMap< int > element_ids_
Maps element ids to indexes into vector element_vec_.
Edge edge() const
Returns pointer to the edge connected to the side.
void append(const ArmaMat< Type, nr, nc > &item)
void add_node(unsigned int node_id, arma::vec3 coords)
Add new node of given id and coordinates to mesh.
LongIdx * node_4_loc_
Index set assigning to local node index its global index.
#define MessageOut()
Macro defining 'message' record of log.
std::vector< unsigned int > elem_permutation_
Vector of element permutations of optimized mesh (see class MeshOptimizer)
virtual std::shared_ptr< std::vector< LongIdx > > check_compatible_mesh(Mesh &input_mesh)
unsigned int elem_idx_
Index of element in Mesh::element_vec_.
unsigned int create_boundary_elements()
Create boundary elements from data of temporary structure, this method MUST be call after read mesh f...
static const Input::Type::Record & get_input_type()
static const unsigned int undef_idx
std::vector< BoundingBox > get_element_boxes()
Compute bounding boxes of elements contained in mesh.
ofstream raw_ngh_output_file
virtual unsigned int n_elements() const
Returns count of boundary or bulk elements.
std::string format(CStringRef format_str, ArgList args)
void create_node_element_lists()
static unsigned int permutation_index(unsigned int p[n_nodes_per_side])
BCMesh * get_bc_mesh()
Create boundary mesh if doesn't exist and return it.
static const Input::Type::Record & get_input_type()
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
double global_snap_radius() const
Maximal distance of observe point from Mesh relative to its size.
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_local_nodes() const
std::vector< EdgeData > edges
Vector of MH edges, this should not be part of the geometrical mesh.
std::string create_label_from_id(unsigned int id) const
vector< vector< vector< unsigned int > > > side_nodes
SideIter side(const unsigned int loc_index)
#define ASSERT(expr)
Allow use shorter versions of macro names if these names is not used with external library...
virtual unsigned int n_nodes() const
vector< BoundaryData > boundary_
Boundary boundary(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.
ArmaVec< Type, nr > vec(uint mat_index) const
std::vector< unsigned int > node_permutation_
Vector of node permutations of optimized mesh (see class MeshOptimizer)
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.
ElementAccessor< 3 > element() const
Returns iterator to the element of the side.
virtual Partitioning * get_part()
NodeAccessor< 3 > node(unsigned int ni) const
virtual ElementAccessor< 3 > element_accessor(unsigned int idx) const
Create and return ElementAccessor to element of given idx.
void check_mesh_on_read()
void init(unsigned int dim, RegionIdx reg)
const unsigned int * get_lsizes_array()
get local sizes array
Armor::Array< double > nodes_
Region get_region(unsigned int id, unsigned int dim)
unsigned int n_vb_neighbours() const
ElementAccessor< 3 > element()
void open_stream(Stream &stream) const
unsigned int edge_idx_
Index of Edge in Mesh.
void read_regions_from_input(Input::Array region_list)
unsigned int boundary_loaded_size_
Count of boundary elements loaded from mesh file.
bool same_sides(const SideIter &si, vector< unsigned int > &side_nodes)
int find_elem_id(unsigned int pos) const
Return element id (in GMSH file) of element of given position in element vector.
unsigned int add_item(T val)
Add new item at the end position of map.
unsigned int node_idx(unsigned int ni) const
Return index (in Mesh::node_vec) of ni-th node.
void check_element_size(unsigned int elem_idx) const
Check if given index is in element_vec_.
IntersectionSearch get_intersection_search()
Getter for input type selection for intersection search algorithm.
Region find_id(unsigned int id, unsigned int dim) const
LongIdx * el_4_loc
Index set assigning to local element index its global index.
unsigned int edge_idx(unsigned int edg_idx) const
Return edge_idx of given index.
friend class RegionSetBase
static const Input::Type::Selection & get_input_intersection_variant()
The definition of input record for selection of variant of file format.
unsigned int n_sides() const
#define START_TIMER(tag)
Starts a timer with specified tag.
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.
BoundingBox bounding_box() const
ArrayMatSet set(uint index)
Region implicit_boundary_region()
virtual Range< ElementAccessor< 3 > > elements_range() const
Returns range of bulk elements.
Element * add_element_to_vector(int id)
Adds element to mesh data structures (element_vec_, element_ids_), returns pointer to this element...
NodeAccessor< 3 > node(unsigned int idx) const
Create and return NodeAccessor to node of given idx.
unsigned int np() const
get num of processors
unsigned int n_sides() const
std::shared_ptr< BIHTree > bih_tree_
void swap(nlohmann::json &j1, nlohmann::json &j2) noexcept(is_nothrow_move_constructible< nlohmann::json >::value andis_nothrow_move_assignable< nlohmann::json >::value)
exchanges the values of two JSON objects
vector< vector< unsigned int > > node_elements_
For each node the vector contains a list of elements that use this node.
void calculate_element_curve_values_as_hilbert_of_centers()
NodeAccessor< 3 > node(unsigned int i) const
Returns node for given local index i on the side.
std::vector< unsigned int > permutation_idx_
void elements_id_maps(vector< LongIdx > &bulk_elements_id, vector< LongIdx > &boundary_elements_id) const
void count_element_types()
bool compare_points(const arma::vec3 &p1, const arma::vec3 &p2)
const BIHTree & get_bih_tree()
Getter for BIH. Creates and compute BIH at first call.
Dedicated class for storing path to input and output files.
unsigned int myp() const
get my processor
void mark_used_region(unsigned int idx)
Support classes for parallel programing.
Region add_region(unsigned int id, const std::string &label, unsigned int dim, const std::string &address="implicit")
vector< Neighbour > vb_neighbours_
int LongIdx
Define type that represents indices of large arrays (elements, nodes, dofs etc.)
Distribution * node_ds_
Parallel distribution of nodes. Depends on elements distribution.
void distribute_nodes()
Fill array node_4_loc_ and create object node_ds_ according to element distribution.
void find_point(const Space< 3 >::Point &point, std::vector< unsigned int > &result_list, bool full_list=false) const
Class represents boundary part of mesh.
#define ASSERT_PTR(ptr)
Definition of assert macro checking non-null pointer (PTR)
bool find_lower_dim_element(vector< unsigned int > &element_list, unsigned int dim, unsigned int &element_idx)
int pid_
Id # of mesh partition.
void print_region_table(std::ostream &stream) const
void intersect_element_lists(vector< unsigned int > const &nodes_list, vector< unsigned int > &intersection_element_list)
void modify_element_ids(const RegionDB::MapElementIDToRegionID &map)
#define WarningOut()
Macro defining 'warning' record of log.
void make_edge_permutations()
#define END_TIMER(tag)
Ends a timer with specified tag.
double tetrahedron_jacobian() const
Class RefElement defines numbering of vertices, sides, calculation of normal vectors etc...
static Input::Type::Abstract & get_input_type()
Range< NodeAccessor< 3 > > node_range() const
Returns range of nodes.
Edge edge(uint edge_idx) const
const LongIdx * get_loc_part() 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.
static const unsigned int undefined_dim
bool is_valid() const
Returns false if the region has undefined/invalid value.
IntersectionSearch
Types of search algorithm for finding intersection candidates.
void element_to_neigh_vb()
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.
unsigned int n_neighs_vb_
of neighbours, V-B type (comp.)
void permute_triangle(unsigned int elm_idx, std::vector< unsigned int > permutation_vec)
Permute nodes of 2D elements of given elm_idx.
void calculate_node_curve_values_as_hilbert()
#define DebugOut()
Macro defining 'debug' record of log.
#define ASSERT_PTR_DBG(ptr)
Definition of assert macro checking non-null pointer (PTR) only for debug mode.
unsigned int idx() const
Return local idx of element in boundary / bulk part of element vector.
#define THROW(whole_exception_expr)
Wrapper for throw. Saves the throwing point.
SideIter side(const unsigned int i) const
Gets side iterator of the i -th side.
void clear()
Clear the content. Do not release memory.
Range< Edge > edge_range() const
Returns range of edges.
Implementation of range helper class.
unsigned int bulk_size_
Count of bulk elements.
std::shared_ptr< Partitioning > part_
void make_neighbours_and_edges()
vector< ElementTmpData > bc_element_tmp_
Hold data of boundary elements during reading mesh (allow to preserve correct order during reading of...
Mesh * mesh_
Pointer to Mesh to which belonged.
#define ASSERT_EQ(a, b)
Definition of comparative assert macro (EQual)
void init_node_vector(unsigned int size)
Initialize node_vec_, set size.
unsigned int id() const
Returns id of the region (using RegionDB)
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.
unsigned int n_nodes() const
Returns number of nodes of the side.
virtual ~Mesh()
Destructor.
unsigned int idx() const
Returns a global index of the region.
#define ASSERT_LT_DBG(a, b)
Definition of comparative assert macro (Less Than) only for debug mode.
std::vector< int > sort_elements(std::vector< unsigned int > &elem_permutation)