MEPP2 Project
Functions
FEVV::Operators::Geometry Namespace Reference

Functions

template<class T >
static T asin (T sine)
 Safe call to the std::asin function. More...
 
template<class T >
static T asin_degree (T sine)
 Safe call to the std::asin function. More...
 
template<class T >
acos (T cosine)
 Safe call to the std::acos function. More...
 
template<class T >
acos_degree (T cosine)
 Safe call to the std::acos function. More...
 
template<typename GeometryTraits >
static bool sphere_clip_vector (const typename GeometryTraits::Point &center, double r, const typename GeometryTraits::Point &p, typename GeometryTraits::Vector &v, const GeometryTraits &gt)
 Compute the intersection of a sphere (center + radius) with a ray/line (starting point + direction vector). Sphere equation is given by (x-Cx)^2+(y-Cy)^2+(z-Cz)^2=r^2 Line equation is given by (x, y, z) = p + txV. More...
 
template<typename GeometryTraits >
static bool is_in_tetrahedron (const typename GeometryTraits::Point &a, const typename GeometryTraits::Point &b, const typename GeometryTraits::Point &c, const typename GeometryTraits::Point &d, const typename GeometryTraits::Point &Pos, const GeometryTraits &gt)
 Predicate fonction to know whether the Pos position is inside the abcd tetrahedron. More...
 
template<typename GeometryTraits >
static GeometryTraits::Scalar trilinear_interpolation (const typename GeometryTraits::Point &a, const typename GeometryTraits::Point &b, const typename GeometryTraits::Point &c, const typename GeometryTraits::Point &d, const typename GeometryTraits::Point &Pos, typename GeometryTraits::Scalar vala, typename GeometryTraits::Scalar valb, typename GeometryTraits::Scalar valc, typename GeometryTraits::Scalar vald, const GeometryTraits &gt)
 Trilinear interpolation of values at tetrahedron points. More...
 
template<typename GeometryTraits >
static std::vector< typename GeometryTraits::Scalar > trilinear_interpolation (const typename GeometryTraits::Point &a, const typename GeometryTraits::Point &b, const typename GeometryTraits::Point &c, const typename GeometryTraits::Point &d, const typename GeometryTraits::Point &Pos, const std::vector< typename GeometryTraits::Scalar > &vala, const std::vector< typename GeometryTraits::Scalar > &valb, const std::vector< typename GeometryTraits::Scalar > &valc, const std::vector< typename GeometryTraits::Scalar > &vald, const GeometryTraits &gt)
 Trilinear interpolation of values at tetrahedron points. More...
 
template<typename GeometryTraits >
static bool is_over_segment (const typename GeometryTraits::Point &a, const typename GeometryTraits::Point &b, const typename GeometryTraits::Point &Pos, typename GeometryTraits::Vector &diff, const GeometryTraits &gt)
 Predicate fonction to know whether the Pos position is over the ab segment. More...
 
template<typename GeometryTraits >
static bool is_in_triangle (const typename GeometryTraits::Point &a, const typename GeometryTraits::Point &b, const typename GeometryTraits::Point &c, const typename GeometryTraits::Point &Pos, const GeometryTraits &gt)
 Predicate fonction to know whether the projection of point Pos on the triangle plane is in the triangle (abc). More...
 
template<typename GeometryTraits >
static GeometryTraits::Scalar bilinear_interpolation (const typename GeometryTraits::Point &a, const typename GeometryTraits::Point &b, const typename GeometryTraits::Point &c, const typename GeometryTraits::Point &Pos, typename GeometryTraits::Scalar vala, typename GeometryTraits::Scalar valb, typename GeometryTraits::Scalar valc, const GeometryTraits &gt)
 Bilinear interpolation of values at triangle points. More...
 
template<typename GeometryTraits >
static std::vector< typename GeometryTraits::Scalar > bilinear_interpolation (const typename GeometryTraits::Point &a, const typename GeometryTraits::Point &b, const typename GeometryTraits::Point &c, const typename GeometryTraits::Point &Pos, const std::vector< typename GeometryTraits::Scalar > &vala, const std::vector< typename GeometryTraits::Scalar > &valb, const std::vector< typename GeometryTraits::Scalar > &valc, const GeometryTraits &gt)
 Bilinear interpolation of values at triangle points. More...
 
