preCICE v3.2.0
Loading...
Searching...
No Matches
WriteDataContext.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <Eigen/Core>
4
5#include "DataContext.hpp"
6#include "logging/Logger.hpp"
7#include "time/Sample.hpp"
8
9namespace precice::impl {
10
17public:
25 mesh::PtrData data,
27
29 void resetBufferedData();
30
36 void trimAfter(double time);
37
56
70
78
86
87 void resizeBufferTo(int size);
88
94 void storeBufferedData(double currentTime);
95
104 void appendMappingConfiguration(MappingContext &mappingContext, const MeshContext &meshContext) override;
105
107 WriteDataContext(const WriteDataContext &copy) = delete;
108
111
115
116private:
118
121};
122
123} // namespace precice::impl
DataContext(mesh::PtrData data, mesh::PtrMesh mesh)
Construct a new DataContext without a mapping. Protected, because only ReadDataContext and WriteDataC...
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.
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.
WriteDataContext(const WriteDataContext &copy)=delete
Disable copy construction.
WriteDataContext(WriteDataContext &&)=default
Move constructor, use the implicitly declared.
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 & operator=(WriteDataContext &&)=default
WriteDataContext & operator=(const WriteDataContext &assign)=delete
Disable assignment construction.
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...
This class provides a lightweight logger.
Definition Logger.hpp:17
A C++ 11 implementation of the non-owning C++20 std::span type.
Definition span.hpp:284
provides Mesh, Data and primitives.
std::shared_ptr< Data > PtrData
std::shared_ptr< Mesh > PtrMesh
contains the time interpolation logic.
Definition Sample.hpp:8
Holds a data mapping and related information.
Stores a mesh and related objects and data.