![]() |
OpenLB 1.8.1
|
Implementation of BlockD on a concrete PLATFORM. More...
#include <blockD.h>
Inheritance diagram for olb::ConcreteBlockD< T, DESCRIPTOR, PLATFORM >:
Collaboration diagram for olb::ConcreteBlockD< T, DESCRIPTOR, PLATFORM >:Public Types | |
| using | value_t = T |
| using | descriptor_t = DESCRIPTOR |
Public Member Functions | |
| ConcreteBlockD (Vector< int, DESCRIPTOR::d > size, int padding=0) | |
| void | setProcessingContext (ProcessingContext context) override |
| Set processing context. | |
| void | resize (Vector< int, DESCRIPTOR::d > size) override |
| template<typename FIELD_TYPE > | |
| bool | hasData () const |
| template<typename FIELD_TYPE > | |
| const auto & | getData () const |
| template<typename FIELD_TYPE > | |
| auto & | getData () |
| template<typename FIELD > | |
| const auto & | getField (FIELD field=FIELD()) const |
| template<typename FIELD > | |
| auto & | getField (FIELD field=FIELD()) |
| bool | hasCommunicatable (std::type_index field) const override |
| Communicatable & | getCommunicatable (std::type_index field) override |
| template<typename FIELD > | |
| void | setParameter (FieldD< T, DESCRIPTOR, FIELD > value) |
| template<typename PARAMETER , Platform _PLATFORM, typename FIELD > | |
| void | setParameter (FieldArrayD< T, DESCRIPTOR, _PLATFORM, FIELD > &fieldArray) |
| template<typename PARAMETER , typename FIELD > | |
| void | setParameter (AbstractFieldArrayD< T, DESCRIPTOR, FIELD > &abstractFieldArray) |
| auto & | getDataRegistry () |
| Return reference to Data's FieldTypeRegistry. | |
| template<typename OPERATOR > | |
| void | apply () |
| 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. | |
| void | postLoad () override |
| Reinit population structure after deserialization. | |
Public Member Functions inherited from olb::BlockD< T, DESCRIPTOR > | |
| BlockD (Vector< int, DESCRIPTOR::d > size, int padding, Platform platform) | |
| virtual | ~BlockD () |
| Platform | getPlatform () const |
| Return platform used to process lattice. | |
| template<Platform PLATFORM> | |
| ConcreteBlockD< T, DESCRIPTOR, PLATFORM > & | asConcrete () |
| template<typename FIELD_TYPE > | |
| bool | hasData () |
| Return whether FIELD_TYPE is available / has been allocated. | |
| template<typename FIELD_TYPE > | |
| const auto & | getData (FIELD_TYPE field=FIELD_TYPE{}) const |
| Return abstract interface for concrete FIELD_TYPE data. | |
| template<typename FIELD_TYPE > | |
| auto & | getData (FIELD_TYPE field=FIELD_TYPE{}) |
| Return abstract interface for concrete FIELD_TYPE data. | |
| template<typename FIELD > | |
| const auto & | getField (FIELD field=FIELD{}) const |
| Return abstract interface for FIELD array. | |
| template<typename FIELD > | |
| auto | getField (LatticeR< DESCRIPTOR::d > loc) const |
| Return value of FIELD at loc. | |
| template<typename FIELD > | |
| auto & | getField (FIELD field=FIELD{}) |
| Return abstract interface for FIELD array. | |
| template<typename FIELD > | |
| void | setField (LatticeR< DESCRIPTOR::d > loc, const FieldD< T, DESCRIPTOR, FIELD > &fieldD) |
| Set FIELD to fieldD at loc. | |
| template<typename FIELD > | |
| void | setParameter (FieldD< T, DESCRIPTOR, FIELD > value) |
| Set value of parameter FIELD. | |
| template<typename PARAMETER , typename FIELD > | |
| void | setParameter (AbstractFieldArrayD< T, DESCRIPTOR, FIELD > &fieldArray) |
| template<typename PARAMETER , Platform PLATFORM, typename FIELD > | |
| void | setParameter (FieldArrayD< T, DESCRIPTOR, PLATFORM, FIELD > &fieldArray) |
| BlockLatticeRowView< T, DESCRIPTOR > | get (std::size_t iCell) |
| template<typename OPERATOR > | |
| void | apply () |
Public Member Functions inherited from olb::BlockStructureD< D > | |
| BlockStructureD (Vector< int, D > size, int padding=0) | |
| BlockStructureD () | |
| void | resize (Vector< int, D > size) |
| auto | getCore () const |
| int | getNx () const |
| Read only access to block width. | |
| int | getNy () const |
| Read only access to block height. | |
| int | getNz () const |
| Read only access to block height. | |
| LatticeR< D > | getExtent () const |
| int | getPadding () const |
| Read only access to padding. | |
| std::size_t | getNcells () const |
| Get number of cells. | |
| CellID | getCellId (LatticeR< D > latticeR) const |
| Get 1D cell ID. | |
| template<typename... L> | |
| std::enable_if_t< sizeof...(L)==D, CellID > | getCellId (L... latticeR) const |
| LatticeR< D > | getLatticeR (CellID iCell) const |
| CellDistance | getNeighborDistance (LatticeR< D > dir) const |
| Get 1D neighbor distance. | |
| bool | isInside (LatticeR< D > latticeR) const |
| Return whether location is valid. | |
| bool | isInsideCore (LatticeR< D > latticeR) const |
| Return whether location is inside core. | |
| bool | isPadding (LatticeR< D > latticeR) const |
| Return whether location is valid. | |
| bool | isPadding (LatticeR< D > latticeR, int overlap) const |
| bool | isPadding (CellID iCell) const |
| template<typename... L> | |
| std::enable_if_t< sizeof...(L)==D, bool > | isInside (L... latticeR) const |
| CellDistance | getNeighborhoodRadius (LatticeR< D > latticeR) const |
| Return maximum valid neighborhood sphere radius w.r.t. latticeR. | |
| template<typename F > | |
| void | forSpatialLocations (F f) const |
| template<typename F > | |
| void | forSpatialLocationsParallel (F f) const |
| template<typename F > | |
| void | forSpatialLocations (LatticeR< D > min, LatticeR< D > max, F f) const |
| template<typename F > | |
| void | forCoreSpatialLocations (F f) const |
| template<typename F > | |
| void | forCellIndices (F f) const |
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 | |
Static Public Attributes | |
| static constexpr Platform | platform = PLATFORM |
Additional Inherited Members | |
Protected Member Functions inherited from olb::BlockD< T, DESCRIPTOR > | |
| template<typename F > | |
| auto | dispatch (F &&f) const |
| Calls f on concrete implementation of the BlockD interface. | |
| template<typename F > | |
| auto | dispatch (F &&f) |
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. | |
Protected Attributes inherited from olb::BlockD< T, DESCRIPTOR > | |
| const Platform | _platform |
Protected Attributes inherited from olb::BlockStructureD< D > | |
| LatticeR< D > | _core |
| LatticeR< D > | _size |
| LatticeR< D > | _projection |
| int | _padding |
Implementation of BlockD on a concrete PLATFORM.
| using olb::ConcreteBlockD< T, DESCRIPTOR, PLATFORM >::descriptor_t = DESCRIPTOR |
| using olb::ConcreteBlockD< T, DESCRIPTOR, PLATFORM >::value_t = T |
| olb::ConcreteBlockD< T, DESCRIPTOR, PLATFORM >::ConcreteBlockD | ( | Vector< int, DESCRIPTOR::d > | size, |
| int | padding = 0 ) |
Definition at line 43 of file blockD.hh.
References olb::BlockD< T, DESCRIPTOR >::get().
Here is the call graph for this function:
|
inline |
Definition at line 335 of file blockD.h.
References OPERATOR, and olb::PerBlock.
|
overridevirtual |
Return a pointer to the memory of the current block and its size for the serializable interface.
Implements olb::Serializable.
Definition at line 145 of file blockD.hh.
|
inlineoverridevirtual |
Implements olb::BlockD< T, DESCRIPTOR >.
Definition at line 286 of file blockD.h.
| auto & olb::ConcreteBlockD< T, DESCRIPTOR, PLATFORM >::getData | ( | ) |
Definition at line 84 of file blockD.hh.
| const auto & olb::ConcreteBlockD< T, DESCRIPTOR, PLATFORM >::getData | ( | ) | const |
Definition at line 75 of file blockD.hh.
References OLB_ASSERT.
|
inline |
Return reference to Data's FieldTypeRegistry.
Only of interest for implementing specific device support
Definition at line 330 of file blockD.h.
References olb::ConcreteData< T, DESCRIPTOR, PLATFORM >::getRegistry().
Here is the call graph for this function:| auto & olb::ConcreteBlockD< T, DESCRIPTOR, PLATFORM >::getField | ( | FIELD | field = FIELD() | ) |
Definition at line 110 of file blockD.hh.
| const auto & olb::ConcreteBlockD< T, DESCRIPTOR, PLATFORM >::getField | ( | FIELD | field = FIELD() | ) | const |
Definition at line 122 of file blockD.hh.
|
overridevirtual |
Number of data blocks for the serializable interface.
Implements olb::Serializable.
Definition at line 133 of file blockD.hh.
|
overridevirtual |
Binary size for the serializer.
Implements olb::Serializable.
Definition at line 139 of file blockD.hh.
|
inlineoverridevirtual |
Implements olb::BlockD< T, DESCRIPTOR >.
Definition at line 283 of file blockD.h.
| bool olb::ConcreteBlockD< T, DESCRIPTOR, PLATFORM >::hasData | ( | ) | const |
|
overridevirtual |
Reinit population structure after deserialization.
Reimplemented from olb::Serializable.
Definition at line 154 of file blockD.hh.
|
overridevirtual |
Implements olb::BlockD< T, DESCRIPTOR >.
Definition at line 60 of file blockD.hh.
Here is the caller graph for this function:
|
inline |
Definition at line 320 of file blockD.h.
References olb::ConcreteBlockD< T, DESCRIPTOR, PLATFORM >::setParameter().
Here is the call graph for this function:
|
inline |
Definition at line 303 of file blockD.h.
References olb::ColumnVector< COLUMN, D >::d, olb::GPU_CUDA, and olb::ConcreteBlockD< T, DESCRIPTOR, PLATFORM >::setParameter().
Here is the call graph for this function:
|
inline |
Definition at line 291 of file blockD.h.
References olb::Simulation.
Here is the caller graph for this function:
|
inlineoverridevirtual |
Set processing context.
This is currently used to trigger data transfers between host and GPU data for Platform::GPU_CUDA.
Implements olb::BlockD< T, DESCRIPTOR >.
Definition at line 265 of file blockD.h.
References olb::ConcreteData< T, DESCRIPTOR, PLATFORM >::setProcessingContext().
Here is the call graph for this function:
Here is the caller graph for this function:
|
staticconstexpr |