preCICE
Loading...
Searching...
No Matches
Polation.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <boost/container/static_vector.hpp>
4#include <iosfwd>
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
41 const boost::container::static_vector<WeightedElement, 4> &getWeightedElements() const;
42
44 bool isInterpolation() const;
45
47 double distance() const;
48
49private:
50 boost::container::static_vector<WeightedElement, 4> _weightedElements;
51 double _distance;
52};
53
55std::ostream &operator<<(std::ostream &os, const WeightedElement &w);
56
58std::ostream &operator<<(std::ostream &os, const Polation &p);
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
const boost::container::static_vector< WeightedElement, 4 > & getWeightedElements() const
Get the weights and indices of the calculated interpolation.
Definition Polation.cpp:82
bool isInterpolation() const
Check whether all the weights are positive, which means it is interpolation.
Definition Polation.cpp:92
Polation(const Eigen::VectorXd &location, const mesh::Vertex &element)
Calculate projection to a vertex. Weight is always 1.0.
Definition Polation.cpp:9
std::size_t nElements() const
Amount of weighted elements.
Definition Polation.cpp:87
double distance() const
Returns the projection distance.
Definition Polation.cpp:97
boost::container::static_vector< WeightedElement, 4 > _weightedElements
Definition Polation.hpp:50
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