Flow123d  release_3.0.0-1150-g11be08a
Public Member Functions | Private Attributes | Friends | List of all members
IntersectionPointAux< N, M > Class Template Reference

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...
 
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...
 
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...
 
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
 
IntersectionResult result () const
 Result: 0 - negative sign, 1 - positive sign, 2 - degenerate (zero for all sides), 3 - none. 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...
 
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...
 
unsigned int idx_A_
 Local indices of element objects that intersects. More...
 
unsigned int idx_B_
 

Friends

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...
 

Detailed Description

template<unsigned int N, unsigned int M>
class IntersectionPointAux< N, M >

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 50 of file compute_intersection.hh.

Constructor & Destructor Documentation

template<unsigned int N, unsigned int M>
IntersectionPointAux< N, M >::IntersectionPointAux ( )

Default constructor.

Definition at line 30 of file intersection_point_aux.cc.

template<unsigned int N, unsigned int M>
IntersectionPointAux< N, M >::~IntersectionPointAux ( )
inline

Definition at line 93 of file intersection_point_aux.hh.

template<unsigned int N, unsigned int M>
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.

Parameters
lcAbarycentric coordinates of IP in Simplex<N>
lcBbarycentric coordinates of IP in Simplex<M>
dim_Adimension of object A
dim_Bdimension of object B

Definition at line 36 of file intersection_point_aux.cc.

template<unsigned int N, unsigned int M>
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.

Parameters
IPintersection point of lower dimension of object B
idx_Bis 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 45 of file intersection_point_aux.cc.

template<unsigned int N, unsigned int M>
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.

Parameters
IPintersection point of lower dimension of object B
idx_Bis the index of object B of IntersectionPointAux<N,M-2> in object B of IntersectionPointAux<N,M>

Definition at line 83 of file intersection_point_aux.cc.

Member Function Documentation

template<unsigned int N, unsigned int M>
void IntersectionPointAux< N, M >::clear ( )

Resets the object to default values.

Definition at line 19 of file intersection_point_aux.cc.

template<unsigned int N, unsigned int M>
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 113 of file intersection_point_aux.cc.

template<unsigned int N, unsigned int M>
unsigned int IntersectionPointAux< N, M >::dim_A ( ) const

Returns dimension of object A.

Definition at line 199 of file intersection_point_aux.hh.

Here is the caller graph for this function:

template<unsigned int N, unsigned int M>
unsigned int IntersectionPointAux< N, M >::dim_B ( ) const

Returns dimension of object B.

Definition at line 203 of file intersection_point_aux.hh.

Here is the caller graph for this function:

template<unsigned int N, unsigned int M>
unsigned int IntersectionPointAux< N, M >::idx_A ( ) const

Returns the index of Simplex<N>.

Definition at line 225 of file intersection_point_aux.hh.

Here is the caller graph for this function:

template<unsigned int N, unsigned int M>
unsigned int IntersectionPointAux< N, M >::idx_B ( ) const

Returns the index of Simplex<M>.

Definition at line 229 of file intersection_point_aux.hh.

Here is the caller graph for this function:

template<unsigned int N, unsigned int M>
const arma::vec::fixed< N+1 > & IntersectionPointAux< N, M >::local_bcoords_A ( ) const

Returns barycentric coordinates in the Simplex<N>.

Definition at line 207 of file intersection_point_aux.hh.

Here is the caller graph for this function:

template<unsigned int N, unsigned int M>
const arma::vec::fixed< M+1 > & IntersectionPointAux< N, M >::local_bcoords_B ( ) const

Returns barycentric coordinates in the Simplex<M>.

Definition at line 211 of file intersection_point_aux.hh.

Here is the caller graph for this function:

template<unsigned int N, unsigned int M>
IntersectionResult IntersectionPointAux< N, M >::result ( ) const

Result: 0 - negative sign, 1 - positive sign, 2 - degenerate (zero for all sides), 3 - none.

Returns the orientation.

Definition at line 233 of file intersection_point_aux.hh.

Here is the caller graph for this function:

template<unsigned int N, unsigned int M>
void IntersectionPointAux< N, M >::set_coordinates ( const arma::vec::fixed< N+1 > &  lcA,
const arma::vec::fixed< M+1 > &  lcB 
)

Setter for coordinates.

Parameters
lcAbraycentric coordinates of A
lcBbraycentric coordinates of B

Definition at line 182 of file intersection_point_aux.hh.

Here is the caller graph for this function:

template<unsigned int N, unsigned int M>
void IntersectionPointAux< N, M >::set_result ( IntersectionResult  result)

Setter orientation flag.

Definition at line 195 of file intersection_point_aux.hh.

Here is the caller graph for this function:

template<unsigned int N, unsigned int M>
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 187 of file intersection_point_aux.hh.

Here is the caller graph for this function:

template<unsigned int N, unsigned int M>
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 215 of file intersection_point_aux.hh.

Here is the caller graph for this function:

template<unsigned int N, unsigned int M>
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 220 of file intersection_point_aux.hh.

Here is the caller graph for this function:

template<unsigned int N, unsigned int M>
IntersectionPointAux< M, N > IntersectionPointAux< N, M >::switch_objects ( ) const

Switches the object A and B.

Definition at line 102 of file intersection_point_aux.cc.

Here is the caller graph for this function:

template<unsigned int N, unsigned int M>
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 134 of file intersection_point_aux.cc.

Here is the caller graph for this function:

Friends And Related Function Documentation

template<unsigned int N, unsigned int M>
std::ostream& operator<< ( std::ostream &  os,
const IntersectionPointAux< N, M > &  IP 
)
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.

Member Data Documentation

template<unsigned int N, unsigned int M>
unsigned int IntersectionPointAux< N, M >::dim_A_
private

Dimension of the object A of intersection. Equal N, by default.

Definition at line 87 of file intersection_point_aux.hh.

template<unsigned int N, unsigned int M>
unsigned int IntersectionPointAux< N, M >::dim_B_
private

Dimension of the object B of intersection. Equal M, by default.

Definition at line 88 of file intersection_point_aux.hh.

template<unsigned int N, unsigned int M>
unsigned int IntersectionPointAux< N, M >::idx_A_
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.

template<unsigned int N, unsigned int M>
unsigned int IntersectionPointAux< N, M >::idx_B_
private

Definition at line 75 of file intersection_point_aux.hh.

template<unsigned int N, unsigned int M>
arma::vec::fixed<N+1> IntersectionPointAux< N, M >::local_bcoords_A_
private

Barycentric coordinates of an IP on simplex<N>.

Definition at line 60 of file intersection_point_aux.hh.

template<unsigned int N, unsigned int M>
arma::vec::fixed<M+1> IntersectionPointAux< N, M >::local_bcoords_B_
private

Barycentric coordinates of an IP on simplex<M>.

Definition at line 61 of file intersection_point_aux.hh.

template<unsigned int N, unsigned int M>
IntersectionResult IntersectionPointAux< N, M >::result_
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.


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