preCICE
Loading...
Searching...
No Matches
AxialGeoMultiscaleMapping.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4#include "logging/Logger.hpp"
5#include "mapping/Mapping.hpp"
6
7namespace precice::mapping {
8
11public:
18 enum struct MultiscaleType {
21 };
22 enum struct MultiscaleAxis {
23 X = 0,
24 Y = 1,
25 Z = 2
26 };
27
46
61
63 void computeMapping() override;
64
66 void clear() override;
67
68 void tagMeshFirstRound() override;
69 void tagMeshSecondRound() override;
70
72 std::string getName() const final override;
73
74protected:
76 void mapConservative(const time::Sample &inData, Eigen::VectorXd &outData) override;
77
79 void mapConsistent(const time::Sample &inData, Eigen::VectorXd &outData) override;
80
81private:
82 mutable logging::Logger _log{"mapping::AxialGeoMultiscaleMapping"};
83
84 // dimensionality of mapping, namely 1D-3D, 1D-2D or 2D-3D
86
89
92
94 double _radius;
95
98
99 // cross-section of the pipe
101
103 std::vector<double> _vertexDistances;
104
106 std::vector<Eigen::Vector2d> _vertexTransverseCoords;
107
108 // Axis of 2D interface line
109 int _lineCoord = -1;
110
111 // nearest input vertex to output vertices
112 std::vector<int> _nearestVertex;
113
114 // band of nearest output vertices to input vertex
115 std::vector<std::vector<int>> _collectBands;
116
117 // Maximum distance of output vertices to each input vertex
118 std::vector<double> _maxDistancePerInput;
119};
120
121} // namespace precice::mapping
void mapConservative(const time::Sample &inData, Eigen::VectorXd &outData) override
Maps data using a conservative constraint.
double _radius
radius of the "tube" from or to which the data is mapped, i.e., radius of the circular interface betw...
MultiscaleType
Geometric multiscale nature of the mapping (spread or collect).
std::string getName() const final override
Returns name of the mapping.
MultiscaleAxis _axis
main axis along which axial geometric multiscale coupling happens
void tagMeshSecondRound() override
Method used by partition. Tags vertices that can be filtered out.
void tagMeshFirstRound() override
Method used by partition. Tags vertices that could be owned by this rank.
void computeMapping() override
Takes care of compute-heavy operations needed only once to set up the mapping.
void clear() override
Removes a computed mapping.
MultiscaleType _type
type of mapping, namely spread or collect
MultiscaleProfile _profile
Cross-sectional profile of the exchanged quantity.
std::vector< Eigen::Vector2d > _vertexTransverseCoords
computed normalized transverse coordinates of oputput vertices for squared cross-section
AxialGeoMultiscaleMapping(Constraint constraint, int dimensions, MultiscaleDimension dimension, MultiscaleType type, MultiscaleAxis axis, double radius, MultiscaleProfile profile=MultiscaleProfile::UNIFORM, MultiscaleCrossSection crossSection=MultiscaleCrossSection::CIRCLE)
Constructor.
std::vector< double > _vertexDistances
computed vertex distances to map data from input vertex to output vertices
void mapConsistent(const time::Sample &inData, Eigen::VectorXd &outData) override
Maps data using a consistent constraint.
MultiscaleProfile
Profile to use when type == SPREAD.
Constraint
Specifies additional constraints for a mapping.
Definition Mapping.hpp:30
Mapping(Constraint constraint, int dimensions, bool requiresGradientData, InitialGuessRequirement initialGuessRequirement)
Constructor, takes mapping constraint.
Definition Mapping.cpp:12
contains the logging framework.
contains data mapping from points to meshes.
contains the time interpolation logic.
Definition Sample.hpp:8