OpenLB 1.7
|
Storage of any FIELD_TYPE data on PLATFORM. More...
#include <data.h>
Public Member Functions | |
template<typename FIELD_TYPE > | |
bool | provides () const |
Returns true iff FIELD_TYPE is allocated and can be accessed. | |
template<typename FIELD_TYPE , typename... ARGS> | |
auto & | allocate (ARGS &&... args) |
Allocate and return FIELD_TYPE data. | |
template<typename FIELD_TYPE > | |
void | setSerialization (bool active) |
Sets FIELD_TYPE serialization state to active. | |
template<typename FIELD_TYPE > | |
auto & | get () |
Return reference to data of FIELD_TYPE. | |
template<typename FIELD > | |
FieldArrayD< T, DESCRIPTOR, PLATFORM, FIELD > & | getFieldArray () |
Return reference to data of Array<FIELD>, i.e. FieldArrayD<FIELD> | |
void | setProcessingContext (ProcessingContext context) |
template<typename F > | |
void | forEach (F f) |
Call f for each managed AnyFieldType. | |
template<typename TYPE , typename F > | |
void | forEachCastable (F f) |
Call f for each managed AnyFieldType of TYPE. | |
auto & | getRegistry () |
Expose FieldTypeRegistry for device-support. | |
std::size_t | getNblock () const override |
Number of data blocks for the serializable interface. | |
std::size_t | getSerializableSize () const override |
Binary size for the serializer. | |
bool * | getBlock (std::size_t iBlock, std::size_t &sizeBlock, bool loadingMode) override |
Return a pointer to the memory of the current block and its size for the serializable interface. | |
Public Member Functions inherited from olb::Serializable | |
virtual | ~Serializable ()=default |
template<bool includeLogOutputDir = true> | |
bool | save (std::string fileName="", const bool enforceUint=false) |
Save Serializable into file fileName | |
template<bool includeLogOutputDir = true> | |
bool | load (std::string fileName="", const bool enforceUint=false) |
Load Serializable from file fileName | |
bool | save (std::uint8_t *buffer) |
Save Serializable into buffer of length getSerializableSize | |
bool | load (const std::uint8_t *buffer) |
Load Serializable from buffer of length getSerializableSize | |
virtual void | postLoad () |
Additional Inherited Members | |
Protected Member Functions inherited from olb::Serializable | |
template<typename DataType > | |
void | registerVar (const std::size_t iBlock, std::size_t &sizeBlock, std::size_t ¤tBlock, bool *&dataPtr, const DataType &data, const size_t arrayLength=1) const |
Register primitive data types (int , double , ...) or arrays of those. | |
template<typename DataType > | |
void | registerSerializableOfConstSize (const std::size_t iBlock, std::size_t &sizeBlock, std::size_t ¤tBlock, bool *&dataPtr, DataType &data, const bool loadingMode=false) |
Register Serializable object of constant size. | |
template<typename DataType > | |
void | registerSerializablesOfConstSize (const std::size_t iBlock, std::size_t &sizeBlock, std::size_t ¤tBlock, bool *&dataPtr, DataType *data, const size_t arrayLength, const bool loadingMode=false) |
Register an array of Serializable objects of constant size. | |
Storage of any FIELD_TYPE data on PLATFORM.
Manages access and serialization of dynamically allocated FIELD_TYPE data. This is the core storage class used for ConcreteBlockLattice on any platform supported by OpenLB.
|
inline |
Allocate and return FIELD_TYPE data.
Must only be called once for each FIELD_TYPE
Definition at line 176 of file data.h.
References olb::Data< T, DESCRIPTOR, PLATFORM >::get().
|
inline |
Call f for each managed AnyFieldType.
Definition at line 223 of file data.h.
|
inline |
Call f for each managed AnyFieldType of TYPE.
Used to e.g. iterate over all field arrays
Definition at line 234 of file data.h.
References olb::Data< T, DESCRIPTOR, PLATFORM >::forEach().
|
overridevirtual |
Return a pointer to the memory of the current block and its size for the serializable interface.
Implements olb::Serializable.
Definition at line 277 of file data.h.
|
inline |
Return reference to data of Array<FIELD>, i.e. FieldArrayD<FIELD>
Most common field type, used for any lattice structured data in ConcreteBlockLattice
Definition at line 211 of file data.h.
|
overridevirtual |
Number of data blocks for the serializable interface.
Implements olb::Serializable.
Definition at line 257 of file data.h.
|
inline |
Expose FieldTypeRegistry for device-support.
Definition at line 243 of file data.h.
|
overridevirtual |
Binary size for the serializer.
Implements olb::Serializable.
Definition at line 267 of file data.h.
|
inline |
Definition at line 215 of file data.h.
|
inline |
Sets FIELD_TYPE serialization state to active.
By default Data doesn't (de)serialize any fields but ConcreteBlockLattice sets all descriptor-declared field arrays to active.
Definition at line 192 of file data.h.