20 #ifndef INSPECT_ELEMENTS_ALGORITHM_H_
21 #define INSPECT_ELEMENTS_ALGORITHM_H_
41 typedef std::pair<unsigned int, IntersectionLocalBase*>
ILpair;
43 template<
unsigned int dimA,
unsigned int dimB>
97 template<
unsigned int dim>
176 template<
unsigned int ele_dim>
179 unsigned int ip_obj_idx);
185 unsigned int component_ele_idx,
186 std::queue<Prolongation>& queue);
Class for O(log N) lookup for intersections with a set of bounding boxes.
Bounding box in 3d ambient space.
Implements algorithm for finding 1D-2D intersections.
void compute_intersections_3(std::vector< std::vector< ILpair >> &intersection_map, std::vector< IntersectionLocal< 1, 2 >> &storage)
Runs the algorithm (3): compute 1D-2D intersection inside 3D mesh. It directly fills the intersection...
void compute_intersections_1(const BIHTree &bih)
Runs the algorithm (1): compute 1D-2D intersection in 2D plane. BIH is used to find intersection cand...
std::vector< IntersectionAux< 1, 2 > > intersectionaux_storage12_
Stores temporarily 1D-2D intersections.
InspectElementsAlgorithm12(Mesh *input_mesh)
void compute_intersections_2(const BIHTree &bih)
Runs the algorithm (2): compute 1D-2D intersection in 3D ambient space BIH is used to find intersecti...
Implements algorithm for finding 2D-2D intersections.
std::vector< IntersectionAux< 2, 2 > > intersectionaux_storage22_
Stores temporarily 2D-2D intersections.
std::vector< unsigned int > component_idx_
InspectElementsAlgorithm22(Mesh *input_mesh)
void compute_single_intersection(const ElementAccessor< 3 > &eleA, const ElementAccessor< 3 > &eleB, std::vector< IntersectionLocal< 2, 2 >> &storage)
Computes fundamental intersection of two 2D elements.
void create_component_numbering()
Creates numbering of the 2D components and fills component_idx_ vector.
unsigned int component_counter_
const unsigned int unset_comp
void compute_intersections(std::vector< std::vector< ILpair >> &intersection_map, std::vector< IntersectionLocal< 2, 2 >> &storage)
Runs the core algorithm for computing 2D-2D intersection in 3D.
Class implements algorithm for dim-dimensional intersections with 3D elements.
void compute_intersections_BB()
std::vector< bool > closed_elements
bool intersection_exists(unsigned int component_ele_idx, unsigned int bulk_ele_idx)
A hard way to find whether the intersection of two elements has already been computed,...
unsigned int create_prolongation(unsigned int bulk_ele_idx, unsigned int component_ele_idx, std::queue< Prolongation > &queue)
std::vector< BoundingBox > elements_bb
Elements bounding boxes.
std::queue< Prolongation > component_queue_
Prolongation queue in the component mesh.
~InspectElementsAlgorithm()
InspectElementsAlgorithm(Mesh *_mesh)
void assert_same_intersection(unsigned int comp_ele_idx, unsigned int bulk_ele_idx)
void prolongate(const Prolongation &pr)
Computes the intersection for a candidate in a queue and calls prolongation_decide again.
std::vector< unsigned int > get_element_neighbors(const ElementAccessor< 3 > &ele, unsigned int ip_dim, unsigned int ip_obj_idx)
BoundingBox mesh_3D_bb
Bounding box of all 3D elements.
void compute_intersections(const BIHTree &bih)
Uses BIHtree to find the initial candidate of a component and then prolongates the component interset...
unsigned int n_intersections_
Counter for intersection among elements.
void prolongation_decide(const ElementAccessor< 3 > &comp_ele, const ElementAccessor< 3 > &bulk_ele, IntersectionAux< dim, 3 > is)
void compute_bounding_boxes()
Computes bounding boxes of all elements. Fills elements_bb and mesh_3D_bb.
bool compute_initial_CI(const ElementAccessor< 3 > &comp_ele, const ElementAccessor< 3 > &bulk_ele)
Computes the first intersection, from which we then prolongate.
std::vector< unsigned int > last_slave_for_3D_elements
std::vector< std::vector< IntersectionAux< dim, 3 > > > intersection_list_
Resulting vector of intersections.
std::queue< Prolongation > bulk_queue_
Prolongation queue in the bulk mesh.
void compute_intersections_BIHtree(const BIHTree &bih)
Uses only BIHtree to find intersection candidates. (No prolongation).
Mesh * mesh
Auxiliary function that translates ElementAccessor<3> to Simplex<simplex_dim>.
const unsigned int undefined_elm_idx_
IntersectionAlgorithmBase(Mesh *mesh)
Internal auxiliary class representing intersection object of simplex<dimA> and simplex<dimB>.
Common base for intersection object.
Class represents intersection of two elements.
Internal auxiliary class represents an intersection point of simplex<N> and simplex<M>.
Main class for computation of intersection of meshes of combined dimensions.
std::pair< unsigned int, IntersectionLocalBase * > ILpair
First = element index, Second = pointer to intersection object.
Auxiliary structure for prolongation process.
unsigned int dictionary_idx
unsigned int component_elm_idx