preCICE v3.2.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Polation.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <iosfwd>
4#include <vector>
5#include "Eigen/Core"
6#include "mesh/Edge.hpp"
8#include "mesh/Triangle.hpp"
9#include "mesh/Vertex.hpp"
10
11namespace precice::mapping {
12
16 double weight;
17};
18
23class Polation {
24public:
26 Polation(const Eigen::VectorXd &location, const mesh::Vertex &element);
27
29 Polation(const Eigen::VectorXd &location, const mesh::Edge &element);
30
32 Polation(const Eigen::VectorXd &location, const mesh::Triangle &element);
33
35 Polation(const Eigen::VectorXd &location, const mesh::Tetrahedron &element);
36
38 std::size_t nElements() const;
39
42
44 bool isInterpolation() const;
45
47 double distance() const;
48
49private:
51 double _distance;
52};
53
56
59
60} // namespace precice::mapping
Calculates the barycentric coordinates of a coordinate on the given vertex/edge/triangle and stores t...
Definition Polation.hpp:23
std::vector< WeightedElement > _weightedElements
Definition Polation.hpp:50
bool isInterpolation() const
Check whether all the weights are positive, which means it is interpolation.
Definition Polation.cpp:91
Polation(const Eigen::VectorXd &location, const mesh::Vertex &element)
Calculate projection to a vertex. Weight is always 1.0.
Definition Polation.cpp:8
std::size_t nElements() const
Amount of weighted elements.
Definition Polation.cpp:86
double distance() const
Returns the projection distance.
Definition Polation.cpp:96
const std::vector< WeightedElement > & getWeightedElements() const
Get the weights and indices of the calculated interpolation.
Definition Polation.cpp:81
Linear edge of a mesh, defined by two Vertex objects.
Definition Edge.hpp:15
Tetrahedron of a mesh, defined by 4 vertices.
Triangle of a mesh, defined by three vertices.
Definition Triangle.hpp:24
Vertex of a mesh.
Definition Vertex.hpp:16
contains data mapping from points to meshes.
std::ostream & operator<<(std::ostream &out, Mapping::MeshRequirement val)
Definition Mapping.cpp:334
Struct that contains weight and index of a vertex.
Definition Polation.hpp:14