![]() |
OpenLB 1.8.1
|
Implementation of BlockLattice on a concrete PLATFORM. More...
#include <blockLattice.h>
Inheritance diagram for olb::ConcreteBlockLattice< T, DESCRIPTOR, PLATFORM >:
Collaboration diagram for olb::ConcreteBlockLattice< T, DESCRIPTOR, PLATFORM >:Public Types | |
| using | value_t = T |
| using | descriptor_t = DESCRIPTOR |
Public Member Functions | |
| ConcreteBlockLattice (Vector< int, DESCRIPTOR::d > size, int padding=0) | |
| void | setProcessingContext (ProcessingContext context) override |
| Set processing context. | |
| ConcreteData< T, DESCRIPTOR, PLATFORM > & | getData () |
| 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 |
| void | collide () override |
| Apply collision step of non-overlap interior. | |
| void | stream () override |
| Perform propagation step on the whole block. | |
| void | setCollisionO (std::function< void(ConcreteBlockLattice &)> &&op) |
| Replace default collision logic of BlockDynamicsMap. | |
| BlockDynamicsMap< T, DESCRIPTOR, PLATFORM > & | getDynamicsMap () |
| Dynamics< T, DESCRIPTOR > * | getDynamics (CellID iCell) override |
| Get reference to dynamics of cell by index. | |
| void | setDynamics (CellID iCell, DynamicsPromise< T, DESCRIPTOR > &&promise) override |
| Set dynamics at iCell to promised dynamics. | |
| template<typename FIELD > | |
| void | setParameter (FieldD< T, DESCRIPTOR, FIELD > value) |
| template<typename PARAMETER , typename _DESCRIPTOR , Platform _PLATFORM, typename FIELD > | |
| void | setParameter (FieldArrayD< T, _DESCRIPTOR, _PLATFORM, FIELD > &fieldArray) |
| template<typename PARAMETER , typename _DESCRIPTOR , typename FIELD > | |
| void | setParameter (AbstractFieldArrayD< T, _DESCRIPTOR, FIELD > &abstractFieldArray) |
| bool | hasPostProcessor (std::type_index stage, PostProcessorPromise< T, DESCRIPTOR > &&promise) override |
| Returns true if stage contains post processor. | |
| void | addPostProcessor (std::type_index stage, LatticeR< DESCRIPTOR::d > latticeR, PostProcessorPromise< T, DESCRIPTOR > &&promise) override |
| Schedule post processor for application to latticeR in stage. | |
| void | addPostProcessor (std::type_index stage, BlockIndicatorF< T, DESCRIPTOR::d > &indicator, PostProcessorPromise< T, DESCRIPTOR > &&promise) override |
| Schedule post processor for application to indicated cells in stage. | |
| void | addPostProcessor (std::type_index stage, PostProcessorPromise< T, DESCRIPTOR > &&promise) override |
| Schedule post processor for application to entire block in stage. | |
| void | postProcess (std::type_index stage) override |
| Execute post processors of stage. | |
| Vector< T *, DESCRIPTOR::q > | getPopulationPointers (CellID iCell) override |
| Return pointers to population values of cell index iCell. | |
| auto & | getDataRegistry () |
| Return reference to Data's FieldTypeRegistry. | |
| void | writeDescription (std::ostream &clout) const override |
| Prints human-readable summary of all used dynamics and post processors. | |
| void | writeDynamicsAsCSV (std::ostream &clout) const override |
| Prints CSV-structured list of all used dynamics. | |
| void | writeOperatorAsCSV (std::ostream &clout) const override |
| Prints CSV-structured list of all used operators. | |
| 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::BlockLattice< T, DESCRIPTOR > | |
| BlockLattice (Vector< int, DESCRIPTOR::d > size, int padding, Platform platform) | |
| virtual | ~BlockLattice () |
| Platform | getPlatform () const |
| Return platform used to process lattice. | |
| template<Platform PLATFORM> | |
| ConcreteBlockLattice< 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 (FIELD field=FIELD{}) |
| Return abstract interface for FIELD array. | |
| Cell< T, DESCRIPTOR > | get (CellID iCell) |
| Get Cell interface for index iCell. | |
| ConstCell< T, DESCRIPTOR > | get (CellID iCell) const |
| Get ConstCell interface for index iCell. | |
| Cell< T, DESCRIPTOR > | get (LatticeR< DESCRIPTOR::d > loc) |
| Get Cell interface for location loc. | |
| ConstCell< T, DESCRIPTOR > | get (LatticeR< DESCRIPTOR::d > loc) const |
| Get ConstCell interface for location loc. | |
| template<typename... R> | |
| std::enable_if_t< sizeof...(R)==DESCRIPTOR::d, Cell< T, DESCRIPTOR > > | get (R... latticeR) |
| Get Cell interface for componentwise location latticeR. | |
| template<typename... R> | |
| std::enable_if_t< sizeof...(R)==DESCRIPTOR::d, ConstCell< T, DESCRIPTOR > > | get (R... latticeR) const |
| Get ConstCell interface for componentwise location latticeR. | |
| void | initialize () |
| Initialize the lattice cells to become ready for simulation. | |
| bool | statisticsEnabled () const |
| void | setStatisticsEnabled (bool state) |
| bool | isIntrospectable () const |
| void | setIntrospectability (bool state) |
| template<typename... R> | |
| std::enable_if_t< sizeof...(R)==DESCRIPTOR::d, Dynamics< T, DESCRIPTOR > * > | getDynamics (R... latticeR) |
| Return pointer to dynamics assigned to latticeR. | |
| void | defineDynamics (LatticeR< DESCRIPTOR::d > latticeR, DynamicsPromise< T, DESCRIPTOR > &&promise) |
| Assign promised DYNAMICS to latticeR. | |
| template<template< typename... > typename DYNAMICS> | |
| void | defineDynamics (LatticeR< DESCRIPTOR::d > latticeR) |
| Assign DYNAMICS to latticeR. | |
| template<typename DYNAMICS > | |
| void | defineDynamics () |
| Define DYNAMICS everywhere. | |
| template<typename DYNAMICS > | |
| void | defineDynamics (BlockIndicatorF< T, DESCRIPTOR::d > &indicator) |
| Define DYNAMICS on a domain described by an indicator. | |
| void | defineDynamics (BlockIndicatorF< T, DESCRIPTOR::d > &indicator, DynamicsPromise< T, DESCRIPTOR > &&promise) |
| Define promised dynamics on a domain described by an indicator. | |
| template<typename FIELD > | |
| void | setParameter (FieldD< T, DESCRIPTOR, FIELD > value) |
| Set value of parameter FIELD for any dynamics that provide it. | |
| template<typename PARAMETER , typename _DESCRIPTOR , typename FIELD > | |
| void | setParameter (AbstractFieldArrayD< T, _DESCRIPTOR, FIELD > &fieldArray) |
| template<typename PARAMETER , typename _DESCRIPTOR , Platform PLATFORM, typename FIELD > | |
| void | setParameter (FieldArrayD< T, _DESCRIPTOR, PLATFORM, FIELD > &fieldArray) |
| template<typename STAGE > | |
| void | postProcess () |
| Execute post processors of STAGE. | |
| template<typename FIELD > | |
| void | defineField (BlockIndicatorF< T, DESCRIPTOR::d > &indicator, AnalyticalF< DESCRIPTOR::d, T, T > &field) |
| Define a field on a domain described by an indicator. | |
| template<typename FIELD > | |
| void | defineField (BlockIndicatorF< T, DESCRIPTOR::d > &indicator, BlockF< T, DESCRIPTOR::d > &field) |
| Define a field on a domain described by an indicator. | |
| template<typename FIELD > | |
| void | defineField (BlockGeometry< T, DESCRIPTOR::d > &blockGeometry, IndicatorF< T, DESCRIPTOR::d > &indicatorF, AnalyticalF< DESCRIPTOR::d, T, T > &field) |
| Define a field on a domain described by an analytical indicator. | |
| void | defineRho (BlockIndicatorF< T, DESCRIPTOR::d > &indicator, AnalyticalF< DESCRIPTOR::d, T, T > &rho) |
| Define rho on a domain described by an indicator. | |
| void | defineU (BlockIndicatorF< T, DESCRIPTOR::d > &indicator, AnalyticalF< DESCRIPTOR::d, T, T > &u) |
| Define u on a domain described by an indicator. | |
| void | defineRhoU (BlockIndicatorF< T, DESCRIPTOR::d > &indicator, AnalyticalF< DESCRIPTOR::d, T, T > &rho, AnalyticalF< DESCRIPTOR::d, T, T > &u) |
| Define rho and u on a domain described by an indicator. | |
| void | definePopulations (BlockIndicatorF< T, DESCRIPTOR::d > &indicator, AnalyticalF< DESCRIPTOR::d, T, T > &Pop) |
| Define a population on a domain described by an indicator. | |
| void | definePopulations (BlockIndicatorF< T, DESCRIPTOR::d > &indicator, BlockF< T, DESCRIPTOR::d > &Pop) |
| void | iniEquilibrium (BlockIndicatorF< T, DESCRIPTOR::d > &indicator, AnalyticalF< DESCRIPTOR::d, T, T > &rho, AnalyticalF< DESCRIPTOR::d, T, T > &u) |
| Initialize by equilibrium on a domain described by an indicator. | |
| void | iniEquilibrium (BlockIndicatorF< T, DESCRIPTOR::d > &indicator, AnalyticalF< DESCRIPTOR::d, T, T > &rho, BlockF< T, DESCRIPTOR::d > &u) |
| void | iniRegularized (BlockIndicatorF< T, DESCRIPTOR::d > &indicator, AnalyticalF< DESCRIPTOR::d, T, T > &rho, AnalyticalF< DESCRIPTOR::d, T, T > &u, AnalyticalF< DESCRIPTOR::d, T, T > &pi) |
| Initialize by non- and equilibrium on a domain described by an indicator. | |
| void | stripeOffDensityOffset (T offset) |
| Subtract the given offset from all densities. | |
| LatticeStatistics< T > & | getStatistics () |
| Return a handle to the LatticeStatistics object. | |
| LatticeStatistics< T > const & | getStatistics () const |
| Return a constant handle to the LatticeStatistics object. | |
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::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::BlockLattice< T, DESCRIPTOR > | |
| const Platform | _platform |
| Platform used by the derived concrete lattice. | |
| bool | _statisticsEnabled |
| True if statistics are gathered during collide. | |
| LatticeStatistics< T > * | _statistics |
| bool | _introspectable |
| True for lattice that can be introspected. | |
Protected Attributes inherited from olb::BlockStructureD< D > | |
| LatticeR< D > | _core |
| LatticeR< D > | _size |
| LatticeR< D > | _projection |
| int | _padding |
Implementation of BlockLattice on a concrete PLATFORM.
Definition at line 37 of file communicator.h.
| using olb::ConcreteBlockLattice< T, DESCRIPTOR, PLATFORM >::descriptor_t = DESCRIPTOR |
Definition at line 481 of file blockLattice.h.
| using olb::ConcreteBlockLattice< T, DESCRIPTOR, PLATFORM >::value_t = T |
Definition at line 480 of file blockLattice.h.
| olb::ConcreteBlockLattice< T, DESCRIPTOR, PLATFORM >::ConcreteBlockLattice | ( | Vector< int, DESCRIPTOR::d > | size, |
| int | padding = 0 ) |
Definition at line 394 of file blockLattice.hh.
References olb::BlockStructureD< D >::getNcells().
Here is the call graph for this function:
|
inlineoverridevirtual |
Schedule post processor for application to indicated cells in stage.
Implements olb::BlockLattice< T, DESCRIPTOR >.
Definition at line 634 of file blockLattice.h.
References olb::ConcreteBlockLattice< T, DESCRIPTOR, PLATFORM >::addPostProcessor(), olb::BlockStructureD< D >::forCoreSpatialLocations(), and olb::PerBlock.
Here is the call graph for this function:
|
inlineoverridevirtual |
Schedule post processor for application to latticeR in stage.
Implements olb::BlockLattice< T, DESCRIPTOR >.
Definition at line 625 of file blockLattice.h.
Here is the caller graph for this function:
|
inlineoverridevirtual |
Schedule post processor for application to entire block in stage.
Implements olb::BlockLattice< T, DESCRIPTOR >.
Definition at line 652 of file blockLattice.h.
References olb::ConcreteBlockLattice< T, DESCRIPTOR, PLATFORM >::addPostProcessor(), olb::BlockStructureD< D >::forCoreSpatialLocations(), and olb::PerBlock.
Here is the call graph for this function:
|
overridevirtual |
Apply collision step of non-overlap interior.
Implements olb::BlockLattice< T, DESCRIPTOR >.
Definition at line 304 of file blockLattice.hh.
References olb::Dominant, olb::Individual, and olb::isPlatformCPU().
Here is the call graph for this function:
Here is the caller graph for this function:
|
overridevirtual |
Return a pointer to the memory of the current block and its size for the serializable interface.
Implements olb::Serializable.
Definition at line 622 of file blockLattice.hh.
|
inlineoverridevirtual |
Implements olb::BlockLattice< T, DESCRIPTOR >.
Definition at line 518 of file blockLattice.h.
Here is the caller graph for this function:
|
inline |
Definition at line 499 of file blockLattice.h.
Here is the caller graph for this function:| auto & olb::ConcreteBlockLattice< T, DESCRIPTOR, PLATFORM >::getData | ( | ) |
Definition at line 436 of file blockLattice.hh.
| const auto & olb::ConcreteBlockLattice< T, DESCRIPTOR, PLATFORM >::getData | ( | ) | const |
Definition at line 427 of file blockLattice.hh.
References OLB_ASSERT.
|
inline |
Return reference to Data's FieldTypeRegistry.
Only of interest for implementing specific device support
Definition at line 683 of file blockLattice.h.
References olb::ConcreteData< T, DESCRIPTOR, PLATFORM >::getRegistry().
Here is the call graph for this function:
|
inlineoverridevirtual |
Get reference to dynamics of cell by index.
Implements olb::BlockLattice< T, DESCRIPTOR >.
Definition at line 550 of file blockLattice.h.
References olb::BlockDynamicsMap< T, DESCRIPTOR, PLATFORM >::get().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Definition at line 545 of file blockLattice.h.
| auto & olb::ConcreteBlockLattice< T, DESCRIPTOR, PLATFORM >::getField | ( | FIELD | field = FIELD() | ) |
Definition at line 462 of file blockLattice.hh.
| const auto & olb::ConcreteBlockLattice< T, DESCRIPTOR, PLATFORM >::getField | ( | FIELD | field = FIELD() | ) | const |
Definition at line 474 of file blockLattice.hh.
Here is the caller graph for this function:
|
overridevirtual |
Number of data blocks for the serializable interface.
Implements olb::Serializable.
Definition at line 610 of file blockLattice.hh.
|
inlineoverridevirtual |
Return pointers to population values of cell index iCell.
Performance optimization for access via virtual Cell
Implements olb::BlockLattice< T, DESCRIPTOR >.
Definition at line 672 of file blockLattice.h.
References olb::ConcreteBlockLattice< T, DESCRIPTOR, PLATFORM >::getField().
Here is the call graph for this function:
|
overridevirtual |
Binary size for the serializer.
Implements olb::Serializable.
Definition at line 616 of file blockLattice.hh.
|
inlineoverridevirtual |
Implements olb::BlockLattice< T, DESCRIPTOR >.
Definition at line 515 of file blockLattice.h.
| bool olb::ConcreteBlockLattice< T, DESCRIPTOR, PLATFORM >::hasData | ( | ) | const |
Definition at line 420 of file blockLattice.hh.
|
inlineoverridevirtual |
Returns true if stage contains post processor.
Implements olb::BlockLattice< T, DESCRIPTOR >.
Definition at line 617 of file blockLattice.h.
|
overridevirtual |
Reinit population structure after deserialization.
Reimplemented from olb::Serializable.
Definition at line 633 of file blockLattice.hh.
|
overridevirtual |
Execute post processors of stage.
Implements olb::BlockLattice< T, DESCRIPTOR >.
Definition at line 485 of file blockLattice.hh.
Here is the caller graph for this function:
|
inline |
Replace default collision logic of BlockDynamicsMap.
May be used to inject domain knowledge for improving performance by e.g. reducing the need to use virtual dispatching for non-dominant dynamics. This is necessarily platform specific.
Definition at line 541 of file blockLattice.h.
|
inlineoverridevirtual |
Set dynamics at iCell to promised dynamics.
Implements olb::BlockLattice< T, DESCRIPTOR >.
Definition at line 555 of file blockLattice.h.
References olb::BlockLattice< T, DESCRIPTOR >::get(), olb::ConcreteBlockLattice< T, DESCRIPTOR, PLATFORM >::getDynamics(), and olb::BlockDynamicsMap< T, DESCRIPTOR, PLATFORM >::set().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Definition at line 594 of file blockLattice.h.
References olb::CPU_SIMD, olb::CPU_SISD, olb::AbstractFieldArrayD< T, DESCRIPTOR, FIELD >::getPlatform(), and olb::ConcreteBlockLattice< T, DESCRIPTOR, PLATFORM >::setParameter().
Here is the call graph for this function:
|
inline |
Definition at line 575 of file blockLattice.h.
References olb::ColumnVector< COLUMN, D >::d, olb::GPU_CUDA, and olb::ConcreteBlockLattice< T, DESCRIPTOR, PLATFORM >::setParameter().
Here is the call graph for this function:
|
inline |
Definition at line 563 of file blockLattice.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::BlockLattice< T, DESCRIPTOR >.
Definition at line 495 of file blockLattice.h.
References olb::ConcreteData< T, DESCRIPTOR, PLATFORM >::setProcessingContext().
Here is the call graph for this function:
|
overridevirtual |
Perform propagation step on the whole block.
Rotates the cyclic arrays storing the POPULATION field to perform implicit propagation using the PS pattern.
Implements olb::BlockLattice< T, DESCRIPTOR >.
Definition at line 318 of file blockLattice.hh.
References olb::descriptors::c(), and olb::GPU_CUDA.
Here is the call graph for this function:
|
overridevirtual |
Prints human-readable summary of all used dynamics and post processors.
Implements olb::BlockLattice< T, DESCRIPTOR >.
Definition at line 493 of file blockLattice.hh.
|
overridevirtual |
Prints CSV-structured list of all used dynamics.
Used as input for automatic code generation
Implements olb::BlockLattice< T, DESCRIPTOR >.
Definition at line 549 of file blockLattice.hh.
|
overridevirtual |
Prints CSV-structured list of all used operators.
Used as input for automatic code generation
Implements olb::BlockLattice< T, DESCRIPTOR >.
Definition at line 582 of file blockLattice.hh.
References olb::fields::name().
Here is the call graph for this function:
|
staticconstexpr |
Definition at line 488 of file blockLattice.h.