preCICE v3.1.2
Loading...
Searching...
No Matches
Functions
precice::math::barycenter Namespace Reference

Provides operations to calculate barycentric coordinates for a point's projection onto a primitive. More...

Functions

Eigen::Vector2d calcBarycentricCoordsForEdge (const Eigen::VectorXd &a, const Eigen::VectorXd &b, const Eigen::VectorXd &u)
 
static double crossProduct2D (const Eigen::Vector2d &u, const Eigen::Vector2d &v)
 
Eigen::Vector3d calcBarycentricCoordsForTriangle (const Eigen::VectorXd &a, const Eigen::VectorXd &b, const Eigen::VectorXd &c, const Eigen::VectorXd &u)
 
Eigen::Vector4d calcBarycentricCoordsForTetrahedron (const Eigen::VectorXd &a, const Eigen::VectorXd &b, const Eigen::VectorXd &c, const Eigen::VectorXd &d, const Eigen::VectorXd &u)
 

Detailed Description

Provides operations to calculate barycentric coordinates for a point's projection onto a primitive.

Function Documentation

◆ calcBarycentricCoordsForEdge()

Eigen::Vector2d precice::math::barycenter::calcBarycentricCoordsForEdge ( const Eigen::VectorXd & a,
const Eigen::VectorXd & b,
const Eigen::VectorXd & u )

Takes the end vertices of an edge and a point in 2D or 3D space. Returns the barycentric coordinates for that point's projection onto the given edge.

Parameters
apoint A of the edge AB
bpoint B of the edge AB
uthe point to compute the barycentric coordinates for
Note
Simple scalar projection approach, projected point in Cartesian coordinates is not actually calculated.

Definition at line 11 of file barycenter.cpp.

◆ calcBarycentricCoordsForTetrahedron()

Eigen::Vector4d precice::math::barycenter::calcBarycentricCoordsForTetrahedron ( const Eigen::VectorXd & a,
const Eigen::VectorXd & b,
const Eigen::VectorXd & c,
const Eigen::VectorXd & d,
const Eigen::VectorXd & u )

Takes the corner vertices of a tetrahedron and a point in 3D space. Returns the barycentric coordinates for that point's projection onto the given tetrahedron.

Parameters
apoint A of the tetrahedron ABCD
bpoint B of the tetrahedron ABCD
cpoint C of the tetrahedron ABCD
dpoint D of the tetrahedron ABCD
uthe point to compute the barycentric coordinates for
Note
This implements an efficient one-step algorithm (no separate projection) described in Boris Martin's Master's thesis

Definition at line 101 of file barycenter.cpp.

◆ calcBarycentricCoordsForTriangle()

Eigen::Vector3d precice::math::barycenter::calcBarycentricCoordsForTriangle ( const Eigen::VectorXd & a,
const Eigen::VectorXd & b,
const Eigen::VectorXd & c,
const Eigen::VectorXd & u )

Takes the corner vertices of a triangle and a point in 3D space. Returns the barycentric coordinates for that point's projection onto the given triangle.

Parameters
apoint A of the triangle ABC
bpoint B of the triangle ABC
cpoint C of the triangle ABC
uthe point to compute the barycentric coordinates for
Note
This implements the efficient one-step algorithm (no separate projection) presented in Computing the barycentric coordinates of a projected point by W. Heidrich (2005)

Definition at line 45 of file barycenter.cpp.

Here is the call graph for this function:

◆ crossProduct2D()

static double precice::math::barycenter::crossProduct2D ( const Eigen::Vector2d & u,
const Eigen::Vector2d & v )
static

Definition at line 40 of file barycenter.cpp.