Class for storing a singular edge with coordinates of its corners. More...

#include <singularSet.hh>

Public Member Functions

Real distance (const concepts::Real3d point, const Hexahedron *elm) const
 Returns the square of the distance from the edge to a point inside elm. More...
 
Real distanceV0 (const concepts::Real3d point, const Hexahedron *elm) const
 Returns the the square of the distance of point to vtx0_. More...
 
Real distanceV1 (const concepts::Real3d point, const Hexahedron *elm) const
 Returns the the square of the distance of point to vtx1_. More...
 
const concepts::Connector1edge () const
 Returns a pointer to the edge object (topological, connector) More...
 
 SingularEdge (const concepts::Connector1 *edge, const concepts::Real3d vtx0, const concepts::Real3d vtx1)
 Constructor. More...
 

Private Attributes

concepts::Real3d diffVector_
 Difference vector between the 2 vertices: $x_c - x_{c'}$. More...
 
concepts::Real3d diffVectorNormed_
 Scaled difference vector: $(x_c - x_{c'})/|x_c - x_{c'}|^2$. More...
 
concepts::Real diffVectorTimesVtx0Normed_
 Scalar product of the scaled difference vector and the vector to the first vertex: $(x_c - x_{c'}) \cdot x_c /|x_c - x_{c'}|^2$
More...
 
const concepts::Connector1edge_
 Pointer to the edge object (topological, connector) More...
 
const concepts::Real3d vtx0_
 Coordinates of the vertices of the edge ( $x_c$ and $x_{c'}$) More...
 
const concepts::Real3d vtx1_
 

Friends

std::ostream & operator<< (std::ostream &os, const SingularEdge &s)
 

Detailed Description

Class for storing a singular edge with coordinates of its corners.

The class also provides methods to compute a distance from a given point (in local coordinates in an element) to the edge. The returned results are the Euclidiean distance squared.

Author
Kersten Schmidt, 2002

Definition at line 30 of file singularSet.hh.

Constructor & Destructor Documentation

◆ SingularEdge()

hp3D::SingularEdge::SingularEdge ( const concepts::Connector1 edge,
const concepts::Real3d  vtx0,
const concepts::Real3d  vtx1 
)
inline

Constructor.

Precomputes diffVector_, diffVectorNormed_ and diffVectorTimesVtx0Normed_ to allow fast computations in the distance function.

Parameters
edgeEdge object
vtx0,vtx1Coordinates of the corners of the edge

Definition at line 40 of file singularSet.hh.

Member Function Documentation

◆ distance()

Real hp3D::SingularEdge::distance ( const concepts::Real3d  point,
const Hexahedron elm 
) const

Returns the square of the distance from the edge to a point inside elm.

Parameters
pointPoint in reference coordinates $\xi \in [0,1]^3$
elmHexahedron in which the point is located

Let $k$ be a straight line along the edge, in parameters:

\[ k(t) := x_c + (x_{c'}- x_c) \cdot t = x_c + x_D \cdot t \]

where $x_c$ and $x_{c'}$ are the corners of the edge.

To determine the root point $k(t)$ of $x$ ( $x$ is $\xi$ in physical coordinates) on $k$, compute

\[ t = x \cdot\frac{x_D}{|x_D|^2} - \frac{x_c\cdot x_D}{|x_D|^2} = x \cdot a - b \]

where $a$ = diffVectorNormed_ and $b$ = diffVectorTimesVtx0Normed_ respectively.

If $0 < t < 1$, the closest point on the edge is not one of the corners and the distance $x - k(t)$ is computed. Otherwise, the distance to the closer corner is computed.

◆ distanceV0()

Real hp3D::SingularEdge::distanceV0 ( const concepts::Real3d  point,
const Hexahedron elm 
) const

Returns the the square of the distance of point to vtx0_.

◆ distanceV1()

Real hp3D::SingularEdge::distanceV1 ( const concepts::Real3d  point,
const Hexahedron elm 
) const

Returns the the square of the distance of point to vtx1_.

◆ edge()

const concepts::Connector1* hp3D::SingularEdge::edge ( ) const
inline

Returns a pointer to the edge object (topological, connector)

Definition at line 48 of file singularSet.hh.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const SingularEdge s 
)
friend

Member Data Documentation

◆ diffVector_

concepts::Real3d hp3D::SingularEdge::diffVector_
private

Difference vector between the 2 vertices: $x_c - x_{c'}$.

Definition at line 86 of file singularSet.hh.

◆ diffVectorNormed_

concepts::Real3d hp3D::SingularEdge::diffVectorNormed_
private

Scaled difference vector: $(x_c - x_{c'})/|x_c - x_{c'}|^2$.

Definition at line 88 of file singularSet.hh.

◆ diffVectorTimesVtx0Normed_

concepts::Real hp3D::SingularEdge::diffVectorTimesVtx0Normed_
private

Scalar product of the scaled difference vector and the vector to the first vertex: $(x_c - x_{c'}) \cdot x_c /|x_c - x_{c'}|^2$

Definition at line 92 of file singularSet.hh.

◆ edge_

const concepts::Connector1* hp3D::SingularEdge::edge_
private

Pointer to the edge object (topological, connector)

Definition at line 82 of file singularSet.hh.

◆ vtx0_

const concepts::Real3d hp3D::SingularEdge::vtx0_
private

Coordinates of the vertices of the edge ( $x_c$ and $x_{c'}$)

Definition at line 84 of file singularSet.hh.

◆ vtx1_

const concepts::Real3d hp3D::SingularEdge::vtx1_
private

Definition at line 84 of file singularSet.hh.


The documentation for this class was generated from the following file:
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich