19 const auto &A = element.
vertex(0);
20 const auto &B = element.
vertex(1);
30 Eigen::VectorXd projection = A.getCoords() * bcoords(0) +
31 B.getCoords() * bcoords(1);
32 _distance = (location - projection).norm();
38 auto &A = element.
vertex(0);
39 auto &B = element.
vertex(1);
40 auto &C = element.
vertex(2);
52 Eigen::VectorXd projection = A.getCoords() * bcoords(0) +
53 B.getCoords() * bcoords(1) +
54 C.getCoords() * bcoords(2);
55 _distance = (location - projection).norm();
61 auto &A = element.
vertex(0);
62 auto &B = element.
vertex(1);
63 auto &C = element.
vertex(2);
64 auto &D = element.
vertex(3);
104 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...
const boost::container::static_vector< WeightedElement, 4 > & getWeightedElements() const
Get the weights and indices of the calculated interpolation.
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.
std::size_t nElements() const
Amount of weighted elements.
double distance() const
Returns the projection distance.
boost::container::static_vector< WeightedElement, 4 > _weightedElements
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.