Flow123d
3.9.0-be1f591da
|
Internal auxiliary class represents an intersection point of simplex<N> and simplex<M>. More...
#include <compute_intersection.hh>
Public Member Functions | |
IntersectionPointAux () | |
Default constructor. More... | |
~IntersectionPointAux () | |
IntersectionPointAux (const arma::vec::fixed< N+1 > &lcA, const arma::vec::fixed< M+1 > &lcB, unsigned int dim_A=N, unsigned int dim_B=M) | |
Destructor. More... | |
IntersectionPointAux (const IntersectionPointAux< N, M-1 > &IP, unsigned int idx_B) | |
Constructor interpolates the second bary coords of IntersectionPointAux<N,M-1> to IntersectionPointAux<N,M> More... | |
IntersectionPointAux (const IntersectionPointAux< N, M-2 > &IP, unsigned int idx_B) | |
Constructor interpolates the second bary coords of IntersectionPointAux<N,M-2> to IntersectionPointAux<N,M> More... | |
void | clear () |
Resets the object to default values. More... | |
IntersectionPointAux< M, N > | switch_objects () const |
Switches the object A and B. More... | |
Setters. | |
void | set_coordinates (const arma::vec::fixed< N+1 > &lcA, const arma::vec::fixed< M+1 > &lcB) |
Setter for coordinates. More... | |
void | set_topology (unsigned int idx_A, unsigned int dim_A, unsigned int idx_B, unsigned int dim_B) |
Setter for topology data. See description of idx_A_ and dim_A_ . More... | |
void | set_topology_A (unsigned int idx, unsigned int dim_A) |
Sets the topology of object A in Simplex<N>. More... | |
void | set_topology_B (unsigned int idx, unsigned int dim_B) |
Sets the topology of object B in Simplex<M>. More... | |
void | set_result (IntersectionResult result) |
Setter orientation flag. More... | |
Private Attributes | |
arma::vec::fixed< N+1 > | local_bcoords_A_ |
Barycentric coordinates of an IP on simplex<N>. More... | |
arma::vec::fixed< M+1 > | local_bcoords_B_ |
Barycentric coordinates of an IP on simplex<M>. More... | |
unsigned int | idx_A_ |
Local indices of element objects that intersects. More... | |
unsigned int | idx_B_ |
IntersectionResult | result_ |
Intersection result according to Plucker products. More... | |
unsigned int | dim_A_ |
Dimension of the object A of intersection. Equal N , by default. More... | |
unsigned int | dim_B_ |
Dimension of the object B of intersection. Equal M , by default. More... | |
Getters. | |
const arma::vec::fixed< N+1 > & | local_bcoords_A () const |
Returns barycentric coordinates in the Simplex<N>. More... | |
const arma::vec::fixed< M+1 > & | local_bcoords_B () const |
Returns barycentric coordinates in the Simplex<M>. More... | |
unsigned int | dim_A () const |
Returns dimension of object A. More... | |
unsigned int | dim_B () const |
Returns dimension of object B. More... | |
unsigned int | idx_A () const |
Returns the index of Simplex<N>. More... | |
unsigned int | idx_B () const |
Returns the index of Simplex<M>. More... | |
IntersectionResult | result () const |
Result: 0 - negative sign, 1 - positive sign, 2 - degenerate (zero for all sides), 3 - none. More... | |
arma::vec::fixed< 3 > | coords (ElementAccessor< 3 > ele) const |
Computes real coordinates of IP, given the element ele in which IP lies. More... | |
bool | topology_equal (const IntersectionPointAux< N, M > &other) const |
Returns true, if other intersection point has the same topology. More... | |
std::ostream & | operator<< (std::ostream &os, const IntersectionPointAux< N, M > &IP) |
Comparison operator for sorting the IPs in convex hull tracing algorithm. Compares the points by x-coordinate (in case of a tie, compares by y-coordinate). More... | |
Internal auxiliary class represents an intersection point of simplex<N> and simplex<M>.
It contains barycentric coordinates of the point on both simplices. Further, it contains topology information of the intersection point. Namely its orientation (according to Plucker coordinates product), pathologic flag, local indices and dimension of element objects (node/line/triangle). Refered as 'IP' in further documentation.
Definition at line 48 of file compute_intersection.hh.
IntersectionPointAux< N, M >::IntersectionPointAux |
Default constructor.
Definition at line 29 of file intersection_point_aux.cc.
|
inline |
Definition at line 93 of file intersection_point_aux.hh.
IntersectionPointAux< N, M >::IntersectionPointAux | ( | const arma::vec::fixed< N+1 > & | lcA, |
const arma::vec::fixed< M+1 > & | lcB, | ||
unsigned int | dim_A = N , |
||
unsigned int | dim_B = M |
||
) |
Destructor.
Constructor taking barycentric coordinates on simplices as input parameters.
lcA | barycentric coordinates of IP in Simplex<N> |
lcB | barycentric coordinates of IP in Simplex<M> |
dim_A | dimension of object A |
dim_B | dimension of object B |
Definition at line 35 of file intersection_point_aux.cc.
IntersectionPointAux< N, M >::IntersectionPointAux | ( | const IntersectionPointAux< N, M-1 > & | IP, |
unsigned int | idx_B | ||
) |
Constructor interpolates the second bary coords of IntersectionPointAux<N,M-1> to IntersectionPointAux<N,M>
Allowed only from dimension M
1 to 2 and from 2 to 3.
IP | intersection point of lower dimension of object B |
idx_B | is the index of object B of IntersectionPointAux<N,M-1> in object B of IntersectionPointAux<N,M> |
TODO: set correct topology on B. Currently this is done ad hoc after call of this constructor. Problem, dim_B_ can not be used as template parameter. Can we have some variant of interact without template? TODO: done below, but try getting rid of the switch
Definition at line 44 of file intersection_point_aux.cc.
IntersectionPointAux< N, M >::IntersectionPointAux | ( | const IntersectionPointAux< N, M-2 > & | IP, |
unsigned int | idx_B | ||
) |
Constructor interpolates the second bary coords of IntersectionPointAux<N,M-2> to IntersectionPointAux<N,M>
Allowed only from dimension M
1 to 3.
IP | intersection point of lower dimension of object B |
idx_B | is the index of object B of IntersectionPointAux<N,M-2> in object B of IntersectionPointAux<N,M> |
Definition at line 82 of file intersection_point_aux.cc.
void IntersectionPointAux< N, M >::clear |
Resets the object to default values.
Definition at line 18 of file intersection_point_aux.cc.
arma::vec::fixed< 3 > IntersectionPointAux< N, M >::coords | ( | ElementAccessor< 3 > | ele | ) | const |
Computes real coordinates of IP, given the element ele
in which IP lies.
Definition at line 112 of file intersection_point_aux.cc.
unsigned int IntersectionPointAux< N, M >::dim_A |
Returns dimension of object A.
The dimension of the X-face the IP lies on within the A Simplex<N>. E.g. IP on and edge of tetrahedra (N=3) have dim_A = 1.
Definition at line 213 of file intersection_point_aux.hh.
unsigned int IntersectionPointAux< N, M >::dim_B |
Returns dimension of object B.
Same for the B Simplex<M>.
Definition at line 217 of file intersection_point_aux.hh.
unsigned int IntersectionPointAux< N, M >::idx_A |
Returns the index of Simplex<N>.
Index of the X-face of the simplex A.
Definition at line 239 of file intersection_point_aux.hh.
unsigned int IntersectionPointAux< N, M >::idx_B |
Returns the index of Simplex<M>.
Index of the X-face of the simplex B.
Definition at line 243 of file intersection_point_aux.hh.
const arma::vec::fixed< N+1 > & IntersectionPointAux< N, M >::local_bcoords_A |
Returns barycentric coordinates in the Simplex<N>.
Definition at line 221 of file intersection_point_aux.hh.
const arma::vec::fixed< M+1 > & IntersectionPointAux< N, M >::local_bcoords_B |
Returns barycentric coordinates in the Simplex<M>.
Definition at line 225 of file intersection_point_aux.hh.
IntersectionResult IntersectionPointAux< N, M >::result |
Result: 0 - negative sign, 1 - positive sign, 2 - degenerate (zero for all sides), 3 - none.
Returns the orientation.
Definition at line 247 of file intersection_point_aux.hh.
void IntersectionPointAux< N, M >::set_coordinates | ( | const arma::vec::fixed< N+1 > & | lcA, |
const arma::vec::fixed< M+1 > & | lcB | ||
) |
Setter for coordinates.
lcA | braycentric coordinates of A |
lcB | braycentric coordinates of B |
Definition at line 196 of file intersection_point_aux.hh.
void IntersectionPointAux< N, M >::set_result | ( | IntersectionResult | result | ) |
Setter orientation flag.
Definition at line 209 of file intersection_point_aux.hh.
void IntersectionPointAux< N, M >::set_topology | ( | unsigned int | idx_A, |
unsigned int | dim_A, | ||
unsigned int | idx_B, | ||
unsigned int | dim_B | ||
) |
Setter for topology data. See description of idx_A_
and dim_A_
.
Definition at line 201 of file intersection_point_aux.hh.
void IntersectionPointAux< N, M >::set_topology_A | ( | unsigned int | idx, |
unsigned int | dim_A | ||
) |
Sets the topology of object A in Simplex<N>.
Definition at line 229 of file intersection_point_aux.hh.
void IntersectionPointAux< N, M >::set_topology_B | ( | unsigned int | idx, |
unsigned int | dim_B | ||
) |
Sets the topology of object B in Simplex<M>.
Definition at line 234 of file intersection_point_aux.hh.
IntersectionPointAux< M, N > IntersectionPointAux< N, M >::switch_objects |
Switches the object A and B.
Definition at line 101 of file intersection_point_aux.cc.
bool IntersectionPointAux< N, M >::topology_equal | ( | const IntersectionPointAux< N, M > & | other | ) | const |
Returns true, if other
intersection point has the same topology.
Definition at line 133 of file intersection_point_aux.cc.
|
friend |
Comparison operator for sorting the IPs in convex hull tracing algorithm. Compares the points by x-coordinate (in case of a tie, compares by y-coordinate).
Friend output operator.
|
private |
Dimension of the object A of intersection. Equal N
, by default.
Definition at line 87 of file intersection_point_aux.hh.
|
private |
Dimension of the object B of intersection. Equal M
, by default.
Definition at line 88 of file intersection_point_aux.hh.
|
private |
Local indices of element objects that intersects.
Can be indices of point (vertex), lines (edge), triangle (side) in intersecting element, depending on the dimensions dim_A_
, resp. dim_B_
.
Examples: dim_A=0, N=2 -> idx_A is local node index of triangle dim_B=2, N=3 -> idx_B is local side index of tetrahedron dim_B=1, N=3 -> idx_B is local line index of tetrahedron
Definition at line 74 of file intersection_point_aux.hh.
|
private |
Definition at line 75 of file intersection_point_aux.hh.
|
private |
Barycentric coordinates of an IP on simplex<N>.
Definition at line 60 of file intersection_point_aux.hh.
|
private |
Barycentric coordinates of an IP on simplex<M>.
Definition at line 61 of file intersection_point_aux.hh.
|
private |
Intersection result according to Plucker products.
All Plucker products > 0 then positive. All Plucker products < 0 then negative. degenerate case. none - no intersection.
Definition at line 85 of file intersection_point_aux.hh.