OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
olb::ConcreteParametersD< T, DESCRIPTOR, PLATFORM, PARAMETERS > Struct Template Referencefinal

Concrete storage of ParametersD in olb::Data. More...

#include <fieldParametersD.h>

+ Inheritance diagram for olb::ConcreteParametersD< T, DESCRIPTOR, PLATFORM, PARAMETERS >:
+ Collaboration diagram for olb::ConcreteParametersD< T, DESCRIPTOR, PLATFORM, PARAMETERS >:

Public Member Functions

 ConcreteParametersD (std::size_t)
 
AbstractParameters< T, DESCRIPTOR > & asAbstract () override
 Return abstract interface to host-side parameters.
 
void setProcessingContext (ProcessingContext context) override
 
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 ()
 

Public Attributes

ParametersD< T, DESCRIPTOR >::template include< PARAMETERS > parameters
 

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 &currentBlock, 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 &currentBlock, 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 &currentBlock, bool *&dataPtr, DataType *data, const size_t arrayLength, const bool loadingMode=false)
 Register an array of Serializable objects of constant size.
 

Detailed Description

template<typename T, typename DESCRIPTOR, Platform PLATFORM, typename PARAMETERS>
struct olb::ConcreteParametersD< T, DESCRIPTOR, PLATFORM, PARAMETERS >

Concrete storage of ParametersD in olb::Data.

AbstractParameters resp. ParametersD are not directly used in order to preserve a minimal cross-device implementation of this critical data structure.

Definition at line 215 of file fieldParametersD.h.

Constructor & Destructor Documentation

◆ ConcreteParametersD()

template<typename T , typename DESCRIPTOR , Platform PLATFORM, typename PARAMETERS >
olb::ConcreteParametersD< T, DESCRIPTOR, PLATFORM, PARAMETERS >::ConcreteParametersD ( std::size_t )
inline

Definition at line 219 of file fieldParametersD.h.

219 : // TODO: Implement more generic non-cellwise field allocation in Data
220 parameters{}
221 { }
ParametersD< T, DESCRIPTOR >::template include< PARAMETERS > parameters

Member Function Documentation

◆ asAbstract()

template<typename T , typename DESCRIPTOR , Platform PLATFORM, typename PARAMETERS >
AbstractParameters< T, DESCRIPTOR > & olb::ConcreteParametersD< T, DESCRIPTOR, PLATFORM, PARAMETERS >::asAbstract ( )
inlineoverridevirtual

Return abstract interface to host-side parameters.

Implements olb::AbstractedConcreteParameters< T, DESCRIPTOR >.

Definition at line 224 of file fieldParametersD.h.

224 {
225 return parameters;
226 }

References olb::ConcreteParametersD< T, DESCRIPTOR, PLATFORM, PARAMETERS >::parameters.

◆ getBlock()

template<typename T , typename DESCRIPTOR , Platform PLATFORM, typename PARAMETERS >
bool * olb::ConcreteParametersD< T, DESCRIPTOR, PLATFORM, PARAMETERS >::getBlock ( std::size_t iBlock,
std::size_t & sizeBlock,
bool loadingMode )
overridevirtual

Return a pointer to the memory of the current block and its size for the serializable interface.

Implements olb::Serializable.

Definition at line 49 of file fieldParametersD.hh.

51{
52 std::size_t currentBlock = 0;
53 bool* dataPtr = nullptr;
54 decltype(parameters)::fields_t::for_each([&](auto field) {
55 using field_t = typename decltype(field)::type;
56 if constexpr (DESCRIPTOR::template size<field_t>() == 1) {
57 registerVar(iBlock, sizeBlock, currentBlock, dataPtr,
58 parameters.template get<field_t>(), loadingMode);
59 } else {
60 registerSerializableOfConstSize(iBlock, sizeBlock, currentBlock, dataPtr,
61 parameters.template get<field_t>(), loadingMode);
62 }
63 });
64 return dataPtr;
65}
void registerVar(const std::size_t iBlock, std::size_t &sizeBlock, std::size_t &currentBlock, bool *&dataPtr, const DataType &data, const size_t arrayLength=1) const
Register primitive data types (int, double, ...) or arrays of those.
Definition serializer.h:212
void registerSerializableOfConstSize(const std::size_t iBlock, std::size_t &sizeBlock, std::size_t &currentBlock, bool *&dataPtr, DataType &data, const bool loadingMode=false)
Register Serializable object of constant size.
Definition serializer.h:239
std::enable_if_t< DESCRIPTOR::d==2, std::shared_ptr< SuperF2D< T > > > field(SuperLattice< T, DESCRIPTOR > &sLattice)
Returns external field functor.

◆ getNblock()

template<typename T , typename DESCRIPTOR , Platform PLATFORM, typename PARAMETERS >
std::size_t olb::ConcreteParametersD< T, DESCRIPTOR, PLATFORM, PARAMETERS >::getNblock ( ) const
overridevirtual

Number of data blocks for the serializable interface.

Implements olb::Serializable.

Definition at line 32 of file fieldParametersD.hh.

33{
34 return PARAMETERS::size;
35}

◆ getSerializableSize()

template<typename T , typename DESCRIPTOR , Platform PLATFORM, typename PARAMETERS >
std::size_t olb::ConcreteParametersD< T, DESCRIPTOR, PLATFORM, PARAMETERS >::getSerializableSize ( ) const
overridevirtual

Binary size for the serializer.

Implements olb::Serializable.

Definition at line 38 of file fieldParametersD.hh.

39{
40 std::size_t size = 0;
41 decltype(parameters)::fields_t::for_each([&size](auto field) {
42 using field_t = typename decltype(field)::type;
43 size += FieldD<T,DESCRIPTOR,field_t>{}.getSerializableSize();
44 });
45 return size;
46}

References olb::Vector< T, D >::getSerializableSize().

+ Here is the call graph for this function:

◆ setProcessingContext()

template<typename T , typename DESCRIPTOR , Platform PLATFORM, typename PARAMETERS >
void olb::ConcreteParametersD< T, DESCRIPTOR, PLATFORM, PARAMETERS >::setProcessingContext ( ProcessingContext context)
inlineoverridevirtual

Implements olb::AbstractedConcreteParameters< T, DESCRIPTOR >.

Definition at line 228 of file fieldParametersD.h.

228{ }

Member Data Documentation

◆ parameters

template<typename T , typename DESCRIPTOR , Platform PLATFORM, typename PARAMETERS >
ParametersD<T,DESCRIPTOR>::template include<PARAMETERS> olb::ConcreteParametersD< T, DESCRIPTOR, PLATFORM, PARAMETERS >::parameters

Definition at line 217 of file fieldParametersD.h.


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