16 int spatialDimensions,
18 : _waveform(waveformDegree),
21 _dimensions(dimensions),
22 _spatialDimensions(spatialDimensions),
93 Eigen::Map<const Eigen::VectorXd>(
values.begin(),
values.size())});
101 Eigen::Map<const Eigen::VectorXd>(
values.begin(),
values.size()),
139 const SizeType expectedSize = expectedCount *
_dimensions;
140 const auto actualSize =
static_cast<SizeType
>(
_sample.
values.size());
142 if (expectedSize < actualSize) {
146 if (expectedSize > actualSize) {
147 const auto leftToAllocate = expectedSize - actualSize;
156 const SizeType expectedColumnSize = expectedCount *
_dimensions;
157 const auto actualColumnSize =
static_cast<SizeType
>(
_sample.
gradients.cols());
160 if (expectedColumnSize < actualColumnSize) {
165 if (expectedColumnSize > actualColumnSize) {
166 const auto columnLeftToAllocate = expectedColumnSize - actualColumnSize;
#define PRECICE_DEBUG(...)
#define PRECICE_ASSERT(...)
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.
bool hasSamples() const
Returns if there are sample of this data.
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.
void setGlobalSample(const time::Sample &sample)
Set _sample.
time::SampleResult sampleAtTime(double time) const
Samples _waveform at given time.
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.
const time::Sample & sample() const
Returns a const reference to the _sample.
time::Waveform _waveform
Waveform wrapping this Data.
const Eigen::MatrixXd & gradients() const
Returns a const reference to the gradient data values.
void setSampleAtTime(double time, const time::Sample &sample)
Add sample at given time to _timeStepsStorage.
void emplaceSampleAtTime(double time)
Creates an empty sample at given time.
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(d*i+k) to get the gradient of vertex i,...
int dataDims
The dimensionality of the data.