preCICE v3.1.2
|
Stores one Data object with related mesh. Context stores data to be written to and potentially provides a write mapping. More...
#include <WriteDataContext.hpp>
Public Member Functions | |
WriteDataContext (mesh::PtrData data, mesh::PtrMesh mesh) | |
Construct a new WriteDataContext object without a mapping. | |
void | resetBuffer () |
Resets writeDataBuffer. | |
void | trimAfter (double time) |
Removes stample before time and (if mapping exists) fromData or toData. | |
void | writeValuesIntoDataBuffer (::precice::span< const VertexID > vertices, ::precice::span< const double > values) |
Store values in _writeDataBuffer. | |
void | writeGradientsIntoDataBuffer (::precice::span< const VertexID > vertices, ::precice::span< const double > gradients) |
Store gradients in _writeDataBuffer. | |
void | resizeBufferTo (int size) |
void | storeBufferedData (double currentTime) |
Store data from _writeDataBuffer in persistent storage. | |
void | appendMappingConfiguration (MappingContext &mappingContext, const MeshContext &meshContext) override |
Adds a MappingContext and the MeshContext required by the write mapping to the corresponding WriteDataContext data structures. | |
WriteDataContext (const WriteDataContext ©)=delete | |
Disable copy construction. | |
WriteDataContext & | operator= (const WriteDataContext &assign)=delete |
Disable assignment construction. | |
WriteDataContext (WriteDataContext &&)=default | |
Move constructor, use the implicitly declared. | |
WriteDataContext & | operator= (WriteDataContext &&)=default |
Public Member Functions inherited from precice::impl::DataContext | |
std::string | getDataName () const |
Get the Name of _providedData. | |
void | resetInitialGuesses () |
Resets initial guesses of transient mappings to zero. | |
int | getDataDimensions () const |
Get the dimensions of _providedData. | |
int | getSpatialDimensions () const |
Get the spatial dimensions of _providedData. | |
std::string | getMeshName () const |
Get the name of _mesh. | |
MeshID | getMeshID () const |
Get the ID of _mesh. | |
bool | hasGradient () const |
Returns whether _providedData has gradient. | |
int | mapData (std::optional< double > after=std::nullopt, bool skipZero=false) |
Perform the mapping for mapping contexts and the corresponding data context (from and to data) | |
bool | hasMapping () const |
Informs the user whether this DataContext has any _mappingContext. | |
template<typename Container > | |
std::optional< std::size_t > | locateInvalidVertexID (const Container &c) |
Private Attributes | |
time::Sample | _writeDataBuffer |
Buffer to store written data until it is copied to _providedData->timeStepsStorage() | |
Static Private Attributes | |
static logging::Logger | _log {"impl::WriteDataContext"} |
Additional Inherited Members | |
Protected Member Functions inherited from precice::impl::DataContext | |
DataContext (mesh::PtrData data, mesh::PtrMesh mesh) | |
Construct a new DataContext without a mapping. Protected, because only ReadDataContext and WriteDataContext should use this constructor. | |
void | appendMapping (MappingContext mappingContext) |
Helper to append a mappingContext, fromData and toData to the corresponding data containers. | |
bool | hasReadMapping () const |
Informs the user whether this DataContext has any read mapping. | |
bool | hasWriteMapping () const |
Informs the user whether this DataContext has any write mapping. | |
int | getMeshVertexCount () const |
Get the number of vertices of mesh. | |
bool | isValidVertexID (const VertexID id) const |
Returns true if the given vertexID is valid. | |
Protected Attributes inherited from precice::impl::DataContext | |
std::vector< MappingContext > | _mappingContexts |
Defines all mappings associated to this DataContext. A DataContext may also exist without a mapping. | |
mesh::PtrData | _providedData |
Unique data this context is associated with. | |
Stores one Data object with related mesh. Context stores data to be written to and potentially provides a write mapping.
Derived from DataContext
Definition at line 17 of file WriteDataContext.hpp.
precice::impl::WriteDataContext::WriteDataContext | ( | mesh::PtrData | data, |
mesh::PtrMesh | mesh ) |
Construct a new WriteDataContext object without a mapping.
data | Data associated with this WriteDataContext. |
mesh | Mesh associated with this WriteDataContext. |
Definition at line 9 of file WriteDataContext.cpp.
|
delete |
Disable copy construction.
|
default |
Move constructor, use the implicitly declared.
|
overridevirtual |
Adds a MappingContext and the MeshContext required by the write mapping to the corresponding WriteDataContext data structures.
A write mapping maps _providedData to _toData. A WriteDataContext already has _providedData, but additionally requires _toData.
[in] | mappingContext | Context of write mapping |
[in] | meshContext | Context of mesh this write mapping is mapping to (_toData) |
Implements precice::impl::DataContext.
Definition at line 107 of file WriteDataContext.cpp.
|
delete |
Disable assignment construction.
|
default |
void precice::impl::WriteDataContext::resetBuffer | ( | ) |
Resets writeDataBuffer.
Definition at line 16 of file WriteDataContext.cpp.
void precice::impl::WriteDataContext::resizeBufferTo | ( | int | size | ) |
void precice::impl::WriteDataContext::storeBufferedData | ( | double | currentTime | ) |
Store data from _writeDataBuffer in persistent storage.
[in] | currentTime | time data should be associated with |
Definition at line 102 of file WriteDataContext.cpp.
void precice::impl::WriteDataContext::trimAfter | ( | double | time | ) |
Removes stample before time and (if mapping exists) fromData or toData.
time | the point in time after which to remove samples |
Definition at line 22 of file WriteDataContext.cpp.
void precice::impl::WriteDataContext::writeGradientsIntoDataBuffer | ( | ::precice::span< const VertexID > | vertices, |
::precice::span< const double > | gradients ) |
Store gradients in _writeDataBuffer.
[in] | vertices | ids of data |
[in] | gradients | gradients of data |
Definition at line 47 of file WriteDataContext.cpp.
void precice::impl::WriteDataContext::writeValuesIntoDataBuffer | ( | ::precice::span< const VertexID > | vertices, |
::precice::span< const double > | values ) |
Store values in _writeDataBuffer.
[in] | vertices | ids of data |
[in] | values | values of data |
Definition at line 33 of file WriteDataContext.cpp.
|
staticprivate |
Definition at line 85 of file WriteDataContext.hpp.
|
private |
Buffer to store written data until it is copied to _providedData->timeStepsStorage()
Definition at line 88 of file WriteDataContext.hpp.