preCICE v3.1.2
Loading...
Searching...
No Matches
NearestNeighborBaseMapping.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4#include <vector>
5#include "logging/Logger.hpp"
6#include "mapping/Mapping.hpp"
7
8namespace precice {
9namespace mapping {
10
14public:
21 NearestNeighborBaseMapping(Constraint constraint, int dimensions, bool hasGradient, std::string mappingName,
23
25 void computeMapping() final override;
26
28 void clear() final override;
29
34 virtual void onMappingComputed(mesh::PtrMesh origins, mesh::PtrMesh searchSpace);
35
36 void tagMeshFirstRound() final override;
37 void tagMeshSecondRound() final override;
38
39protected:
42
45
46 mutable logging::Logger _log{"mapping::" + mappingName};
47
51
54};
55
56} // namespace mapping
57} // namespace precice
This class provides a lightweight logger.
Definition Logger.hpp:16
Abstract base class for mapping of data from one mesh to another.
Definition Mapping.hpp:15
Constraint
Specifies additional constraints for a mapping.
Definition Mapping.hpp:29
void clear() final override
Removes a computed mapping.
std::string mappingName
NearestNeighborMapping or NearestNeighborGradientMapping.
virtual void onMappingComputed(mesh::PtrMesh origins, mesh::PtrMesh searchSpace)
std::vector< int > _vertexIndices
Computed output vertex indices to map data from input vertices to.
void tagMeshSecondRound() final override
Method used by partition. Tags vertices that can be filtered out.
void computeMapping() final override
Computes the mapping coefficients from the in- and output mesh.
NearestNeighborBaseMapping(Constraint constraint, int dimensions, bool hasGradient, std::string mappingName, std::string mappingNameShort)
Constructor.
void tagMeshFirstRound() final override
Method used by partition. Tags vertices that could be owned by this rank.
Main namespace of the precice library.