67 for (
int i = 0; i < static_cast<int>(vertices.
size()); ++i) {
69 localData.col(vertices[i]) = inputData.col(i);
80 Eigen::Map<const Eigen::MatrixXd> inputGradients(gradients.
data(), gradientComponents, vertices.
size());
83 for (
int i = 0; i < static_cast<int>(vertices.
size()); ++i) {
85 localGradients.col(vertices[i]) = inputGradients.col(i);
95 const auto actualSize =
static_cast<SizeType
>(
_writeDataBuffer.values.size());
96 const auto change = expectedSize - actualSize;
130 mappingContext.
toData = data;
#define PRECICE_DEBUG(...)
#define PRECICE_TRACE(...)
#define PRECICE_ASSERT(...)
bool hasDataName(std::string_view dataName) const
Returns whether Mesh has Data with the dataName.
const DataContainer & data() const
Allows access to all data.
int getMeshVertexCount() const
Get the number of vertices of mesh.
bool hasWriteMapping() const
Informs the user whether this DataContext has any write mapping.
bool hasJustInTimeMapping() const
DataContext(mesh::PtrData data, mesh::PtrMesh mesh)
Construct a new DataContext without a mapping. Protected, because only ReadDataContext and WriteDataC...
mapping::PtrMapping justInTimeMapping
The just-in-time mapping for this data context.
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.
std::unique_ptr< mapping::impl::MappingDataCache > mappingCache
Cache for just-in-time mapping.
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
void invalidateMappingCacheAndResetData()
Resets the time stamp of the MappingDataCache and resets the data it holds.
std::vector< MappingContext > _mappingContexts
Defines all mappings associated to this DataContext. A DataContext may also exist without a mapping.
void completeJustInTimeMapping()
Evaluates the MappingDataCache and stores the result in the _writeDataBuffer.
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 resetBufferedData()
Resets the writeDataBuffer and the mapping data cache.
void writeAndMapValues(::precice::span< const double > coordinates, ::precice::span< const double > values)
Forwards the just-in-time mapping API call for writing data to the data context.
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
provides Mesh, Data and primitives.
std::shared_ptr< Data > PtrData
std::shared_ptr< Mesh > PtrMesh
contains the time interpolation logic.
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.