preCICE v3.2.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | List of all members
precice::mapping::impl::MappingDataCache Struct Reference

#include <MappingDataCache.hpp>

Collaboration diagram for precice::mapping::impl::MappingDataCache:
[legend]

Public Member Functions

 MappingDataCache (int dataDim)
 Constructor.
 
int getDataDimensions () const
 Returns the number of data components.
 
bool hasDataAtTimeStamp (double time) const
 Check, if the current data vector (in inData or the std::vectors) hold data of time time.
 
void setTimeStamp (double time)
 Set the timestamp of the MappingDataCache to the specified time.
 
void resetTimeStamp ()
 Reset the time stamp associated with the data.
 
void resetData ()
 Reset all data containers to zero.
 

Public Attributes

time::Stample inData
 
std::vector< Eigen::MatrixXd > polynomialContributions
 
std::vector< Eigen::MatrixXd > p
 

Detailed Description

Struct to store temporary data structures tied to a specific Mapping-Data pair. The usual implementations from 'Mapping' have no notion about the data they are operating on. One mapping might even be responsible for multiple read or write data, which are sequentially processed one after another in the ParticipantImpl.

The Cache here was added in the context of just-in-time data mappings. Fundamentally, a just-in-time mapping can also be responsible for multiple read and write data. However, the just-in-time mapping was specifically designed for particle-mesh coupling, where a particle solver provides coordinates just-in-time for the mapping. If now each particle solver calls a just-in-time read or write data call, then we would need to perform the full time interpolation and mapping evaluation for each API function call. The cache here allows to store temporary data we can reuse across multiple just-in-time API calls to preserve computational efficiency. In the most basic configuration scenarios (NN mapping), the cache simply holds the latest time interpolant to prevent repeated time interpolation for each function call. For more advanced mappings (PUM), the mapping stores intermediate basis-function coefficients of the resulting from the last time interpolant. The cache data always holds time-specific data for all data sites.

Note that the MappingDataCache mostly provides the memory and data structures. All data structures are filled within the configured mapping class. Particularly relevant are

Definition at line 44 of file MappingDataCache.hpp.

Constructor & Destructor Documentation

◆ MappingDataCache()

precice::mapping::impl::MappingDataCache::MappingDataCache ( int dataDim)
inlineexplicit

Constructor.

Definition at line 84 of file MappingDataCache.hpp.

Member Function Documentation

◆ getDataDimensions()

int precice::mapping::impl::MappingDataCache::getDataDimensions ( ) const
inline

Returns the number of data components.

Definition at line 89 of file MappingDataCache.hpp.

◆ hasDataAtTimeStamp()

bool precice::mapping::impl::MappingDataCache::hasDataAtTimeStamp ( double time) const
inline

Check, if the current data vector (in inData or the std::vectors) hold data of time time.

Definition at line 94 of file MappingDataCache.hpp.

Here is the call graph for this function:

◆ resetData()

void precice::mapping::impl::MappingDataCache::resetData ( )
inline

Reset all data containers to zero.

Definition at line 110 of file MappingDataCache.hpp.

Here is the call graph for this function:

◆ resetTimeStamp()

void precice::mapping::impl::MappingDataCache::resetTimeStamp ( )
inline

Reset the time stamp associated with the data.

Definition at line 104 of file MappingDataCache.hpp.

◆ setTimeStamp()

void precice::mapping::impl::MappingDataCache::setTimeStamp ( double time)
inline

Set the timestamp of the MappingDataCache to the specified time.

Definition at line 99 of file MappingDataCache.hpp.

Member Data Documentation

◆ inData

time::Stample precice::mapping::impl::MappingDataCache::inData

Definition at line 52 of file MappingDataCache.hpp.

◆ p

std::vector<Eigen::MatrixXd> precice::mapping::impl::MappingDataCache::p

Definition at line 65 of file MappingDataCache.hpp.

◆ polynomialContributions

std::vector<Eigen::MatrixXd> precice::mapping::impl::MappingDataCache::polynomialContributions

Definition at line 62 of file MappingDataCache.hpp.


The documentation for this struct was generated from the following file: