14 bool requiresInitialization,
15 bool exchangeSubsteps,
17 : requiresInitialization(requiresInitialization),
18 _mesh(
std::move(mesh)),
19 _data(
std::move(data)),
20 _previousTimeStepsStorage(),
21 _exchangeSubsteps(exchangeSubsteps),
34 return _data->getDimensions();
65 return _data->timeStepsStorage();
71 return _data->timeStepsStorage();
94 return _data->hasGradient();
99 return _mesh->getDimensions();
130 return _mesh->getID();
135 return _data->getID();
140 return _data->getName();
145 return _mesh->getVertexOffsets();
159 _data->moveToNextWindow();
166 return _data->sample();
172 return _data->sample();
#define PRECICE_ASSERT(...)
std::vector< int > getVertexOffsets()
get vertex offsets of this CouplingData's mesh. See Mesh::getVertexOffsets().
int getMeshID()
get ID of this CouplingData's mesh. See Mesh::getID().
Eigen::MatrixXd getPreviousGradientsAtTime(double relativeDt)
int getDimensions() const
bool exchangeSubsteps() const
bool _exchangeSubsteps
If true, all substeps will be sent / received for this coupling data.
Eigen::MatrixXd & gradients()
Returns a reference to the gradient data values.
time::Storage & timeStepsStorage()
Returns a reference to the time step storage of the data.
const Eigen::MatrixXd & previousIterationGradients() const
returns gradient data from previous iteration
mesh::PtrMesh _mesh
Mesh associated with this CouplingData.
auto stamples() const
Returns the stamples in _timeStepsStorage.
const Eigen::VectorXd & previousIteration() const
returns data value from previous iteration
int meshDimensions() const
Returns the dimensions of the current mesh (2D or 3D)
Eigen::VectorXd & values()
Returns a reference to the data values.
Direction getDirection() const
get direction of this coupling data
int getDataID()
get ID of this CouplingData's data. See Data::getID().
void setSampleAtTime(double time, time::Sample sample)
Add sample at given time to _timeStepsStorage.
std::string getDataName()
get name of this CouplingData's data. See Data::getName().
Eigen::VectorXd getPreviousValuesAtTime(double relativeDt)
returns previous data interpolated to the relativeDt time
void storeIteration()
store _data->values() in read-only variable _previousIteration for convergence checks etc.
int getPreviousIterationSize() const
returns size of previous iteration
void moveToNextWindow()
move to next window and initialize data via extrapolation
time::Storage _previousTimeStepsStorage
Sample values of previous iteration (end of time window).
time::Sample & sample()
Returns a reference to the gradient data Sample.
bool hasGradient() const
Returns if the data contains gradient data.
CouplingData(mesh::PtrData data, mesh::PtrMesh mesh, bool requiresInitialization, bool exchangeSubsteps, Direction direction)
mesh::PtrData _data
Data associated with this CouplingData.
Eigen::VectorXd sample(double time) const
Need to use interpolation for the case with changing time grids.
auto stamples() const
Get the stamples.
Eigen::MatrixXd sampleGradients(double time) const
contains implementations of coupling schemes for coupled simulations.
Eigen::MatrixXd gradients
The gradients of the data. Use gradients.col(i) to get the gradient at vertex i.