preCICE v3.1.2
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | Friends | List of all members
precice::time::Waveform Class Reference

Allows to perform interpolation on samples in storage of given data. More...

#include <Waveform.hpp>

Collaboration diagram for precice::time::Waveform:
[legend]

Public Member Functions

 Waveform (const int degree)
 Waveform object which stores values of current and past time windows for performing interpolation.
 
time::StoragetimeStepsStorage ()
 Returns a reference to the _timeStepsStorage.
 
const time::StoragetimeStepsStorage () const
 Returns a const reference to the _timeStepsStorage.
 
auto stamples () const
 Returns a the stamples from _timeStepsStorage.
 
Eigen::VectorXd sample (const double time) const
 Evaluate waveform at specific point in time. Uses interpolation if necessary.
 

Private Attributes

time::Storage _timeStepsStorage
 Stores time steps in the current time window.
 
logging::Logger _log {"time::Waveform"}
 

Friends

class testing::WaveformFixture
 

Detailed Description

Allows to perform interpolation on samples in storage of given data.

The constructor Waveform(degree, data) creates a waveform. The samples of the data's storage are used to create the interpolant. The waveform is initialized with two data values at the beginning and at the end of the window as a constant function. Waveform::store(value) allows the user to provide new data to the Waveform. Interpolation is performed based on these values. The maximum allowed polynomial degree depends on the number of stored samples and can reach the interpolationDegree defined during construction as a maximum. If more samples are available than the maximum degree requires, a piecewise interpolation will be used (piecewise constant, piecewise linear and B-Spline interpolation). Interpolation is only performed inside the current time window.

Definition at line 25 of file Waveform.hpp.

Constructor & Destructor Documentation

◆ Waveform()

precice::time::Waveform::Waveform ( const int degree)

Waveform object which stores values of current and past time windows for performing interpolation.

Parameters
degreeDefines the polynomial degree supported by this Waveform and reserves storage correspondingly

Definition at line 11 of file Waveform.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ sample()

Eigen::VectorXd precice::time::Waveform::sample ( const double time) const

Evaluate waveform at specific point in time. Uses interpolation if necessary.

Interpolates values inside current time window using _storage and an interpolation scheme of the maximum degree of this Waveform. The interpolation scheme always uses all available values in _storage and tries to reach _degree. If more than the required number of values needed to reach _degree are available, a piecewise interpolation strategy will be applied to obtain an interpolation that reaches the requested polynomial degree and still interpolates all the provided data points.

Parameters
timeTime where the sampling inside the window happens.
Returns
Value of Waveform at given time.

Definition at line 26 of file Waveform.cpp.

Here is the call graph for this function:

◆ stamples()

auto precice::time::Waveform::stamples ( ) const
inline

Returns a the stamples from _timeStepsStorage.

Definition at line 42 of file Waveform.hpp.

Here is the call graph for this function:

◆ timeStepsStorage() [1/2]

time::Storage & precice::time::Waveform::timeStepsStorage ( )

Returns a reference to the _timeStepsStorage.

Definition at line 16 of file Waveform.cpp.

◆ timeStepsStorage() [2/2]

const time::Storage & precice::time::Waveform::timeStepsStorage ( ) const

Returns a const reference to the _timeStepsStorage.

Definition at line 21 of file Waveform.cpp.

Friends And Related Symbol Documentation

◆ testing::WaveformFixture

friend class testing::WaveformFixture
friend

Definition at line 26 of file Waveform.hpp.

Member Data Documentation

◆ _log

logging::Logger precice::time::Waveform::_log {"time::Waveform"}
mutableprivate

Definition at line 61 of file Waveform.hpp.

◆ _timeStepsStorage

time::Storage precice::time::Waveform::_timeStepsStorage
private

Stores time steps in the current time window.

Definition at line 59 of file Waveform.hpp.


The documentation for this class was generated from the following files: