preCICE v3.2.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Public Attributes | Private Attributes | List of all members
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::StoragetimeStepsStorage ()
 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::StoragetimeStepsStorage () const
 Returns a const reference to the time step storage of the data.
 
auto stamples () const
 Returns the stamples in _timeStepsStorage.
 
void setSampleAtTime (double time, time::Sample sample)
 Add sample at given time to _timeStepsStorage.
 
void setGlobalSample (const time::Sample &sample)
 Set _data::_sample.
 
void initializeWithZeroAtTime (double time)
 Add sample with zero values at given time to _timeStepsStorage.
 
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< 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::Storage _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 124 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 129 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 134 of file CouplingData.cpp.

Here is the call graph for this function:

◆ exchangeSubsteps()

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

Definition at line 230 of file CouplingData.cpp.

◆ getDataID()

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

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

Definition at line 195 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 200 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 215 of file CouplingData.cpp.

◆ getMeshID()

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

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

Definition at line 190 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 205 of file CouplingData.cpp.

◆ getPreviousGradientsAtTime()

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

Definition at line 94 of file CouplingData.cpp.

Here is the call graph for this function:

◆ getPreviousIterationSize()

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

returns size of previous iteration

Definition at line 184 of file CouplingData.cpp.

Here is the call graph for this function:

◆ getPreviousValuesAtTime()

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

returns previous data interpolated to the relativeDt time

Definition at line 89 of file CouplingData.cpp.

Here is the call graph for this function:

◆ getSize()

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

Definition at line 37 of file CouplingData.cpp.

Here is the call graph for this function:

◆ getVertexOffsets()

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

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

Definition at line 210 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 52 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 64 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 57 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 139 of file CouplingData.cpp.

◆ initializeWithZeroAtTime()

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

Add sample with zero values at given time to _timeStepsStorage.

Definition at line 111 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 145 of file CouplingData.cpp.

◆ moveToNextWindow()

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

move to next window and initialize data via extrapolation

Definition at line 220 of file CouplingData.cpp.

◆ nVertices()

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

Definition at line 42 of file CouplingData.cpp.

◆ previousIteration()

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

returns data value from previous iteration

Definition at line 172 of file CouplingData.cpp.

Here is the call graph for this function:

◆ previousIterationGradients()

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

returns gradient data from previous iteration

Definition at line 178 of file CouplingData.cpp.

Here is the call graph for this function:

◆ reinitialize()

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

Reshape the past iterations and initial sample during remeshing.

Definition at line 150 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 71 of file CouplingData.cpp.

◆ setGlobalSample()

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

Set _data::_sample.

Definition at line 105 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 _timeStepsStorage.

Definition at line 99 of file CouplingData.cpp.

Here is the call graph for this function:

◆ stamples()

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

Returns the stamples in _timeStepsStorage.

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 165 of file CouplingData.cpp.

Here is the call graph for this function:

◆ timeStepsStorage() [1/2]

time::Storage & precice::cplscheme::CouplingData::timeStepsStorage ( )

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

Definition at line 77 of file CouplingData.cpp.

◆ timeStepsStorage() [2/2]

const time::Storage & precice::cplscheme::CouplingData::timeStepsStorage ( ) const

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

Definition at line 83 of file CouplingData.cpp.

◆ values()

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

Returns a const reference to the data values.

Definition at line 47 of file CouplingData.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ _data

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

Data associated with this CouplingData.

Definition at line 134 of file CouplingData.hpp.

◆ _direction

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

Definition at line 142 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 140 of file CouplingData.hpp.

◆ _log

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

Definition at line 128 of file CouplingData.hpp.

◆ _mesh

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

Mesh associated with this CouplingData.

Definition at line 131 of file CouplingData.hpp.

◆ _previousTimeStepsStorage

time::Storage precice::cplscheme::CouplingData::_previousTimeStepsStorage
private

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

Definition at line 137 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 120 of file CouplingData.hpp.


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