preCICE v3.1.2
|
Stores one Data object with related mesh. Context stores data to be read from and potentially provides a read mapping. Additionally stores Waveform object associated with _providedData. More...
#include <ReadDataContext.hpp>
Public Member Functions | |
ReadDataContext (mesh::PtrData data, mesh::PtrMesh mesh) | |
Construct a new ReadDataContext object without a mapping. | |
int | getWaveformDegree () const |
Gets degree of waveform. | |
void | appendMappingConfiguration (MappingContext &mappingContext, const MeshContext &meshContext) override |
Adds a MappingContext and the MeshContext required by the read mapping to the corresponding ReadDataContext data structures. | |
void | readValues (::precice::span< const VertexID > vertices, double time, ::precice::span< double > values) const |
Samples data at a given point in time within the current time window for given indices. | |
ReadDataContext (const ReadDataContext ©)=delete | |
Disable copy construction. | |
ReadDataContext & | operator= (const ReadDataContext &assign)=delete |
Disable assignment construction. | |
ReadDataContext (ReadDataContext &&)=default | |
Move constructor, use the implicitly declared. | |
ReadDataContext & | operator= (ReadDataContext &&)=default |
void | clearToDataFor (const cplscheme::ImplicitData &from) |
Removes all toData samples from mappings. | |
void | trimToDataAfterFor (const cplscheme::ImplicitData &from, double t) |
Trims all toData of associated mappings after the given t. | |
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) |
Static Private Attributes | |
static logging::Logger | _log {"impl::ReadDataContext"} |
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 read from and potentially provides a read mapping. Additionally stores Waveform object associated with _providedData.
Derived from DataContext
Definition at line 17 of file ReadDataContext.hpp.
precice::impl::ReadDataContext::ReadDataContext | ( | mesh::PtrData | data, |
mesh::PtrMesh | mesh ) |
Construct a new ReadDataContext object without a mapping.
data | Data associated with this ReadDataContext. |
mesh | Mesh associated with this ReadDataContext. |
Definition at line 7 of file ReadDataContext.cpp.
|
delete |
Disable copy construction.
|
default |
Move constructor, use the implicitly declared.
|
overridevirtual |
Adds a MappingContext and the MeshContext required by the read mapping to the corresponding ReadDataContext data structures.
A read mapping maps _fromData to _providedData. A ReadDataContext already has _providedData, but additionally requires _fromData.
[in] | mappingContext | Context of read mapping |
[in] | meshContext | Context of mesh this read mapping is mapping from (_fromData) |
Implements precice::impl::DataContext.
Definition at line 14 of file ReadDataContext.cpp.
void precice::impl::ReadDataContext::clearToDataFor | ( | const cplscheme::ImplicitData & | from | ) |
Removes all toData samples from mappings.
Definition at line 41 of file ReadDataContext.cpp.
int precice::impl::ReadDataContext::getWaveformDegree | ( | ) | const |
Gets degree of waveform.
Definition at line 36 of file ReadDataContext.cpp.
|
delete |
Disable assignment construction.
|
default |
void precice::impl::ReadDataContext::readValues | ( | ::precice::span< const VertexID > | vertices, |
double | time, | ||
::precice::span< double > | values ) const |
Samples data at a given point in time within the current time window for given indices.
[in] | vertices | vertex ids |
[in] | time | Point in time where waveform is sampled. |
[in] | values | read data associated with given indices for time time will be returned into this span |
Definition at line 26 of file ReadDataContext.cpp.
void precice::impl::ReadDataContext::trimToDataAfterFor | ( | const cplscheme::ImplicitData & | from, |
double | t ) |
Trims all toData of associated mappings after the given t.
[in] | t | the time after which to trim data |
Definition at line 57 of file ReadDataContext.cpp.
|
staticprivate |
Definition at line 80 of file ReadDataContext.hpp.