Flow123d
release_2.2.0-914-gf1a3a4f
|
Class for 1D-2D intersections. More...
#include <compute_intersection.hh>
Public Member Functions | |
ComputeIntersection () | |
Default constructor. Use when this is NOT final intersection object. More... | |
ComputeIntersection (Simplex< 1 > &abscissa, Simplex< 2 > &triangle, Mesh *mesh) | |
Constructor, sets abscissa and triangle object. Use when this is final intersection object. It allocates memory, computes plucker coordinates and products. More... | |
~ComputeIntersection () | |
IntersectionResult | compute (std::vector< IntersectionPointAux< 1, 2 >> &IP12s) |
Computes intersection points of line and triangle. More... | |
unsigned int | compute_final (std::vector< IntersectionPointAux< 1, 2 >> &IP12s) |
void | print_plucker_coordinates (std::ostream &os) |
Prints out all the Plucker coordinates. More... | |
void | clear_all () |
Setters and Getters | |
void | set_data (Simplex< 1 > &abscissa, Simplex< 2 > &triangle) |
Sets the abscissa and triangle. More... | |
void | set_pc_abscissa (Plucker *p) |
Sets the pointer to Plucker coordinates of the abscissa. More... | |
void | set_pc_triangle (Plucker *p, unsigned int side_idx) |
Sets the pointer to Plucker coordinates of the triangle side. More... | |
Plucker * | get_pc_abscissa () |
Gets the pointer to Plucker coordinates of the abscissa. More... | |
Plucker * | get_pc_triangle (unsigned int side_idx) |
Gets the pointer to Plucker coordinates of the triangle side. More... | |
void | set_plucker_product (double *number, unsigned int side_idx) |
Sets the Plucker product of abscissa and triangle side (use if computed before). More... | |
double * | get_plucker_product (unsigned int side_idx) |
Getter for Plucker product of abscissa and triangle side. More... | |
bool | is_computed () |
Gets true if the intersection has been computed already (e.g. in case of IP in vertex). More... | |
void | set_computed () |
Sets the 'computed' flag true. Means that intersection has been computed already (e.g. in case of IP in vertex). More... | |
Private Member Functions | |
void | compute_plucker_products () |
double | signed_plucker_product (unsigned int i) |
bool | compute_plucker (IntersectionPointAux< 1, 2 > &IP, const arma::vec3 &local) |
Computes intersection when nonezero Plucker products are of the same sign. More... | |
bool | compute_degenerate (unsigned int side_idx, IntersectionPointAux< 1, 2 > &IP) |
Private Attributes | |
bool | computed_ |
Flag 'computed'; is true if intersection has been computed already. More... | |
double | scale_line_ |
double | scale_triangle_ |
Simplex< 1 > * | abscissa_ |
Simplex< 2 > * | triangle_ |
Plucker * | plucker_coordinates_abscissa_ |
Pointer to plucker coordinates of abscissa. More... | |
std::vector< Plucker * > | plucker_coordinates_triangle_ |
Vector of pointers to plucker coordinates of triangle sides. More... | |
std::vector< double * > | plucker_products_ |
Pointers to Plucker products of abscissa and triangle side. More... | |
Class for 1D-2D intersections.
Computes the intersection of an abscissa and a triangle. Can be used both as sub-algorithm to higher dimnesional intersection and also for 1D-2D intersection as a result.
Definition at line 65 of file compute_intersection.hh.
ComputeIntersection< Simplex< 1 >, Simplex< 2 > >::ComputeIntersection | ( | ) |
Default constructor. Use when this is NOT final intersection object.
Definition at line 20 of file compute_intersection.cc.
ComputeIntersection< Simplex< 1 >, Simplex< 2 > >::ComputeIntersection | ( | Simplex< 1 > & | abscissa, |
Simplex< 2 > & | triangle, | ||
Mesh * | mesh | ||
) |
Constructor, sets abscissa and triangle object. Use when this is final intersection object. It allocates memory, computes plucker coordinates and products.
Definition at line 28 of file compute_intersection.cc.
ComputeIntersection< Simplex< 1 >, Simplex< 2 > >::~ComputeIntersection | ( | ) |
Definition at line 46 of file compute_intersection.cc.
void ComputeIntersection< Simplex< 1 >, Simplex< 2 > >::clear_all | ( | ) |
Resets Plucker products to 'nullptr'. Use this CAREFULLY as it does not destroy the objects. It is intended to be used only from higher dimensions when before destroying.
Definition at line 60 of file compute_intersection.cc.
IntersectionResult ComputeIntersection< Simplex< 1 >, Simplex< 2 > >::compute | ( | std::vector< IntersectionPointAux< 1, 2 >> & | IP12s | ) |
Computes intersection points of line and triangle.
If Plucker products are non-zero and with the same sign, then IP is inside the triangle. If some of the Plucker products are zero: 1 zero product -> IP is on the triangle side 2 zero products -> IP is at the vertex of triangle (there is no other IP) 3 zero products: -> line and triangle are coplanar
IP is intersection of triangle and whole line (bisector).
IP12s | - input/output vector of IPs. If IP found, it is pushed back. Should be empty on start. |
NOTE: Why this is not done in constructor? Because default constructor is called in 1d-3d, 2d-3d and compute() is called later.
Definition at line 293 of file compute_intersection.cc.
|
private |
Computes intersection of abscissa and triangle side in degenerate case (all products are zero). Inspects also topology.
side_idx | is the local index of the triangle side |
IP | is the intersection point (if found) |
Definition at line 181 of file compute_intersection.cc.
unsigned int ComputeIntersection< Simplex< 1 >, Simplex< 2 > >::compute_final | ( | std::vector< IntersectionPointAux< 1, 2 >> & | IP12s | ) |
Computes final 1d-2d intersection. (Use when this is the resulting dimension object).
IP12s | input/output vector of IPs. If IP found, it is pushed back. Should be empty on start. |
Definition at line 380 of file compute_intersection.cc.
|
private |
Computes intersection when nonezero Plucker products are of the same sign.
IP | intersection point (if found) |
local | local coordinates of IP (got from Plucker products) |
Definition at line 107 of file compute_intersection.cc.
|
private |
Computes Plucker coordinates (abscissa, triangle lines) and Plucker products, if not computed already, or set from outside.
Definition at line 70 of file compute_intersection.cc.
|
inline |
Gets the pointer to Plucker coordinates of the abscissa.
Definition at line 125 of file compute_intersection.hh.
|
inline |
Gets the pointer to Plucker coordinates of the triangle side.
side_idx | local index of a side of triangle |
Definition at line 132 of file compute_intersection.hh.
|
inline |
Getter for Plucker product of abscissa and triangle side.
side_idx | local index of a side of triangle |
Definition at line 147 of file compute_intersection.hh.
|
inline |
Gets true if the intersection has been computed already (e.g. in case of IP in vertex).
Definition at line 151 of file compute_intersection.hh.
void ComputeIntersection< Simplex< 1 >, Simplex< 2 > >::print_plucker_coordinates | ( | std::ostream & | os | ) |
Prints out all the Plucker coordinates.
Definition at line 437 of file compute_intersection.cc.
|
inline |
Sets the 'computed' flag true. Means that intersection has been computed already (e.g. in case of IP in vertex).
Definition at line 153 of file compute_intersection.hh.
void ComputeIntersection< Simplex< 1 >, Simplex< 2 > >::set_data | ( | Simplex< 1 > & | abscissa, |
Simplex< 2 > & | triangle | ||
) |
Sets the abscissa and triangle.
Use mostly when this is not final intersection computation.
abscissa | intersecting line |
triangle | intersecting triangle |
Definition at line 99 of file compute_intersection.cc.
|
inline |
Sets the pointer to Plucker coordinates of the abscissa.
Definition at line 112 of file compute_intersection.hh.
|
inline |
Sets the pointer to Plucker coordinates of the triangle side.
p | pointer to Plucker coordinates |
side_idx | local index of a side of triangle |
Definition at line 120 of file compute_intersection.hh.
|
inline |
Sets the Plucker product of abscissa and triangle side (use if computed before).
value | value of the Plucker product |
side_idx | local index of a side of triangle |
Definition at line 140 of file compute_intersection.hh.
|
inlineprivate |
Auxiliary function providing correctly signed Plucker product according to the triangle side orientation.
i | local index of a side of triangle. |
Definition at line 175 of file compute_intersection.hh.
|
private |
Definition at line 198 of file compute_intersection.hh.
|
private |
Flag 'computed'; is true if intersection has been computed already.
Definition at line 194 of file compute_intersection.hh.
|
private |
Pointer to plucker coordinates of abscissa.
Definition at line 202 of file compute_intersection.hh.
|
private |
Vector of pointers to plucker coordinates of triangle sides.
Definition at line 204 of file compute_intersection.hh.
|
private |
Pointers to Plucker products of abscissa and triangle side.
Definition at line 206 of file compute_intersection.hh.
|
private |
Definition at line 196 of file compute_intersection.hh.
|
private |
Definition at line 196 of file compute_intersection.hh.
|
private |
Definition at line 199 of file compute_intersection.hh.