preCICE v3.1.2
Loading...
Searching...
No Matches
Public Member Functions | Static Private Attributes | List of all members
precice::impl::ReadDataContext Class Reference

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>

Inheritance diagram for precice::impl::ReadDataContext:
[legend]
Collaboration diagram for precice::impl::ReadDataContext:
[legend]

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 &copy)=delete
 Disable copy construction.
 
ReadDataContextoperator= (const ReadDataContext &assign)=delete
 Disable assignment construction.
 
 ReadDataContext (ReadDataContext &&)=default
 Move constructor, use the implicitly declared.
 
ReadDataContextoperator= (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_tlocateInvalidVertexID (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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ReadDataContext() [1/3]

precice::impl::ReadDataContext::ReadDataContext ( mesh::PtrData data,
mesh::PtrMesh mesh )

Construct a new ReadDataContext object without a mapping.

Parameters
dataData associated with this ReadDataContext.
meshMesh associated with this ReadDataContext.

Definition at line 7 of file ReadDataContext.cpp.

◆ ReadDataContext() [2/3]

precice::impl::ReadDataContext::ReadDataContext ( const ReadDataContext & copy)
delete

Disable copy construction.

◆ ReadDataContext() [3/3]

precice::impl::ReadDataContext::ReadDataContext ( ReadDataContext && )
default

Move constructor, use the implicitly declared.

Member Function Documentation

◆ appendMappingConfiguration()

void precice::impl::ReadDataContext::appendMappingConfiguration ( MappingContext & mappingContext,
const MeshContext & meshContext )
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.

Parameters
[in]mappingContextContext of read mapping
[in]meshContextContext of mesh this read mapping is mapping from (_fromData)
Note
Note that read mapping contexts have to be unique and and this function may only be called once for a given ReadDataContext

Implements precice::impl::DataContext.

Definition at line 14 of file ReadDataContext.cpp.

Here is the call graph for this function:

◆ clearToDataFor()

void precice::impl::ReadDataContext::clearToDataFor ( const cplscheme::ImplicitData & from)

Removes all toData samples from mappings.

Definition at line 41 of file ReadDataContext.cpp.

Here is the call graph for this function:

◆ getWaveformDegree()

int precice::impl::ReadDataContext::getWaveformDegree ( ) const

Gets degree of waveform.

Returns
int degree of waveform

Definition at line 36 of file ReadDataContext.cpp.

◆ operator=() [1/2]

ReadDataContext & precice::impl::ReadDataContext::operator= ( const ReadDataContext & assign)
delete

Disable assignment construction.

◆ operator=() [2/2]

ReadDataContext & precice::impl::ReadDataContext::operator= ( ReadDataContext && )
default

◆ readValues()

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.

Parameters
[in]verticesvertex ids
[in]timePoint in time where waveform is sampled.
[in]valuesread data associated with given indices for time time will be returned into this span

Definition at line 26 of file ReadDataContext.cpp.

Here is the call graph for this function:

◆ trimToDataAfterFor()

void precice::impl::ReadDataContext::trimToDataAfterFor ( const cplscheme::ImplicitData & from,
double t )

Trims all toData of associated mappings after the given t.

Parameters
[in]tthe time after which to trim data

Definition at line 57 of file ReadDataContext.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ _log

logging::Logger precice::impl::ReadDataContext::_log {"impl::ReadDataContext"}
staticprivate

Definition at line 80 of file ReadDataContext.hpp.


The documentation for this class was generated from the following files: