preCICE v3.1.2
Searching...
No Matches
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.

## ◆ 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
 a point A of the edge AB b point B of the edge AB u the 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
 a point A of the tetrahedron ABCD b point B of the tetrahedron ABCD c point C of the tetrahedron ABCD d point D of the tetrahedron ABCD u the 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
 a point A of the triangle ABC b point B of the triangle ABC c point C of the triangle ABC u the 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.