preCICE v3.2.0
|
Mapping with radial basis functions. More...
#include <RadialBasisFctMapping.hpp>
Public Types | |
using | RADIAL_BASIS_FUNCTION_T = typename SOLVER_T::BASIS_FUNCTION_T |
Public Types inherited from precice::mapping::Mapping | |
enum | Constraint { CONSISTENT , CONSERVATIVE , SCALED_CONSISTENT_SURFACE , SCALED_CONSISTENT_VOLUME } |
Specifies additional constraints for a mapping. More... | |
enum class | MeshRequirement { UNDEFINED = 0 , VERTEX = 1 , FULL = 2 } |
Specifies requirements for the input and output meshes of a mapping. More... | |
enum class | InitialGuessRequirement : bool { Required = true , None = false } |
Specifies whether the mapping requires an initial guess. More... |
Public Member Functions | |
RadialBasisFctMapping (Mapping::Constraint constraint, int dimensions, RADIAL_BASIS_FUNCTION_T function, std::array< bool, 3 > deadAxis, Polynomial polynomial, Args... args) | |
Constructor. | |
void | computeMapping () final override |
Computes the mapping coefficients from the in- and output mesh. | |
void | clear () final override |
Removes a computed mapping. | |
std::string | getName () const final override |
name of the rbf mapping | |
Public Member Functions inherited from precice::mapping::RadialBasisFctBaseMapping< SOLVER_T::BASIS_FUNCTION_T > | |
RadialBasisFctBaseMapping (Constraint constraint, int dimensions, const SOLVER_T::BASIS_FUNCTION_T &function, std::array< bool, 3 > deadAxis, InitialGuessRequirement mappingType) | |
Constructor. | |
~RadialBasisFctBaseMapping () override=default | |
void | tagMeshFirstRound () final override |
Method used by partition. Tags vertices that could be owned by this rank. | |
void | tagMeshSecondRound () final override |
Method used by partition. Tags vertices that can be filtered out. | |
Public Member Functions inherited from precice::mapping::Mapping | |
Mapping (Constraint constraint, int dimensions, bool requiresGradientData, InitialGuessRequirement initialGuessRequirement) | |
Constructor, takes mapping constraint. | |
Mapping & | operator= (Mapping &&)=delete |
virtual | ~Mapping ()=default |
Destructor, empty. | |
void | setMeshes (const mesh::PtrMesh &input, const mesh::PtrMesh &output) |
Sets input and output meshes carrying data to be mapped. | |
const mesh::PtrMesh & | getInputMesh () const |
const mesh::PtrMesh & | getOutputMesh () const |
Constraint | getConstraint () const |
Returns the constraint (consistent/conservative) of the mapping. | |
MeshRequirement | getInputRequirement () const |
Returns the requirement on the input mesh. | |
MeshRequirement | getOutputRequirement () const |
Returns the requirement on the output mesh. | |
bool | hasComputedMapping () const |
Returns true, if the mapping has been computed. | |
virtual bool | hasConstraint (const Constraint &constraint) const |
Checks whether the mapping has the given constraint or not. | |
bool | isScaledConsistent () const |
Returns true if mapping is a form of scaled consistent mapping. | |
bool | requiresInitialGuess () const |
Return true if the mapping requires an initial guess. | |
bool | isJustInTimeMapping () const |
const Eigen::VectorXd & | initialGuess () const |
Return the provided initial guess of a mapping using an initialGuess. | |
Eigen::VectorXd & | initialGuess () |
bool | hasInitialGuess () const |
True if initialGuess().size() == 0. | |
void | map (int inputDataID, int outputDataID) |
void | map (int inputDataID, int outputDataID, Eigen::VectorXd &initialGuess) |
void | map (const time::Sample &input, Eigen::VectorXd &output) |
Maps an input Sample to output data from input mesh to output mesh. | |
void | map (const time::Sample &input, Eigen::VectorXd &output, Eigen::VectorXd &initialGuess) |
Maps an input Sample to output data from input mesh to output mesh, given an initialGuess. | |
virtual void | scaleConsistentMapping (const Eigen::VectorXd &input, Eigen::VectorXd &output, Constraint type) const |
Scales the consistently mapped output data such that the surface integral of the values on input mesh and output mesh are equal. | |
bool | requiresGradientData () const |
Returns whether the mapping requires gradient data. | |
virtual void | mapConservativeAt (const Eigen::Ref< const Eigen::MatrixXd > &coordinates, const Eigen::Ref< const Eigen::MatrixXd > &source, impl::MappingDataCache &cache, Eigen::Ref< Eigen::MatrixXd > target) |
Just-in-time mapping variant of mapConservative. | |
virtual void | mapConsistentAt (const Eigen::Ref< const Eigen::MatrixXd > &coordinates, const impl::MappingDataCache &cache, Eigen::Ref< Eigen::MatrixXd > values) |
Just-in-time mapping variant of mapConsistent. | |
virtual void | updateMappingDataCache (impl::MappingDataCache &cache, const Eigen::Ref< const Eigen::VectorXd > &in) |
Allows updating a so-called MappingDataCache for more efficient just-in-time mappings. | |
virtual void | initializeMappingDataCache (impl::MappingDataCache &cache) |
Allocates memory and sets up the data structures inside the MappingDataCache. | |
virtual void | completeJustInTimeMapping (impl::MappingDataCache &cache, Eigen::Ref< Eigen::MatrixXd > result) |
Completes a just-in-time mapping for conservative constraints. |
Private Member Functions | |
void | mapConservative (const time::Sample &inData, Eigen::VectorXd &outData) final override |
Maps data using a conservative constraint. | |
void | mapConsistent (const time::Sample &inData, Eigen::VectorXd &outData) final override |
Maps data using a consistent constraint. |
Private Attributes | |
precice::logging::Logger | _log {"mapping::RadialBasisFctMapping"} |
std::unique_ptr< SOLVER_T > | _rbfSolver |
Polynomial | _polynomial |
Treatment of the polynomial. | |
std::tuple< Args... > | optionalArgs |
Optional constructor arguments for the solver class. |
Additional Inherited Members | |
Protected Member Functions inherited from precice::mapping::RadialBasisFctBaseMapping< SOLVER_T::BASIS_FUNCTION_T > | |
int | getPolynomialParameters () const |
Computes the number of polynomial degrees of freedom based on the problem dimension and the dead axis. | |
Protected Member Functions inherited from precice::mapping::Mapping | |
mesh::PtrMesh | input () const |
Returns pointer to input mesh. | |
mesh::PtrMesh | output () const |
Returns pointer to output mesh. | |
void | setInputRequirement (MeshRequirement requirement) |
Sets the mesh requirement for the input mesh. | |
void | setOutputRequirement (MeshRequirement requirement) |
Sets the mesh requirement for the output mesh. | |
int | getDimensions () const |
Protected Attributes inherited from precice::mapping::RadialBasisFctBaseMapping< SOLVER_T::BASIS_FUNCTION_T > | |
SOLVER_T::BASIS_FUNCTION_T | _basisFunction |
Radial basis function type used in interpolation. | |
std::vector< bool > | _deadAxis |
true if the mapping along some axis should be ignored | |
Protected Attributes inherited from precice::mapping::Mapping | |
bool | _hasComputedMapping = false |
Flag to indicate whether computeMapping() has been called. | |
bool | _requiresGradientData |
Flag if gradient data is required for the mapping. |
Mapping with radial basis functions.
With help of the input data points and values an interpolant is constructed. The interpolant is formed by a weighted sum of conditionally positive radial basis functions and a (low order) polynomial, and evaluated at the output data points.
The radial basis function type has to be given as template parameter, and has to be one of the defined types in this file.
Definition at line 29 of file RadialBasisFctMapping.hpp.
using precice::mapping::RadialBasisFctMapping< SOLVER_T, Args >::RADIAL_BASIS_FUNCTION_T = typename SOLVER_T::BASIS_FUNCTION_T |
Definition at line 31 of file RadialBasisFctMapping.hpp.
precice::mapping::RadialBasisFctMapping< SOLVER_T, Args >::RadialBasisFctMapping | ( | Mapping::Constraint | constraint, |
int | dimensions, | ||
RADIAL_BASIS_FUNCTION_T | function, | ||
std::array< bool, 3 > | deadAxis, | ||
Polynomial | polynomial, | ||
Args... | args ) |
Constructor.
[in] | constraint | Specifies mapping to be consistent or conservative. |
[in] | dimensions | Dimensionality of the meshes |
[in] | function | Radial basis function used for mapping. |
[in] | xDead,yDead,zDead | Deactivates mapping along an axis |
Definition at line 79 of file RadialBasisFctMapping.hpp.
|
finaloverridevirtual |
Removes a computed mapping.
Implements precice::mapping::RadialBasisFctBaseMapping< SOLVER_T::BASIS_FUNCTION_T >.
Definition at line 170 of file RadialBasisFctMapping.hpp.
|
finaloverridevirtual |
Computes the mapping coefficients from the in- and output mesh.
Implements precice::mapping::RadialBasisFctBaseMapping< SOLVER_T::BASIS_FUNCTION_T >.
Definition at line 94 of file RadialBasisFctMapping.hpp.
|
finaloverridevirtual |
name of the rbf mapping
Implements precice::mapping::Mapping.
Definition at line 178 of file RadialBasisFctMapping.hpp.
|
finaloverrideprivatevirtual |
Maps data using a conservative constraint.
[in] | input | Sample to map data from |
[in] | output | Values to map to |
If requiresInitialGuess(), then the initial guess is available via initialGuess(). Provide a new initial guess by overwriting it. The mapping has full control over its size.
Implements precice::mapping::Mapping.
Definition at line 194 of file RadialBasisFctMapping.hpp.
|
finaloverrideprivatevirtual |
Maps data using a consistent constraint.
[in] | input | Sample to map data from |
[in] | output | Values to map to |
If requiresInitialGuess(), then the initial guess is available via initialGuess(). Provide a new initial guess by overwriting it. The mapping has full control over its size.
Implements precice::mapping::Mapping.
Definition at line 317 of file RadialBasisFctMapping.hpp.
|
private |
Definition at line 58 of file RadialBasisFctMapping.hpp.
|
private |
Treatment of the polynomial.
Definition at line 70 of file RadialBasisFctMapping.hpp.
|
private |
Definition at line 61 of file RadialBasisFctMapping.hpp.
|
private |
Optional constructor arguments for the solver class.
Definition at line 73 of file RadialBasisFctMapping.hpp.