2#include <Eigen/src/Core/Matrix.h>
18 const auto &A = element.
vertex(0);
19 const auto &B = element.
vertex(1);
29 Eigen::VectorXd projection = A.getCoords() * bcoords(0) +
30 B.getCoords() * bcoords(1);
31 _distance = (location - projection).norm();
37 auto &A = element.
vertex(0);
38 auto &B = element.
vertex(1);
39 auto &C = element.
vertex(2);
51 Eigen::VectorXd projection = A.getCoords() * bcoords(0) +
52 B.getCoords() * bcoords(1) +
53 C.getCoords() * bcoords(2);
54 _distance = (location - projection).norm();
60 auto &A = element.
vertex(0);
61 auto &B = element.
vertex(1);
62 auto &C = element.
vertex(2);
63 auto &D = element.
vertex(3);
98 return os <<
"(Vertex ID: " << w.
vertexID <<
", Weight: " << w.
weight <<
")";
#define PRECICE_ASSERT(...)
Calculates the barycentric coordinates of a coordinate on the given vertex/edge/triangle and stores t...
std::vector< WeightedElement > _weightedElements
bool isInterpolation() const
Check whether all the weights are positive, which means it is interpolation.
Polation(const Eigen::VectorXd &location, const mesh::Vertex &element)
Calculate projection to a vertex. Weight is always 1.0.
double distance() const
Returns the projection distance.
const std::vector< WeightedElement > & getWeightedElements() const
Get the weights and indices of the calculated interpolation.
Linear edge of a mesh, defined by two Vertex objects.
int getDimensions() const
Returns number of spatial dimensions (2 or 3) the edge is embedded to.
Vertex & vertex(int i)
Returns the edge's vertex with index 0 or 1.
Tetrahedron of a mesh, defined by 4 vertices.
Vertex & vertex(int i)
Returns tetrahedron vertex with index 0, 1, 2 or 3.
int getDimensions() const
Returns dimensionalty of space the Tetrahedron is embedded in.
Triangle of a mesh, defined by three vertices.
int getDimensions() const
Returns dimensionalty of space the triangle is embedded in.
Vertex & vertex(int i)
Returns triangle vertex with index 0, 1 or 2.
VertexID getID() const
Returns the unique (among vertices of one mesh on one processor) ID of the vertex.
Eigen::VectorXd getCoords() const
Returns the coordinates of the vertex.
contains data mapping from points to meshes.
std::ostream & operator<<(std::ostream &out, Mapping::MeshRequirement val)
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)
Eigen::Vector2d calcBarycentricCoordsForEdge(const Eigen::VectorXd &a, const Eigen::VectorXd &b, const Eigen::VectorXd &u)
Struct that contains weight and index of a vertex.