12 _writeDataBuffer(data->getDimensions())
41 for (
int i = 0; i < static_cast<int>(vertices.
size()); ++i) {
43 localData.col(vertices[i]) = inputData.col(i);
54 Eigen::Map<const Eigen::MatrixXd> inputGradients(gradients.
data(), gradientComponents, vertices.
size());
57 for (
int i = 0; i < static_cast<int>(vertices.
size()); ++i) {
59 localGradients.col(vertices[i]) = inputGradients.col(i);
71 if (expectedSize < actualSize) {
75 if (expectedSize > actualSize) {
76 const auto leftToAllocate = expectedSize - actualSize;
89 if (expectedColumnSize < actualColumnSize) {
94 if (expectedColumnSize > actualColumnSize) {
95 const auto columnLeftToAllocate = expectedColumnSize - actualColumnSize;
113 mappingContext.
toData = data;
#define PRECICE_DEBUG(...)
#define PRECICE_ASSERT(...)
Stores one Data object with related mesh.
int getMeshVertexCount() const
Get the number of vertices of mesh.
bool hasWriteMapping() const
Informs the user whether this DataContext has any write mapping.
void appendMapping(MappingContext mappingContext)
Helper to append a mappingContext, fromData and toData to the corresponding data containers.
std::string getDataName() const
Get the Name of _providedData.
int getDataDimensions() const
Get the dimensions of _providedData.
int getSpatialDimensions() const
Get the spatial dimensions of _providedData.
bool hasReadMapping() const
Informs the user whether this DataContext has any read mapping.
mesh::PtrData _providedData
Unique data this context is associated with.
std::vector< MappingContext > _mappingContexts
Defines all mappings associated to this DataContext. A DataContext may also exist without a mapping.
void trimAfter(double time)
Removes stample before time and (if mapping exists) fromData or toData.
void resizeBufferTo(int size)
time::Sample _writeDataBuffer
Buffer to store written data until it is copied to _providedData->timeStepsStorage()
void writeGradientsIntoDataBuffer(::precice::span< const VertexID > vertices, ::precice::span< const double > gradients)
Store gradients in _writeDataBuffer.
static logging::Logger _log
void storeBufferedData(double currentTime)
Store data from _writeDataBuffer in persistent storage.
void resetBuffer()
Resets writeDataBuffer.
WriteDataContext(mesh::PtrData data, mesh::PtrMesh mesh)
Construct a new WriteDataContext object without a mapping.
void writeValuesIntoDataBuffer(::precice::span< const VertexID > vertices, ::precice::span< const double > values)
Store values in _writeDataBuffer.
void appendMappingConfiguration(MappingContext &mappingContext, const MeshContext &meshContext) override
Adds a MappingContext and the MeshContext required by the write mapping to the corresponding WriteDat...
A C++ 11 implementation of the non-owning C++20 std::span type.
constexpr pointer data() const noexcept
constexpr size_type size() const noexcept
void append(Eigen::VectorXd &v, double value)
Holds a data mapping and related information.
mesh::PtrData fromData
data which is mapped from mesh
mesh::PtrData toData
data which is mapped to mesh
Stores a mesh and related objects and data.
mesh::PtrMesh mesh
Mesh holding the geometry data structure.
Eigen::MatrixXd gradients
The gradients of the data. Use gradients.col(i) to get the gradient at vertex i.