Flow123d  JS_before_hm-989-g79825ac
Classes | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
InspectElementsAlgorithm< dim > Class Template Reference

Class implements algorithm for dim-dimensional intersections with 3D elements. More...

#include <inspect_elements_algorithm.hh>

Inheritance diagram for InspectElementsAlgorithm< dim >:
Inheritance graph
[legend]
Collaboration diagram for InspectElementsAlgorithm< dim >:
Collaboration graph
[legend]

Classes

struct  Prolongation
 Auxiliary structure for prolongation process. More...
 

Public Member Functions

 InspectElementsAlgorithm (Mesh *_mesh)
 
 ~InspectElementsAlgorithm ()
 
Algorithms

Runs the core algorithm for computing dimD-3D intersection.

void compute_intersections (const BIHTree &bih)
 Uses BIHtree to find the initial candidate of a component and then prolongates the component intersetion. More...
 
void compute_intersections_BIHtree (const BIHTree &bih)
 Uses only BIHtree to find intersection candidates. (No prolongation). More...
 
void compute_intersections_BB ()
 
- Public Member Functions inherited from IntersectionAlgorithmBase< dim, 3 >
 IntersectionAlgorithmBase (Mesh *mesh)
 

Private Member Functions

void init ()
 
void compute_bounding_boxes ()
 Computes bounding boxes of all elements. Fills elements_bb and mesh_3D_bb. More...
 
void assert_same_intersection (unsigned int comp_ele_idx, unsigned int bulk_ele_idx)
 
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, or not. More...
 
bool compute_initial_CI (const ElementAccessor< 3 > &comp_ele, const ElementAccessor< 3 > &bulk_ele)
 Computes the first intersection, from which we then prolongate. More...
 
void prolongation_decide (const ElementAccessor< 3 > &comp_ele, const ElementAccessor< 3 > &bulk_ele, IntersectionAux< dim, 3 > &is)
 
void prolongate (const Prolongation &pr)
 Computes the intersection for a candidate in a queue and calls prolongation_decide again. More...
 
template<unsigned int ele_dim>
std::vector< unsigned int > get_element_neighbors (const ElementAccessor< 3 > &ele, unsigned int ip_dim, unsigned int ip_obj_idx)
 
unsigned int create_prolongation (unsigned int bulk_ele_idx, unsigned int component_ele_idx, std::queue< Prolongation > &queue)
 

Private Attributes

unsigned int n_intersections_
 Counter for intersection among elements. More...
 
std::queue< Prolongationcomponent_queue_
 Prolongation queue in the component mesh. More...
 
std::queue< Prolongationbulk_queue_
 Prolongation queue in the bulk mesh. More...
 
std::vector< bool > closed_elements
 
std::vector< unsigned int > last_slave_for_3D_elements
 
std::vector< BoundingBoxelements_bb
 Elements bounding boxes. More...
 
BoundingBox mesh_3D_bb
 Bounding box of all 3D elements. More...
 
std::vector< std::vector< IntersectionAux< dim, 3 > > > intersection_list_
 Resulting vector of intersections. More...
 

Friends

class MixedMeshIntersections
 

Additional Inherited Members

- Protected Attributes inherited from IntersectionAlgorithmBase< dim, 3 >
Meshmesh
 Auxiliary function that translates ElementAccessor<3> to Simplex<simplex_dim>. More...
 
const unsigned int undefined_elm_idx_
 

Detailed Description

template<unsigned int dim>
class InspectElementsAlgorithm< dim >

Class implements algorithm for dim-dimensional intersections with 3D elements.

dim-D elements that are continuously neighbouring are called component elements. 3D elements are called bulk elements.

Implements the initialization routine, that finds the first candidate for intersection. It uses bounding boxes to fastly resolve intersection candidates. We call elements whose bounding boxes are intersecting 'candidates'.

Finding first candidate:

Implements prolongation algorithm that recursively searches neighbouring elements for next intersection candidates. The candidates – neighbouring component elements and bulk elements – are pushed into separate queues. The bulk elements queue is emptied at first, then the component elements queue is popped.

The recuring prolongation algorithm is as follows: Function prolongation_decide fills the queues. A candidate pair of elements is popped out of a queue. Function prolongate computes intersection for a candidate pair and calls prolongation_decide again. This is done in an infinite cycle, until both queues are empty.

Three algorithms are implemented:

 - BIH only: creates BIH, uses BIH to search through all elements to find candidates
 - BIH search: creates BIH, uses BIH to find only first candidates of components; then uses prolongation
 - BB search: does not create BIH, uses bounding boxes to search through all elements to find candidates

Due to optimal tracing algorithm for 2d-3d, we consider tetrahedron only with positive Jacobian. This is checked in assert.

TODO: check unit test prolongation 13d, because it has different results for BIH only and BB search

Definition at line 98 of file inspect_elements_algorithm.hh.

Constructor & Destructor Documentation

template<unsigned int dim>
InspectElementsAlgorithm< dim >::InspectElementsAlgorithm ( Mesh _mesh)

Definition at line 45 of file inspect_elements_algorithm.cc.

template<unsigned int dim>
InspectElementsAlgorithm< dim >::~InspectElementsAlgorithm ( )

Definition at line 51 of file inspect_elements_algorithm.cc.

Member Function Documentation

template<unsigned int dim>
void InspectElementsAlgorithm< dim >::assert_same_intersection ( unsigned int  comp_ele_idx,
unsigned int  bulk_ele_idx 
)
private
template<unsigned int dim>
void InspectElementsAlgorithm< dim >::compute_bounding_boxes ( )
private

