Flow123d
release_3.0.0-1191-g7740876
|
Class for 1D-2D intersections. More...
#include <compute_intersection.hh>
Public Types | |
typedef IntersectionPointAux< 1, 2 > | IPAux12 |
Public Member Functions | |
ComputeIntersection () | |
Default constructor. Use when this is NOT final intersection object. More... | |
ComputeIntersection (ElementAccessor< 3 > abscissa, ElementAccessor< 3 > 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 (IPAux12 &IP) |
Computes intersection points of line and triangle. More... | |
unsigned int | compute_final (std::vector< IPAux12 > &IP12s) |
unsigned int | compute_final_in_plane (std::vector< IPAux12 > &IP12s) |
int | check_abscissa_topology (IPAux12 &IP) |
void | print_plucker_coordinates (std::ostream &os) |
Prints out all the Plucker coordinates. More... | |
void | clear_all () |
Setters and Getters | |
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 (IPAux12 &IP, const arma::vec3 &local) |
Computes intersection when nonezero Plucker products are of the same sign. More... | |
bool | compute_degenerate (unsigned int side_idx, IPAux12 &IP) |
void | correct_triangle_ip_topology (double t, unsigned int i, std::vector< IPAux12 > &ip) |
After interpolation, the topology information in tetrahedron must be updated. More... | |
Private Attributes | |
bool | computed_ |
Flag 'computed'; is true if intersection has been computed already. More... | |
double | scale_line_ |
double | scale_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 67 of file compute_intersection.hh.
typedef IntersectionPointAux<1,2> ComputeIntersection< 1, 2 >::IPAux12 |
Definition at line 69 of file compute_intersection.hh.
ComputeIntersection< 1, 2 >::ComputeIntersection | ( | ) |
Default constructor. Use when this is NOT final intersection object.
Definition at line 21 of file compute_intersection.cc.
ComputeIntersection< 1, 2 >::ComputeIntersection | ( | ElementAccessor< 3 > | abscissa, |
ElementAccessor< 3 > | 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 30 of file compute_intersection.cc.
ComputeIntersection< 1, 2 >::~ComputeIntersection | ( | ) |
Definition at line 55 of file compute_intersection.cc.
int ComputeIntersection< 1, 2 >::check_abscissa_topology | ( | IPAux12 & | IP | ) |
Checks the position of IP on abscissa, possibly changes topology to end points. Returns -2, -1, 0, 1, 2; -1. 0 - inside abscissa -2, 2 - outside of abscissa -1, 1 - end points
Definition at line 103 of file compute_intersection.cc.
void ComputeIntersection< 1, 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 69 of file compute_intersection.cc.
IntersectionResult ComputeIntersection< 1, 2 >::compute | ( | IPAux12 & | IP | ) |
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 187 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 299 of file compute_intersection.cc.
unsigned int ComputeIntersection< 1, 2 >::compute_final | ( | std::vector< IPAux12 > & | 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 273 of file compute_intersection.cc.
unsigned int ComputeIntersection< 1, 2 >::compute_final_in_plane | ( | std::vector< IPAux12 > & | IP12s | ) |
Computes final 1d-2d intersection, supposing situation in 2d plane (only degenerate case). (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 411 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 123 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 79 of file compute_intersection.cc.
|
private |
After interpolation, the topology information in tetrahedron must be updated.
ip | intersection point to be corrected |
TODO:
Definition at line 479 of file compute_intersection.cc.
|
inline |
Gets the pointer to Plucker coordinates of the abscissa.
Definition at line 128 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 135 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 150 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 154 of file compute_intersection.hh.
void ComputeIntersection< 1, 2 >::print_plucker_coordinates | ( | std::ostream & | os | ) |
Prints out all the Plucker coordinates.
Definition at line 514 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 156 of file compute_intersection.hh.
|
inline |
Sets the pointer to Plucker coordinates of the abscissa.
Definition at line 115 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 123 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 143 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 186 of file compute_intersection.hh.
|
private |
Flag 'computed'; is true if intersection has been computed already.
Definition at line 210 of file compute_intersection.hh.
|
private |
Pointer to plucker coordinates of abscissa.
Definition at line 215 of file compute_intersection.hh.
|
private |
Vector of pointers to plucker coordinates of triangle sides.
Definition at line 217 of file compute_intersection.hh.
|
private |
Pointers to Plucker products of abscissa and triangle side.
Definition at line 219 of file compute_intersection.hh.
|
private |
Definition at line 212 of file compute_intersection.hh.
|
private |
Definition at line 212 of file compute_intersection.hh.