16 int spatialDimensions,
18 : _waveform(waveformDegree),
21 _dimensions(dimensions),
22 _spatialDimensions(spatialDimensions),
125 const SizeType expectedSize = expectedCount *
_dimensions;
126 const auto actualSize =
static_cast<SizeType
>(
_sample.
values.size());
128 if (expectedSize < actualSize) {
132 if (expectedSize > actualSize) {
133 const auto leftToAllocate = expectedSize - actualSize;
142 const SizeType expectedColumnSize = expectedCount *
_dimensions;
143 const auto actualColumnSize =
static_cast<SizeType
>(
_sample.
gradients.cols());
146 if (expectedColumnSize < actualColumnSize) {
151 if (expectedColumnSize > actualColumnSize) {
152 const auto columnLeftToAllocate = expectedColumnSize - actualColumnSize;
#define PRECICE_DEBUG(...)
#define PRECICE_ASSERT(...)
time::Sample & sample()
Returns a reference to the _sample.
const std::string & getName() const
Returns the name of the data set, as set in the config file.
std::string _name
Name of the data set.
time::Storage & timeStepsStorage()
Returns a reference to the _timeStepsStorage of _waveform.
Data(std::string name, DataID id, int dimension, int spatialDimensions=-1, int waveformDegree=time::Time::DEFAULT_WAVEFORM_DEGREE)
Constructor.
int getDimensions() const
Returns the dimension (i.e., number of components) of one data value (i.e number of columns of one gr...
void requireDataGradient()
Set the additional requirement of gradient data.
bool hasGradient() const
Returns if the data contains gradient data.
int _spatialDimensions
Spatial Dimension of one element -> number of rows (only 2, 3 allowed for 2D, 3D).
auto stamples() const
Returns a the stamples from _timeStepsStorage.
void allocateValues(int expectedCount)
Allocates memory for the data values and corresponding gradient values.
int getSpatialDimensions() const
Returns the mesh dimension (i.e., number of rows) of one gradient data value .
int _dimensions
Dimensionality of one data value.
int getWaveformDegree() const
get degree of _waveform.
Eigen::VectorXd sampleAtTime(double time) const
Samples _waveform at given time.
void toZero()
Sets all values to zero.
Eigen::MatrixXd & gradients()
Returns a reference to the gradient data values.
DataID getID() const
Returns the ID of the data set (supposed to be unique).
DataID _id
ID of the data set (supposed to be unique).
bool _hasGradient
Whether gradient data is available or not.
Eigen::VectorXd & values()
Returns a reference to the data values.
time::Waveform _waveform
Waveform wrapping this Data.
void setSampleAtTime(double time, const time::Sample &sample)
Add sample at given time to _timeStepsStorage.
void setSampleAtTime(double time, const Sample &sample)
Store Sample at a specific time.
void move()
Move this Storage by deleting all stamples except the one at the end of the window.
int getInterpolationDegree() const
provides Mesh, Data and primitives.
void append(Eigen::VectorXd &v, double value)
Eigen::MatrixXd gradients
The gradients of the data. Use gradients.col(i) to get the gradient at vertex i.