Computes bounding boxes of all elements. Fills elements_bb and mesh_3D_bb.

Definition at line 68 of file inspect_elements_algorithm.cc.

Here is the caller graph for this function:

template<unsigned int dim>
bool InspectElementsAlgorithm< dim >::compute_initial_CI ( const ElementAccessor< 3 > &  comp_ele,
const ElementAccessor< 3 > &  bulk_ele 
)
private

Computes the first intersection, from which we then prolongate.

Definition at line 93 of file inspect_elements_algorithm.cc.

Here is the caller graph for this function:

template<unsigned int dim>
void InspectElementsAlgorithm< dim >::compute_intersections ( const BIHTree bih)

Uses BIHtree to find the initial candidate of a component and then prolongates the component intersetion.

Definition at line 142 of file inspect_elements_algorithm.cc.

Here is the caller graph for this function:

template<unsigned int dim>
void InspectElementsAlgorithm< dim >::compute_intersections_BB ( )

Tests bounding boxes intersectioss to find the initial candidate of a component and then prolongates the component intersetion. (No BIHtree).

Definition at line 327 of file inspect_elements_algorithm.cc.

Here is the caller graph for this function:

template<unsigned int dim>
void InspectElementsAlgorithm< dim >::compute_intersections_BIHtree ( const BIHTree bih)

Uses only BIHtree to find intersection candidates. (No prolongation).

Definition at line 269 of file inspect_elements_algorithm.cc.

Here is the caller graph for this function:

template<unsigned int dim>
unsigned int InspectElementsAlgorithm< dim >::create_prolongation ( unsigned int  bulk_ele_idx,
unsigned int  component_ele_idx,
std::queue< Prolongation > &  queue 
)
private

Definition at line 513 of file inspect_elements_algorithm.cc.

Here is the caller graph for this function:

template<unsigned int dim>
template<unsigned int ele_dim>
std::vector< unsigned int > InspectElementsAlgorithm< dim >::get_element_neighbors ( const ElementAccessor< 3 > &  ele,
unsigned int  ip_dim,
unsigned int  ip_obj_idx 
)
private

Definition at line 454 of file inspect_elements_algorithm.cc.

template<unsigned int dim>
void InspectElementsAlgorithm< dim >::init ( )
private

Initialization. Sets vector sizes and computes bulk bounding box.

Definition at line 57 of file inspect_elements_algorithm.cc.

Here is the caller graph for this function:

template<unsigned int dim>
bool InspectElementsAlgorithm< dim >::intersection_exists ( unsigned int  component_ele_idx,
unsigned int  bulk_ele_idx 
)
private

A hard way to find whether the intersection of two elements has already been computed, or not.

Definition at line 120 of file inspect_elements_algorithm.cc.

Here is the caller graph for this function:

template<unsigned int dim>
void InspectElementsAlgorithm< dim >::prolongate ( const Prolongation pr)
private

Computes the intersection for a candidate in a queue and calls prolongation_decide again.

Definition at line 657 of file inspect_elements_algorithm.cc.

Here is the caller graph for this function:

template<unsigned int dim>
void InspectElementsAlgorithm< dim >::prolongation_decide ( const ElementAccessor< 3 > &  comp_ele,
const ElementAccessor< 3 > &  bulk_ele,
IntersectionAux< dim, 3 > &  is 
)
private

Finds neighbouring elements that are new candidates for intersection and pushes them into component queue or bulk queue.

Definition at line 539 of file inspect_elements_algorithm.cc.

Here is the caller graph for this function:

Friends And Related Function Documentation

template<unsigned int dim>
friend class MixedMeshIntersections
friend

Definition at line 188 of file inspect_elements_algorithm.hh.

Member Data Documentation

template<unsigned int dim>
std::queue<Prolongation> InspectElementsAlgorithm< dim >::bulk_queue_
private

Prolongation queue in the bulk mesh.

Definition at line 139 of file inspect_elements_algorithm.hh.

template<unsigned int dim>
std::vector<bool> InspectElementsAlgorithm< dim >::closed_elements
private

Definition at line 142 of file inspect_elements_algorithm.hh.

template<unsigned int dim>
std::queue<Prolongation> InspectElementsAlgorithm< dim >::component_queue_
private

Prolongation queue in the component mesh.

Definition at line 137 of file inspect_elements_algorithm.hh.

template<unsigned int dim>
std::vector<BoundingBox> InspectElementsAlgorithm< dim >::elements_bb
private

Elements bounding boxes.

Definition at line 146 of file inspect_elements_algorithm.hh.

template<unsigned int dim>
std::vector<std::vector<IntersectionAux<dim,3> > > InspectElementsAlgorithm< dim >::intersection_list_
private

Resulting vector of intersections.

Definition at line 151 of file inspect_elements_algorithm.hh.

template<unsigned int dim>
std::vector<unsigned int> InspectElementsAlgorithm< dim >::last_slave_for_3D_elements
private

Definition at line 143 of file inspect_elements_algorithm.hh.

template<unsigned int dim>
BoundingBox InspectElementsAlgorithm< dim >::mesh_3D_bb
private

Bounding box of all 3D elements.

Definition at line 148 of file inspect_elements_algorithm.hh.

template<unsigned int dim>
unsigned int InspectElementsAlgorithm< dim >::n_intersections_
private

Counter for intersection among elements.

Definition at line 134 of file inspect_elements_algorithm.hh.


The documentation for this class was generated from the following files: