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();
44 return _mesh->nVertices();
74 return _data->sample();
80 return _data->timeStepsStorage();
86 return _data->timeStepsStorage();
116 _data->setSampleAtTime(time, zero);
121 _data->setSampleAtTime(time, zero);
126 _data->emplaceSampleAtTime(time);
142 return _data->hasGradient();
147 return _mesh->getDimensions();
161 _data->timeStepsStorage().setAllSamples(zero);
192 return _mesh->getID();
197 return _data->getID();
202 return _data->getName();
207 return _mesh->getName();
212 return _mesh->getVertexOffsets();
226 _data->moveToNextWindow();
#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().
void initializeWithZeroAtTime(double time)
Add sample with zero values at given time to _timeStepsStorage.
Eigen::MatrixXd getPreviousGradientsAtTime(double relativeDt)
const Eigen::VectorXd & values() const
Returns a const reference to the data values.
int getDimensions() const
bool exchangeSubsteps() const
bool _exchangeSubsteps
If true, all substeps will be sent / received for this coupling data.
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
void emplaceSampleAtTime(double time)
Creates an empty sample at given time.
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)
void setGlobalSample(const time::Sample &sample)
Set _data::_sample.
Direction getDirection() const
get direction of this coupling data
int getDataID()
get ID of this CouplingData's data. See Data::getID().
int gradientsCols() const
Returns number of columns of the stored gradients.
void setSampleAtTime(double time, time::Sample sample)
Add sample at given time to _timeStepsStorage.
const time::Sample & sample() const
Returns a const reference to the data Sample.
const Eigen::MatrixXd & gradients() const
Returns a const reference to the gradient data values.
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).
bool hasGradient() const
Returns if the data contains gradient data.
time::SampleResult getPreviousValuesAtTime(double relativeDt)
returns previous data interpolated to the relativeDt time
void reinitialize()
Reshape the past iterations and initial sample during remeshing.
int gradientsRows() const
Returns number of rows of the stored gradients.
CouplingData(mesh::PtrData data, mesh::PtrMesh mesh, bool requiresInitialization, bool exchangeSubsteps, Direction direction)
std::string getMeshName() const
get name of this CouplingData's mesh. See Mesh::getName().
mesh::PtrData _data
Data associated with this CouplingData.
std::string getDataName() const
get name of this CouplingData's data. See Data::getName().
SampleResult 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
void setAllSamples(const Sample &sample)
Overrides all existing samples.
contains implementations of coupling schemes for coupled simulations.
Eigen::MatrixXd gradients
The gradients of the data. Use gradients.col(d*i+k) to get the gradient of vertex i,...