preCICE
Loading...
Searching...
No Matches
precice::cplscheme::CouplingData Class Reference

#include <CouplingData.hpp>

Collaboration diagram for precice::cplscheme::CouplingData:
[legend]

Public Types

enum struct  Direction : bool { Send , Receive }

Public Member Functions

 CouplingData (mesh::PtrData data, mesh::PtrMesh mesh, bool requiresInitialization, bool exchangeSubsteps, Direction direction)
int getDimensions () const
int getSize () const
int nVertices () const
const Eigen::VectorXd & values () const
 Returns a const reference to the data values.
const Eigen::MatrixXd & gradients () const
 Returns a const reference to the gradient data values.
int gradientsRows () const
 Returns number of rows of the stored gradients.
int gradientsCols () const
 Returns number of columns of the stored gradients.
const time::Samplesample () const
 Returns a const reference to the data Sample.
time::Waveformwaveform ()
 Returns a reference to the time step storage of the data.
time::SampleResult getPreviousValuesAtTime (double relativeDt)
 returns previous data interpolated to the relativeDt time
Eigen::MatrixXd getPreviousGradientsAtTime (double relativeDt)
const time::Waveformwaveform () const
 Returns a const reference to the time step storage of the data.
auto stamples () const
 Returns the stamples in the Waveform.
void setSampleAtTime (double time, time::Sample sample)
 Add sample at given time to the Waveform.
void setGlobalSample (const time::Sample &sample)
 Set _data::_sample.
void initializeWithZeroAtTime (double time)
 Add sample with zero values at given time to the Waveform.
void emplaceSampleAtTime (double time)
 Creates an empty sample at given time.
void emplaceSampleAtTime (double time, std::initializer_list< double > values)
 Creates a sample at given time with given values.
void emplaceSampleAtTime (double time, std::initializer_list< double > values, std::initializer_list< double > gradients)
 Creates a sample at given time with given values and gradients.
bool hasGradient () const
 Returns if the data contains gradient data.
int meshDimensions () const
 Returns the dimensions of the current mesh (2D or 3D)
void reinitialize ()
 Reshape the past iterations and initial sample during remeshing.
void storeIteration ()
 store _data->values() in read-only variable _previousIteration for convergence checks etc.
const Eigen::VectorXd & previousIteration () const
 returns data value from previous iteration
const Eigen::MatrixXd & previousIterationGradients () const
 returns gradient data from previous iteration
int getPreviousIterationSize () const
 returns size of previous iteration
int getMeshID ()
 get ID of this CouplingData's mesh. See Mesh::getID().
int getDataID ()
 get ID of this CouplingData's data. See Data::getID().
std::string getDataName () const
 get name of this CouplingData's data. See Data::getName().
std::string getMeshName () const
 get name of this CouplingData's mesh. See Mesh::getName().
std::vector< std::optional< double > > getLowerBound () const
 get configured lower bound(s) of the data
std::vector< std::optional< double > > getUpperBound () const
 get configured upper bound(s) of the data
std::vector< int > getVertexOffsets ()
 get vertex offsets of this CouplingData's mesh. See Mesh::getVertexOffsets().
Direction getDirection () const
 get direction of this coupling data
void moveToNextWindow ()
 move to next window and initialize data via extrapolation
bool exchangeSubsteps () const

Public Attributes

const bool requiresInitialization
 True, if the data values of this CouplingData require to be initialized by this participant.

Private Attributes

logging::Logger _log {"cplscheme::CouplingData"}
mesh::PtrMesh _mesh
 Mesh associated with this CouplingData.
mesh::PtrData _data
 Data associated with this CouplingData.
time::Waveform _previousTimeStepsStorage
 Sample values of previous iteration (end of time window).
bool _exchangeSubsteps
 If true, all substeps will be sent / received for this coupling data.
Direction _direction

Detailed Description

Definition at line 12 of file CouplingData.hpp.

Member Enumeration Documentation

◆ Direction

Enumerator
Send 
Receive 

Definition at line 14 of file CouplingData.hpp.

Constructor & Destructor Documentation

◆ CouplingData()

precice::cplscheme::CouplingData::CouplingData ( mesh::PtrData data,
mesh::PtrMesh mesh,
bool requiresInitialization,
bool exchangeSubsteps,
Direction direction )

Definition at line 11 of file CouplingData.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ emplaceSampleAtTime() [1/3]

void precice::cplscheme::CouplingData::emplaceSampleAtTime ( double time)

Creates an empty sample at given time.

Definition at line 136 of file CouplingData.cpp.

◆ emplaceSampleAtTime() [2/3]

void precice::cplscheme::CouplingData::emplaceSampleAtTime ( double time,
std::initializer_list< double > values )

Creates a sample at given time with given values.

Definition at line 141 of file CouplingData.cpp.

Here is the call graph for this function:

◆ emplaceSampleAtTime() [3/3]

void precice::cplscheme::CouplingData::emplaceSampleAtTime ( double time,
std::initializer_list< double > values,
std::initializer_list< double > gradients )

Creates a sample at given time with given values and gradients.

Definition at line 146 of file CouplingData.cpp.

Here is the call graph for this function:

◆ exchangeSubsteps()

bool precice::cplscheme::CouplingData::exchangeSubsteps ( ) const

Definition at line 242 of file CouplingData.cpp.

◆ getDataID()

int precice::cplscheme::CouplingData::getDataID ( )

get ID of this CouplingData's data. See Data::getID().

Definition at line 207 of file CouplingData.cpp.

◆ getDataName()

std::string precice::cplscheme::CouplingData::getDataName ( ) const

get name of this CouplingData's data. See Data::getName().

Definition at line 212 of file CouplingData.cpp.

◆ getDimensions()

int precice::cplscheme::CouplingData::getDimensions ( ) const

Definition at line 31 of file CouplingData.cpp.

◆ getDirection()

CouplingData::Direction precice::cplscheme::CouplingData::getDirection ( ) const

get direction of this coupling data

Definition at line 227 of file CouplingData.cpp.

◆ getLowerBound()

std::vector< std::optional< double > > precice::cplscheme::CouplingData::getLowerBound ( ) const

get configured lower bound(s) of the data

Definition at line 42 of file CouplingData.cpp.

◆ getMeshID()

int precice::cplscheme::CouplingData::getMeshID ( )

get ID of this CouplingData's mesh. See Mesh::getID().

Definition at line 202 of file CouplingData.cpp.

◆ getMeshName()

std::string precice::cplscheme::CouplingData::getMeshName ( ) const

get name of this CouplingData's mesh. See Mesh::getName().

Definition at line 217 of file CouplingData.cpp.

◆ getPreviousGradientsAtTime()

Eigen::MatrixXd precice::cplscheme::CouplingData::getPreviousGradientsAtTime ( double relativeDt)

Definition at line 106 of file CouplingData.cpp.

◆ getPreviousIterationSize()

int precice::cplscheme::CouplingData::getPreviousIterationSize ( ) const

returns size of previous iteration

Definition at line 196 of file CouplingData.cpp.

◆ getPreviousValuesAtTime()

time::SampleResult precice::cplscheme::CouplingData::getPreviousValuesAtTime ( double relativeDt)

returns previous data interpolated to the relativeDt time

Definition at line 101 of file CouplingData.cpp.

◆ getSize()

int precice::cplscheme::CouplingData::getSize ( ) const

Definition at line 37 of file CouplingData.cpp.

Here is the call graph for this function:

◆ getUpperBound()

std::vector< std::optional< double > > precice::cplscheme::CouplingData::getUpperBound ( ) const

get configured upper bound(s) of the data

Definition at line 48 of file CouplingData.cpp.

◆ getVertexOffsets()

std::vector< int > precice::cplscheme::CouplingData::getVertexOffsets ( )

get vertex offsets of this CouplingData's mesh. See Mesh::getVertexOffsets().

Definition at line 222 of file CouplingData.cpp.

◆ gradients()

const Eigen::MatrixXd & precice::cplscheme::CouplingData::gradients ( ) const

Returns a const reference to the gradient data values.

Definition at line 64 of file CouplingData.cpp.

Here is the call graph for this function:

◆ gradientsCols()

int precice::cplscheme::CouplingData::gradientsCols ( ) const

Returns number of columns of the stored gradients.

Definition at line 76 of file CouplingData.cpp.

Here is the call graph for this function:

◆ gradientsRows()

int precice::cplscheme::CouplingData::gradientsRows ( ) const

Returns number of rows of the stored gradients.

Definition at line 69 of file CouplingData.cpp.

Here is the call graph for this function:

◆ hasGradient()

bool precice::cplscheme::CouplingData::hasGradient ( ) const

Returns if the data contains gradient data.

Definition at line 151 of file CouplingData.cpp.

◆ initializeWithZeroAtTime()

void precice::cplscheme::CouplingData::initializeWithZeroAtTime ( double time)

Add sample with zero values at given time to the Waveform.

Definition at line 123 of file CouplingData.cpp.

Here is the call graph for this function:

◆ meshDimensions()

int precice::cplscheme::CouplingData::meshDimensions ( ) const

Returns the dimensions of the current mesh (2D or 3D)

Definition at line 157 of file CouplingData.cpp.

◆ moveToNextWindow()

void precice::cplscheme::CouplingData::moveToNextWindow ( )

move to next window and initialize data via extrapolation

Definition at line 232 of file CouplingData.cpp.

◆ nVertices()

int precice::cplscheme::CouplingData::nVertices ( ) const

Definition at line 54 of file CouplingData.cpp.

◆ previousIteration()

const Eigen::VectorXd & precice::cplscheme::CouplingData::previousIteration ( ) const

returns data value from previous iteration

Definition at line 184 of file CouplingData.cpp.

◆ previousIterationGradients()

const Eigen::MatrixXd & precice::cplscheme::CouplingData::previousIterationGradients ( ) const

returns gradient data from previous iteration

Definition at line 190 of file CouplingData.cpp.

◆ reinitialize()

void precice::cplscheme::CouplingData::reinitialize ( )

Reshape the past iterations and initial sample during remeshing.

Definition at line 162 of file CouplingData.cpp.

Here is the call graph for this function:

◆ sample()

const time::Sample & precice::cplscheme::CouplingData::sample ( ) const

Returns a const reference to the data Sample.

Definition at line 83 of file CouplingData.cpp.

◆ setGlobalSample()

void precice::cplscheme::CouplingData::setGlobalSample ( const time::Sample & sample)

Set _data::_sample.

Definition at line 117 of file CouplingData.cpp.

Here is the call graph for this function:

◆ setSampleAtTime()

void precice::cplscheme::CouplingData::setSampleAtTime ( double time,
time::Sample sample )

Add sample at given time to the Waveform.

Definition at line 111 of file CouplingData.cpp.

Here is the call graph for this function:

◆ stamples()

auto precice::cplscheme::CouplingData::stamples ( ) const
inline

Returns the stamples in the Waveform.

Definition at line 57 of file CouplingData.hpp.

Here is the call graph for this function:

◆ storeIteration()

void precice::cplscheme::CouplingData::storeIteration ( )

store _data->values() in read-only variable _previousIteration for convergence checks etc.

Definition at line 177 of file CouplingData.cpp.

Here is the call graph for this function:

◆ values()

const Eigen::VectorXd & precice::cplscheme::CouplingData::values ( ) const

Returns a const reference to the data values.

Definition at line 59 of file CouplingData.cpp.

Here is the call graph for this function:

◆ waveform() [1/2]

time::Waveform & precice::cplscheme::CouplingData::waveform ( )

Returns a reference to the time step storage of the data.

Definition at line 89 of file CouplingData.cpp.

◆ waveform() [2/2]

const time::Waveform & precice::cplscheme::CouplingData::waveform ( ) const

Returns a const reference to the time step storage of the data.

Definition at line 95 of file CouplingData.cpp.

Member Data Documentation

◆ _data

mesh::PtrData precice::cplscheme::CouplingData::_data
private

Data associated with this CouplingData.

Definition at line 140 of file CouplingData.hpp.

◆ _direction

Direction precice::cplscheme::CouplingData::_direction
private

Definition at line 148 of file CouplingData.hpp.

◆ _exchangeSubsteps

bool precice::cplscheme::CouplingData::_exchangeSubsteps
private

If true, all substeps will be sent / received for this coupling data.

Definition at line 146 of file CouplingData.hpp.

◆ _log

logging::Logger precice::cplscheme::CouplingData::_log {"cplscheme::CouplingData"}
private

Definition at line 134 of file CouplingData.hpp.

◆ _mesh

mesh::PtrMesh precice::cplscheme::CouplingData::_mesh
private

Mesh associated with this CouplingData.

Definition at line 137 of file CouplingData.hpp.

◆ _previousTimeStepsStorage

time::Waveform precice::cplscheme::CouplingData::_previousTimeStepsStorage
private

Sample values of previous iteration (end of time window).

Definition at line 143 of file CouplingData.hpp.

◆ requiresInitialization

const bool precice::cplscheme::CouplingData::requiresInitialization

True, if the data values of this CouplingData require to be initialized by this participant.

Definition at line 126 of file CouplingData.hpp.


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