template<typename GeometryTraits >
GeometryTraits::Point quad_barycenter (const typename GeometryTraits::Point &a, const typename GeometryTraits::Point &b, const typename GeometryTraits::Point &c, const typename GeometryTraits::Point &d, const GeometryTraits &gt)
 Compute the barycenter/mean position of a quad (given by 4 points). More...
 
template<typename GeometryTraits >
double quad_perimeter (const typename GeometryTraits::Point &a, const typename GeometryTraits::Point &b, const typename GeometryTraits::Point &c, const typename GeometryTraits::Point &d, const GeometryTraits &gt)
 Compute the perimeter of a quad (given by 4 points). More...
 
template<typename GeometryTraits >
double quad_area (const typename GeometryTraits::Point &a, const typename GeometryTraits::Point &b, const typename GeometryTraits::Point &c, const typename GeometryTraits::Point &d, const GeometryTraits &gt)
 Compute the area of a quad (given by 4 points). More...
 
template<typename GeometryTraits >
GeometryTraits::Scalar triangle_rad_angle (const typename GeometryTraits::Point &a, const typename GeometryTraits::Point &b, const typename GeometryTraits::Point &c, const GeometryTraits &gt)
 Compute the angle of a triangle (given by 3 points). More...
 
template<typename GeometryTraits >
GeometryTraits::Point triangle_barycenter (const typename GeometryTraits::Point &a, const typename GeometryTraits::Point &b, const typename GeometryTraits::Point &c, const GeometryTraits &)
 Compute the barycenter/mean position of a triangle (given by 3 points). More...
 
template<typename GeometryTraits >
double triangle_perimeter (const typename GeometryTraits::Point &a, const typename GeometryTraits::Point &b, const typename GeometryTraits::Point &c, const GeometryTraits &gt)
 Compute the perimeter of a triangle (given by 3 points). More...
 
template<typename GeometryTraits >
GeometryTraits::Vector triangle_normal_unnormalized (const typename GeometryTraits::Point &a, const typename GeometryTraits::Point &b, const typename GeometryTraits::Point &c, const GeometryTraits &gt)
 Compute the unnormalized normal of a triangle (given by 3 points). More...
 
template<typename GeometryTraits >
double triangle_area (const typename GeometryTraits::Point &a, const typename GeometryTraits::Point &b, const typename GeometryTraits::Point &c, const GeometryTraits &gt)
 Compute the area of a triangle (given by 3 points). More...
 
template<typename FaceGraph , typename GeometryTraits = FEVV::Geometry_traits< FaceGraph >>
double triangle_shape_potential (const typename GeometryTraits::Point &a, const typename GeometryTraits::Point &b, const typename GeometryTraits::Point &c, const double prohib_energy, const GeometryTraits &gt)
 Compute the shape potential of a triangle (given by 3 points). Triangle "equilateralness" measure. More...
 

Function Documentation

◆ acos()

template<class T >
T FEVV::Operators::Geometry::acos ( cosine)
inline

Safe call to the std::acos function.

Parameters
[in]cosineThe cosine value.
Returns
The arccos (in rad) of cosine value, cosine value being truncated to [-1,1] range to avoid input domain error.

Definition at line 64 of file AngleOperations.hpp.

Here is the caller graph for this function:

◆ acos_degree()

template<class T >
T FEVV::Operators::Geometry::acos_degree ( cosine)
inline

Safe call to the std::acos function.

Parameters
[in]cosineThe cosine value.
Returns
The arccos (in degree) of cosine value, cosine value being truncated to [-1,1] range to avoid input domain error.

Definition at line 83 of file AngleOperations.hpp.

Here is the call graph for this function:

◆ asin()

template<class T >
static T FEVV::Operators::Geometry::asin ( sine)
static

Safe call to the std::asin function.

Parameters
[in]sineThe sinus value.
Returns
The arcsin (in rad) of sine value, sine value being truncated to [-1,1] range to avoid input domain error.

Definition at line 31 of file AngleOperations.hpp.

Here is the caller graph for this function:

◆ asin_degree()

template<class T >
static T FEVV::Operators::Geometry::asin_degree ( sine)
static

Safe call to the std::asin function.

Parameters
[in]sineThe sinus value.
Returns
The arcsin (in degree) of sine value, sine value being truncated to [-1,1] range to avoid input domain error.

Definition at line 50 of file AngleOperations.hpp.

Here is the call graph for this function:

◆ bilinear_interpolation() [1/2]

template<typename GeometryTraits >
static std::vector< typename GeometryTraits::Scalar > FEVV::Operators::Geometry::bilinear_interpolation ( const typename GeometryTraits::Point a,
const typename GeometryTraits::Point b,
const typename GeometryTraits::Point c,
const typename GeometryTraits::Point Pos,
const std::vector< typename GeometryTraits::Scalar > &  vala,
const std::vector< typename GeometryTraits::Scalar > &  valb,
const std::vector< typename GeometryTraits::Scalar > &  valc,
const GeometryTraits &  gt 
)
inlinestatic

Bilinear interpolation of values at triangle points.

Template Parameters
GeometryTraitsThe geometric kernel.
Parameters
[in]aThe first point.
[in]bThe second point.
[in]cThe third point.
[in]PosThe point for which the bilinear interpolations of values are computed.
[in]valaThe vector of values at the first point.
[in]valbThe vector of values at the second point.
[in]valcThe vector of values at the third point.
[in]gtThe geometry trait object.
Returns
The vector of the bilinear interpolation of values at a, b, c positions for Pos position.
Precondition
Pos must be inside the triangle (abc), else the bilinear interpolation coefficients are truncated to [0,1].

Definition at line 413 of file Interpolation.hpp.

◆ bilinear_interpolation() [2/2]

template<typename GeometryTraits >
static GeometryTraits::Scalar FEVV::Operators::Geometry::bilinear_interpolation ( const typename GeometryTraits::Point a,
const typename GeometryTraits::Point b,
const typename GeometryTraits::Point c,
const typename GeometryTraits::Point Pos,
typename GeometryTraits::Scalar  vala,
typename GeometryTraits::Scalar  valb,
typename GeometryTraits::Scalar  valc,
const GeometryTraits &  gt 
)
inlinestatic

Bilinear interpolation of values at triangle points.

Template Parameters
GeometryTraitsThe geometric kernel.
Parameters
[in]aThe first point.
[in]bThe second point.
[in]cThe third point.
[in]PosThe point for which the bilinear interpolation of values is computed.
[in]valaThe value of the first point.
[in]valbThe value of the second point.
[in]valcThe value of the third point.
[in]gtThe geometry trait object.
Returns
The bilinear interpolation of values vala, valb, valc, and vald, at Pos position.
Precondition
Pos must be inside the triangle (abc), else the bilinear interpolation coefficients are truncated to [0,1].

Definition at line 352 of file Interpolation.hpp.

◆ is_in_tetrahedron()

template<typename GeometryTraits >
static bool FEVV::Operators::Geometry::is_in_tetrahedron ( const typename GeometryTraits::Point a,
const typename GeometryTraits::Point b,
const typename GeometryTraits::Point c,
const typename GeometryTraits::Point d,
const typename GeometryTraits::Point Pos,
const GeometryTraits &  gt 
)
inlinestatic

Predicate fonction to know whether the Pos position is inside the abcd tetrahedron.

Template Parameters
GeometryTraitsThe geometric kernel.
Parameters
[in]aThe first point.
[in]bThe second point.
[in]cThe third point.
[in]dThe fourth point.
[in]PosThe point that is either inside or outside the tetrahedron (abcd).
[in]gtThe geometry trait object.
Returns
True if Pos is inside the tetrahedron (abcd), else false.

Definition at line 36 of file Interpolation.hpp.

◆ is_in_triangle()

template<typename GeometryTraits >
static bool FEVV::Operators::Geometry::is_in_triangle ( const typename GeometryTraits::Point a,
const typename GeometryTraits::Point b,
const typename GeometryTraits::Point c,
const typename GeometryTraits::Point Pos,
const GeometryTraits &  gt 
)
inlinestatic

Predicate fonction to know whether the projection of point Pos on the triangle plane is in the triangle (abc).

Template Parameters
GeometryTraitsThe geometric kernel.
Parameters
[in]aThe first point.
[in]bThe second point.
[in]cThe third point.
[in]PosThe point whose projection is either
inside or outside the triangle (abc).
[in]gtThe geometry trait object.
Returns
True if the projection of point Pos is inside the triangle (abc), else false.

Definition at line 303 of file Interpolation.hpp.

◆ is_over_segment()

template<typename GeometryTraits >
static bool FEVV::Operators::Geometry::is_over_segment ( const typename GeometryTraits::Point a,
const typename GeometryTraits::Point b,
const typename GeometryTraits::Point Pos,
typename GeometryTraits::Vector diff,
const GeometryTraits &  gt 
)
inlinestatic

Predicate fonction to know whether the Pos position is over the ab segment.

Template Parameters
GeometryTraitsThe geometric kernel.
Parameters
[in]aThe first point.
[in]bThe second point.
[in]PosThe point that is either over or beside the segment (ab).
[out]diffThe orthogonal vector to translate Pos onto the segment (ab) (or line when Pos is not over the segment).
[in]gtThe geometry trait object.
Returns
True if Pos is over the segment (ab), else false.

Definition at line 252 of file Interpolation.hpp.

◆ quad_area()

template<typename GeometryTraits >
double FEVV::Operators::Geometry::quad_area ( const typename GeometryTraits::Point a,
const typename GeometryTraits::Point b,
const typename GeometryTraits::Point c,
const typename GeometryTraits::Point d,
const GeometryTraits &  gt 
)
inline

Compute the area of a quad (given by 4 points).

Template Parameters
GeometryTraitsThe geometric kernel.
Parameters
[in]aThe first point.
[in]bThe second point.
[in]cThe third point.
[in]dThe fourth point.
gtThe geometry trait object.
Returns
The quad area (double Scalar).
Remarks
This works for any side length.

Definition at line 90 of file quads.hpp.

◆ quad_barycenter()

template<typename GeometryTraits >
GeometryTraits::Point FEVV::Operators::Geometry::quad_barycenter ( const typename GeometryTraits::Point a,
const typename GeometryTraits::Point b,
const typename GeometryTraits::Point c,
const typename GeometryTraits::Point d,
const GeometryTraits &  gt 
)
inline

Compute the barycenter/mean position of a quad (given by 4 points).

Template Parameters
GeometryTraitsThe geometric kernel.
Parameters
[in]aThe first point.
[in]bThe second point.
[in]cThe third point.
[in]dThe fourth point.
[in]gtThe geometry trait object.
Returns
The barycenter/mean position of the 4 input points (Point).

Definition at line 38 of file quads.hpp.

◆ quad_perimeter()

template<typename GeometryTraits >
double FEVV::Operators::Geometry::quad_perimeter ( const typename GeometryTraits::Point a,
const typename GeometryTraits::Point b,
const typename GeometryTraits::Point c,
const typename GeometryTraits::Point d,
const GeometryTraits &  gt 
)
inline

Compute the perimeter of a quad (given by 4 points).

Template Parameters
GeometryTraitsThe geometric kernel.
Parameters
[in]aThe first point.
[in]bThe second point.
[in]cThe third point.
[in]dThe fourth point.
[in]gtThe geometry trait object.
Returns
The quad perimeter (double Scalar).

Definition at line 63 of file quads.hpp.

◆ sphere_clip_vector()

template<typename GeometryTraits >
static bool FEVV::Operators::Geometry::sphere_clip_vector ( const typename GeometryTraits::Point center,
double  r,
const typename GeometryTraits::Point p,
typename GeometryTraits::Vector v,
const GeometryTraits &  gt 
)
static

Compute the intersection of a sphere (center + radius) with a ray/line (starting point + direction vector). Sphere equation is given by (x-Cx)^2+(y-Cy)^2+(z-Cz)^2=r^2 Line equation is given by (x, y, z) = p + txV.

Template Parameters
GeometryTraitsThe geometric kernel.
Parameters
[in]centerThe sphere center.
[in]rThe sphere radius.
[in]pThe starting point/origin of the ray/line.
[in,out]vThe ray/line direction to clip by the sphere when an intersection occurs in the direction of v.
[in]gtThe geometry trait object.
Returns
True if there is an intersection between the sphere and the ray starting at p position and going along the v direction, not farther than the v' length.
Precondition
p must be inside the sphere.

Definition at line 39 of file ClippingAndIntersection.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ triangle_area()

template<typename GeometryTraits >
double FEVV::Operators::Geometry::triangle_area ( const typename GeometryTraits::Point a,
const typename GeometryTraits::Point b,
const typename GeometryTraits::Point c,
const GeometryTraits &  gt 
)
inline

Compute the area of a triangle (given by 3 points).

Template Parameters
GeometryTraitsThe geometric kernel.
Parameters
[in]aThe first point.
[in]bThe second point.
[in]cThe third point.
gtThe geometry trait object.
Returns
The triangle area (double Scalar).

Definition at line 106 of file triangles.hpp.

Here is the caller graph for this function:

◆ triangle_barycenter()

template<typename GeometryTraits >
GeometryTraits::Point FEVV::Operators::Geometry::triangle_barycenter ( const typename GeometryTraits::Point a,
const typename GeometryTraits::Point b,
const typename GeometryTraits::Point c,
const GeometryTraits &   
)
inline

Compute the barycenter/mean position of a triangle (given by 3 points).

Template Parameters
GeometryTraitsThe geometric kernel.
Parameters
[in]aThe first point.
[in]bThe second point.
[in]cThe third point.
[in]gtThe geometry trait object.
Returns
The barycenter/mean position of the 3 input points (Point).

Definition at line 37 of file triangles.hpp.

◆ triangle_normal_unnormalized()

template<typename GeometryTraits >
GeometryTraits::Vector FEVV::Operators::Geometry::triangle_normal_unnormalized ( const typename GeometryTraits::Point a,
const typename GeometryTraits::Point b,
const typename GeometryTraits::Point c,
const GeometryTraits &  gt 
)
inline

Compute the unnormalized normal of a triangle (given by 3 points).

Template Parameters
GeometryTraitsThe geometric kernel.
Parameters
[in]aThe first point.
[in]bThe second point.
[in]cThe third point.
[in]gtThe geometry trait object.
Returns
The triangle unnormalized normal (Vector).

Definition at line 83 of file triangles.hpp.

◆ triangle_perimeter()

template<typename GeometryTraits >
double FEVV::Operators::Geometry::triangle_perimeter ( const typename GeometryTraits::Point a,
const typename GeometryTraits::Point b,
const typename GeometryTraits::Point c,
const GeometryTraits &  gt 
)
inline

Compute the perimeter of a triangle (given by 3 points).

Template Parameters
GeometryTraitsThe geometric kernel.
Parameters
[in]aThe first point.
[in]bThe second point.
[in]cThe third point.
[in]gtThe geometry trait object.
Returns
The triangle perimeter (double Scalar).

Definition at line 60 of file triangles.hpp.

◆ triangle_rad_angle()

template<typename GeometryTraits >
GeometryTraits::Scalar FEVV::Operators::Geometry::triangle_rad_angle ( const typename GeometryTraits::Point a,
const typename GeometryTraits::Point b,
const typename GeometryTraits::Point c,
const GeometryTraits &  gt 
)
inline

Compute the angle of a triangle (given by 3 points).

Template Parameters
GeometryTraitsThe geometric kernel.
Parameters
[in]aThe first point.
[in]bThe second point.
[in]cThe third point.
[in]gtThe geometry trait object.
Returns
The triangle angle in rad (Scalar).

Definition at line 32 of file triangle_rad_angle.hpp.

Here is the call graph for this function:

◆ triangle_shape_potential()

template<typename FaceGraph , typename GeometryTraits = FEVV::Geometry_traits< FaceGraph >>
double FEVV::Operators::Geometry::triangle_shape_potential ( const typename GeometryTraits::Point a,
const typename GeometryTraits::Point b,
const typename GeometryTraits::Point c,
const double  prohib_energy,
const GeometryTraits &  gt 
)
inline

Compute the shape potential of a triangle (given by 3 points). Triangle "equilateralness" measure.

Template Parameters
FaceGrapha Mesh type that provides a Model of the FaceGraph Concept through a boost::graph_traits<> specialization.
GeometryTraitsThe geometric kernel when available. This is defaulted to FEVV::Geometry_traits<FaceGraph>.
Parameters
[in]aThe first point.
[in]bThe second point.
[in]cThe third point.
[in]PROHIB_ENERGYThe maximum authorized value, e.g. returns that value if smaller than the computed shape potential. This parameter is needed because when we compute the mesh quality using the sum of shape potential of each triangle, the sum may overflow.
[in]gtThe geometry trait object.
Returns
The triangle shape potential (double Scalar).

Definition at line 138 of file triangles.hpp.

◆ trilinear_interpolation() [1/2]

template<typename GeometryTraits >
static std::vector< typename GeometryTraits::Scalar > FEVV::Operators::Geometry::trilinear_interpolation ( const typename GeometryTraits::Point a,
const typename GeometryTraits::Point b,
const typename GeometryTraits::Point c,
const typename GeometryTraits::Point d,
const typename GeometryTraits::Point Pos,
const std::vector< typename GeometryTraits::Scalar > &  vala,
const std::vector< typename GeometryTraits::Scalar > &  valb,
const std::vector< typename GeometryTraits::Scalar > &  valc,
const std::vector< typename GeometryTraits::Scalar > &  vald,
const GeometryTraits &  gt 
)
inlinestatic

Trilinear interpolation of values at tetrahedron points.

Template Parameters
GeometryTraitsThe geometric kernel.
Parameters
[in]aThe first point.
[in]bThe second point.
[in]cThe third point.
[in]dThe fourth point.
[in]PosThe point for which the trilinear interpolations of values are computed.
[in]valaThe vector of values at the first point.
[in]valbThe vector of values at the second point.
[in]valcThe vector of values at the third point.
[in]valdThe vector of values at the fourth point.
[in]gtThe geometry trait object.
Returns
The vector of the trilinear interpolation of values at a, b, c, d positions for Pos position.
Precondition
Pos must be inside the tetrahedron (abcd), else the trilinear interpolation coefficients are truncated to [0,1].

Definition at line 204 of file Interpolation.hpp.

◆ trilinear_interpolation() [2/2]

template<typename GeometryTraits >
static GeometryTraits::Scalar FEVV::Operators::Geometry::trilinear_interpolation ( const typename GeometryTraits::Point a,
const typename GeometryTraits::Point b,
const typename GeometryTraits::Point c,
const typename GeometryTraits::Point d,
const typename GeometryTraits::Point Pos,
typename GeometryTraits::Scalar  vala,
typename GeometryTraits::Scalar  valb,
typename GeometryTraits::Scalar  valc,
typename GeometryTraits::Scalar  vald,
const GeometryTraits &  gt 
)
inlinestatic

Trilinear interpolation of values at tetrahedron points.

Template Parameters
GeometryTraitsThe geometric kernel.
Parameters
[in]aThe first point.
[in]bThe second point.
[in]cThe third point.
[in]dThe fourth point.
[in]PosThe point for which the trilinear interpolation of values is computed.
[in]valaThe value of the first point.
[in]valbThe value of the second point.
[in]valcThe value of the third point.
[in]valdThe value of the fourth point.
[in]gtThe geometry trait object.
Returns
The trilinear interpolation of values vala, valb, valc, and vald, at Pos position.
Precondition
Pos must be inside the tetrahedron (abcd), else the trilinear interpolation coefficients are truncated to [0,1].

Definition at line 110 of file Interpolation.hpp.