Flow123d  release_2.2.0-914-gf1a3a4f
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 (ElementFullIter ele) const
 Computes real coordinates of IP, given the element ele in which IP lies. More...
 
bool is_pathologic () const
 Returns true, if this is a pathologic case. 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_orientation (IntersectionResult orientation)
 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
 Returns the index of Simplex<M>. More...
 
IntersectionResult orientation () const
 Returns the orientation. 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 orientation_
 Orientation 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 48 of file compute_intersection.hh.

Constructor & Destructor Documentation

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

Default constructor.

Definition at line 31 of file intersection_point_aux.cc.

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

Definition at line 95 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 37 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>

Constructor - flipping dimension of an intersection point.

Parameters
IPis intersection point with flipped dimension (N->M, M->N)Allowed only from dimension M 1 to 2 and from 2 to 3.
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?

Definition at line 58 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 82 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 20 of file intersection_point_aux.cc.

Here is the caller graph for this function:

template<unsigned int N, unsigned int M>
arma::vec::fixed< 3 > IntersectionPointAux< N, M >::coords ( ElementFullIter  ele) const

Computes real coordinates of IP, given the element ele in which IP lies.

Definition at line 107 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 207 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 211 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 233 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 237 of file intersection_point_aux.hh.

Here is the caller graph for this function:

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

Returns true, if this is a pathologic case.

Definition at line 245 of file intersection_point_aux.hh.

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 215 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 219 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 >::orientation ( ) const

Returns the orientation.

Definition at line 241 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 190 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_orientation ( IntersectionResult  orientation)

Setter orientation flag.

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>
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 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_A ( unsigned int  idx,
unsigned int  dim_A 
)

Sets the topology of object A in Simplex<N>.

Definition at line 223 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 228 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 96 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 89 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 90 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 intersectinh 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 75 of file intersection_point_aux.hh.

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

Definition at line 76 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 61 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 62 of file intersection_point_aux.hh.

template<unsigned int N, unsigned int M>
IntersectionResult IntersectionPointAux< N, M >::orientation_
private

Orientation according to Plucker products.

All Plucker products > 0 then orientation is 1. All Plucker products < 0 then orientation is 0. (In case of line 1D and triangle 2D, the line is going in opposite direction to the normal of triangle.)

In pathologic case, it is > 1.

Definition at line 87 of file intersection_point_aux.hh.


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