45 const int dimensions = inData.
dataDims;
46 const Eigen::VectorXd &inValues = inData.
values;
47 Eigen::VectorXd & outValues = outData;
51 for (
size_t i = 0; i <
input()->nVertices(); i++) {
52 const size_t inOffset = i * dimensions;
54 for (
const auto &elem : elems) {
55 size_t outOffset =
static_cast<size_t>(elem.vertexID) * dimensions;
56 for (
int dim = 0; dim < dimensions; dim++) {
59 outValues(outOffset + dim) += elem.weight * inValues(inOffset + dim);
73 const int dimensions = inData.
dataDims;
74 const Eigen::VectorXd &inValues = inData.
values;
75 Eigen::VectorXd & outValues = outData;
79 for (
size_t i = 0; i <
output()->nVertices(); i++) {
81 size_t outOffset = i * dimensions;
82 for (
const auto &elem : elems) {
83 const size_t inOffset =
static_cast<size_t>(elem.vertexID) * dimensions;
84 for (
int dim = 0; dim < dimensions; dim++) {
87 outValues(outOffset + dim) += elem.weight * inValues(inOffset + dim);
113 const std::size_t max_count = origins->nVertices();
116 for (
const auto &elem : interpolation.getWeightedElements()) {
118 tagged.
insert(elem.vertexID);
122 if (tagged.
size() == max_count) {
128 for (
auto &v : origins->vertices()) {
129 if (tagged.
count(v.getID()) == 1) {
#define PRECICE_DEBUG(...)
#define PRECICE_TRACE(...)
#define PRECICE_ASSERT(...)
std::vector< Polation > _interpolations
void tagMeshFirstRound() final override
Method used by partition. Tags vertices that could be owned by this rank.
void clear() final override
Removes a computed mapping.
void mapConsistent(const time::Sample &inData, Eigen::VectorXd &outData) override
Maps data using a consistent constraint.
void tagMeshSecondRound() final override
Method used by partition. Tags vertices that can be filtered out.
BarycentricBaseMapping(Constraint constraint, int dimensions)
void mapConservative(const time::Sample &inData, Eigen::VectorXd &outData) override
Maps data using a conservative constraint.
Abstract base class for mapping of data from one mesh to another.
mesh::PtrMesh output() const
Returns pointer to output mesh.
Constraint
Specifies additional constraints for a mapping.
mesh::PtrMesh input() const
Returns pointer to input mesh.
bool _hasComputedMapping
Flag to indicate whether computeMapping() has been called.
Constraint getConstraint() const
Returns the constraint (consistent/conservative) of the mapping.
virtual std::string getName() const =0
Returns the name of the mapping method for logging purpose.
virtual void computeMapping()=0
Computes the mapping coefficients from the in- and output mesh.
virtual bool hasConstraint(const Constraint &constraint) const
Checks whether the mapping has the given constraint or not.
InitialGuessRequirement
Specifies whether the mapping requires an initial guess.
Calculates the barycentric coordinates of a coordinate on the given vertex/edge/triangle and stores t...
contains data mapping from points to meshes.
constexpr bool equals(const Eigen::MatrixBase< DerivedA > &A, const Eigen::MatrixBase< DerivedB > &B, double tolerance=NUMERICAL_ZERO_DIFFERENCE)
Compares two Eigen::MatrixBase for equality up to tolerance.
static constexpr SynchronizeTag Synchronize
Convenience instance of the SynchronizeTag.
int dataDims
The dimensionality of the data.