Flow123d  master-f44eb46
Public Member Functions | Private Attributes | 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 <intersection_point_aux.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...
 

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 58 of file intersection_point_aux.hh.

Constructor & Destructor Documentation

◆ IntersectionPointAux() [1/4]

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

Default constructor.

Definition at line 29 of file intersection_point_aux.cc.

◆ ~IntersectionPointAux()

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

Definition at line 93 of file intersection_point_aux.hh.

◆ IntersectionPointAux() [2/4]

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 35 of file intersection_point_aux.cc.

◆ IntersectionPointAux() [3/4]

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 44 of file intersection_point_aux.cc.

◆ IntersectionPointAux() [4/4]

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

◆ clear()

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

Resets the object to default values.

Definition at line 18 of file intersection_point_aux.cc.

◆ coords()

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 112 of file intersection_point_aux.cc.

◆ dim_A()

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

Here is the caller graph for this function:

◆ dim_B()

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

Here is the caller graph for this function:

◆ idx_A()

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

Here is the caller graph for this function:

◆ idx_B()

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

Here is the caller graph for this function:

◆ local_bcoords_A()

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

Here is the caller graph for this function:

◆ local_bcoords_B()

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

Here is the caller graph for this function:

◆ result()

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

Here is the caller graph for this function:

◆ set_coordinates()

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 196 of file intersection_point_aux.hh.

Here is the caller graph for this function:

◆ set_result()

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

Setter orientation flag.

Definition at line 209 of file intersection_point_aux.hh.

Here is the caller graph for this function:

◆ set_topology()

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 201 of file intersection_point_aux.hh.

Here is the caller graph for this function:

◆ set_topology_A()

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 229 of file intersection_point_aux.hh.

Here is the caller graph for this function:

◆ set_topology_B()

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 234 of file intersection_point_aux.hh.

Here is the caller graph for this function:

◆ switch_objects()

template<unsigned int N, unsigned int M>
IntersectionPointAux< M, N > IntersectionPointAux< N, M >::switch_objects

Switches the object A and B.

Definition at line 101 of file intersection_point_aux.cc.

Here is the caller graph for this function:

◆ topology_equal()

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 133 of file intersection_point_aux.cc.

Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator<<

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

◆ dim_A_

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.

◆ dim_B_

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.

◆ idx_A_

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.

◆ idx_B_

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.

◆ local_bcoords_A_

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.

◆ local_bcoords_B_

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.

◆ result_

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: