OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
olb::BlockLattice< T, DESCRIPTOR > Class Template Referenceabstract

Platform-abstracted block lattice for external access and inter-block interaction. More...

#include <blockLattice.h>

+ Inheritance diagram for olb::BlockLattice< T, DESCRIPTOR >:
+ Collaboration diagram for olb::BlockLattice< T, DESCRIPTOR >:

Public Member Functions

 BlockLattice (Vector< int, DESCRIPTOR::d > size, int padding, Platform platform)
 
virtual ~BlockLattice ()
 
virtual void collide ()=0
 Execute the collide step on the non-overlapping block cells.
 
virtual void stream ()=0
 Apply the streaming step to the entire block.
 
virtual void setProcessingContext (ProcessingContext)=0
 Set processing context.
 
virtual Vector< T *, DESCRIPTOR::q > getPopulationPointers (CellID iCell)=0
 Returns pointers to host-side population locations of iCell.
 
Platform getPlatform () const
 Return platform used to process lattice.
 
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)
 
virtual void setDynamics (CellID iCell, DynamicsPromise< T, DESCRIPTOR > &&)=0
 Set dynamics at iCell to promised dynamics.
 
virtual void setDynamics (CellID iCell, Dynamics< T, DESCRIPTOR > *)=0
 
virtual Dynamics< T, DESCRIPTOR > * getDynamics (DynamicsPromise< T, DESCRIPTOR > &&)=0
 Return pointer to dynamics yielded by promise.
 
template<typename DYNAMICS >
Dynamics< T, DESCRIPTOR > * getDynamics ()
 Return pointer to DYNAMICS (legacy)
 
virtual Dynamics< T, DESCRIPTOR > * getDynamics (CellID iCell)=0
 Return pointer to dynamics at iCell.
 
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 > typename DYNAMICS>
void defineDynamics (LatticeR< DESCRIPTOR::d > latticeR)
 Assign DYNAMICS to latticeR.
 
void defineDynamics (LatticeR< DESCRIPTOR::d > latticeR, Dynamics< T, DESCRIPTOR > *dynamics)
 Assign dynamics to latticeR via pointer (legacy)
 
void defineDynamics (BlockIndicatorF< T, DESCRIPTOR::d > &indicator, Dynamics< T, DESCRIPTOR > *dynamics)
 Define the dynamics on a domain described by an indicator.
 
template<typename DYNAMICS >
void defineDynamics (BlockIndicatorF< T, DESCRIPTOR::d > &indicator)
 Define DYNAMICS on a domain described by an indicator.
 
void defineDynamics (Dynamics< T, DESCRIPTOR > *dynamics)
 Define the same dynamics on all cells.
 
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 FIELD >
void setParameter (AbstractFieldArrayD< T, DESCRIPTOR, FIELD > &fieldArray)
 
template<typename PARAMETER , Platform PLATFORM, typename FIELD >
void setParameter (FieldArrayD< T, DESCRIPTOR, PLATFORM, FIELD > &fieldArray)
 
virtual bool hasPostProcessor (std::type_index stage, PostProcessorPromise< T, DESCRIPTOR > &&promise)=0
 Returns true if stage contains post processor.
 
virtual void addPostProcessor (std::type_index stage, LatticeR< DESCRIPTOR::d > latticeR, PostProcessorPromise< T, DESCRIPTOR > &&promise)=0
 Schedule post processor for application to latticeR in stage.
 
virtual void addPostProcessor (std::type_index stage, PostProcessorPromise< T, DESCRIPTOR > &&promise)=0
 Schedule post processor for application to entire block in stage.
 
virtual void addPostProcessor (std::type_index stage, BlockIndicatorF< T, DESCRIPTOR::d > &indicator, PostProcessorPromise< T, DESCRIPTOR > &&promise)=0
 Schedule post processor for application to indicated cells in stage.
 
virtual void addPostProcessor (std::type_index stage, PostProcessor< T, DESCRIPTOR > *postProcessor)=0
 Schedule legacy post processor for application in stage.
 
virtual void addPostProcessor (std::type_index stage, const PostProcessorGenerator< T, DESCRIPTOR > &ppGen)=0
 Schedule legacy post processor in stage.
 
virtual void addPostProcessor (std::type_index stage, BlockIndicatorF< T, DESCRIPTOR::d > &indicator, const PostProcessorGenerator< T, DESCRIPTOR > &ppGen)=0
 Schedule legacy post processor for application to indicated cells in stage.
 
template<typename STAGE = stage::PostStream>
void addPostProcessor (PostProcessor< T, DESCRIPTOR > *postProcessor)
 Schedule legacy post processor for application in STAGE.
 
template<typename STAGE = stage::PostStream>
void addPostProcessor (const PostProcessorGenerator< T, DESCRIPTOR > &ppGen)
 Schedule legacy post processor for application in STAGE.
 
template<typename STAGE = stage::PostStream>
void addPostProcessor (BlockIndicatorF< T, DESCRIPTOR::d > &indicator, const PostProcessorGenerator< T, DESCRIPTOR > &ppGen)
 Schedule legacy post processor for application to indicated cells in STAGE.
 
virtual void postProcess (std::type_index stage=typeid(stage::PostStream))=0
 Execute post processors of stage.
 
template<typename STAGE >
void postProcess ()
 Execute post processors of STAGE.
 
virtual bool hasCommunicatable (std::type_index) const =0
 
virtual CommunicatablegetCommunicatable (std::type_index)=0
 
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.
 
void addLatticeCoupling (LatticeCouplingGenerator< T, DESCRIPTOR > const &lcGen, std::vector< BlockStructureD< DESCRIPTOR::d > * > partners)
 Add a non-local post-processing step (legacy)
 
void addLatticeCoupling (BlockIndicatorF< T, DESCRIPTOR::d > &indicator, LatticeCouplingGenerator< T, DESCRIPTOR > const &lcGen, std::vector< BlockStructureD< DESCRIPTOR::d > * > partners)
 
void executeCoupling ()
 Execute couplings steps (legacy)
 
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 ()
 
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, CellIDgetCellId (L... latticeR) 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.
 
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
 
virtual bool * getBlock (const std::size_t iBlock, std::size_t &sizeBlock, const bool loadingMode=false)=0
 Returns the address of the i-th block and its size.
 
virtual std::size_t getNblock () const =0
 Returns the number of blocks.
 
virtual std::size_t getSerializableSize () const =0
 Returns the binary size of the data to be saved.
 
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 ()
 

Protected Attributes

const Platform _platform
 
bool _statisticsEnabled
 
LatticeStatistics< T > * _statistics
 
- Protected Attributes inherited from olb::BlockStructureD< D >
LatticeR< D > _core
 
LatticeR< D > _size
 
LatticeR< D > _projection
 
int _padding
 

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>
class olb::BlockLattice< T, DESCRIPTOR >

Platform-abstracted block lattice for external access and inter-block interaction.

Definition at line 86 of file blockLattice.h.

Constructor & Destructor Documentation

◆ BlockLattice()

template<typename T , typename DESCRIPTOR >
olb::BlockLattice< T, DESCRIPTOR >::BlockLattice ( Vector< int, DESCRIPTOR::d > size,
int padding,
Platform platform )

Definition at line 35 of file blockLattice.hh.

36 : BlockStructure<DESCRIPTOR>(size, padding),
37 _platform(platform),
39 _statistics{nullptr}
40{ }
LatticeStatistics< T > * _statistics
const Platform _platform

◆ ~BlockLattice()

template<typename T , typename DESCRIPTOR >
olb::BlockLattice< T, DESCRIPTOR >::~BlockLattice ( )
virtual

Definition at line 43 of file blockLattice.hh.

44{
45 if (_statistics) {
46 delete _statistics;
47 }
48}

Member Function Documentation

◆ addLatticeCoupling() [1/2]

template<typename T , typename DESCRIPTOR >
void olb::BlockLattice< T, DESCRIPTOR >::addLatticeCoupling ( BlockIndicatorF< T, DESCRIPTOR::d > & indicator,
LatticeCouplingGenerator< T, DESCRIPTOR > const & lcGen,
std::vector< BlockStructureD< DESCRIPTOR::d > * > partners )

Definition at line 377 of file blockLattice.hh.

380{
381 if (!indicator.isEmpty()) {
382 this->forSpatialLocations([&](LatticeR<DESCRIPTOR::d> loc) {
383 if (this->getNeighborhoodRadius(loc) >= 1) {
384 if (indicator(loc)) {
385 std::unique_ptr<LatticeCouplingGenerator<T,DESCRIPTOR>> extractedLcGen{ lcGen.clone() };
386 if (extractedLcGen->extract(0, 0)) {
387 extractedLcGen->shift(loc);
388 addLatticeCoupling(*extractedLcGen, partners);
389 }
390 }
391 }
392 });
393 }
394}
void forSpatialLocations(F f) const
CellDistance getNeighborhoodRadius(LatticeR< D > latticeR) const
Return maximum valid neighborhood sphere radius w.r.t. latticeR.

◆ addLatticeCoupling() [2/2]

template<typename T , typename DESCRIPTOR >
void olb::BlockLattice< T, DESCRIPTOR >::addLatticeCoupling ( LatticeCouplingGenerator< T, DESCRIPTOR > const & lcGen,
std::vector< BlockStructureD< DESCRIPTOR::d > * > partners )

Add a non-local post-processing step (legacy)

Definition at line 370 of file blockLattice.hh.

372{
373 addPostProcessor<stage::Coupling>(lcGen.generate(partners));
374}

◆ addPostProcessor() [1/9]

template<typename T , typename DESCRIPTOR >
template<typename STAGE = stage::PostStream>
void olb::BlockLattice< T, DESCRIPTOR >::addPostProcessor ( BlockIndicatorF< T, DESCRIPTOR::d > & indicator,
const PostProcessorGenerator< T, DESCRIPTOR > & ppGen )
inline

Schedule legacy post processor for application to indicated cells in STAGE.

Definition at line 343 of file blockLattice.h.

344 {
345 addPostProcessor(typeid(STAGE), indicator, ppGen);
346 }
virtual void addPostProcessor(std::type_index stage, LatticeR< DESCRIPTOR::d > latticeR, PostProcessorPromise< T, DESCRIPTOR > &&promise)=0
Schedule post processor for application to latticeR in stage.

References olb::BlockLattice< T, DESCRIPTOR >::addPostProcessor().

+ Here is the call graph for this function:

◆ addPostProcessor() [2/9]

template<typename T , typename DESCRIPTOR >
template<typename STAGE = stage::PostStream>
void olb::BlockLattice< T, DESCRIPTOR >::addPostProcessor ( const PostProcessorGenerator< T, DESCRIPTOR > & ppGen)
inline

Schedule legacy post processor for application in STAGE.

Definition at line 338 of file blockLattice.h.

338 {
339 addPostProcessor(typeid(STAGE), ppGen);
340 }

References olb::BlockLattice< T, DESCRIPTOR >::addPostProcessor().

+ Here is the call graph for this function:

◆ addPostProcessor() [3/9]

template<typename T , typename DESCRIPTOR >
template<typename STAGE = stage::PostStream>
void olb::BlockLattice< T, DESCRIPTOR >::addPostProcessor ( PostProcessor< T, DESCRIPTOR > * postProcessor)
inline

Schedule legacy post processor for application in STAGE.

Definition at line 333 of file blockLattice.h.

333 {
334 addPostProcessor(typeid(STAGE), postProcessor);
335 }

References olb::BlockLattice< T, DESCRIPTOR >::addPostProcessor().

+ Here is the call graph for this function:

◆ addPostProcessor() [4/9]

template<typename T , typename DESCRIPTOR >
virtual void olb::BlockLattice< T, DESCRIPTOR >::addPostProcessor ( std::type_index stage,
BlockIndicatorF< T, DESCRIPTOR::d > & indicator,
const PostProcessorGenerator< T, DESCRIPTOR > & ppGen )
pure virtual

◆ addPostProcessor() [5/9]

template<typename T , typename DESCRIPTOR >
virtual void olb::BlockLattice< T, DESCRIPTOR >::addPostProcessor ( std::type_index stage,
BlockIndicatorF< T, DESCRIPTOR::d > & indicator,
PostProcessorPromise< T, DESCRIPTOR > && promise )
pure virtual

◆ addPostProcessor() [6/9]

template<typename T , typename DESCRIPTOR >
virtual void olb::BlockLattice< T, DESCRIPTOR >::addPostProcessor ( std::type_index stage,
const PostProcessorGenerator< T, DESCRIPTOR > & ppGen )
pure virtual

◆ addPostProcessor() [7/9]

template<typename T , typename DESCRIPTOR >
virtual void olb::BlockLattice< T, DESCRIPTOR >::addPostProcessor ( std::type_index stage,
LatticeR< DESCRIPTOR::d > latticeR,
PostProcessorPromise< T, DESCRIPTOR > && promise )
pure virtual

◆ addPostProcessor() [8/9]

template<typename T , typename DESCRIPTOR >
virtual void olb::BlockLattice< T, DESCRIPTOR >::addPostProcessor ( std::type_index stage,
PostProcessor< T, DESCRIPTOR > * postProcessor )
pure virtual

◆ addPostProcessor() [9/9]

template<typename T , typename DESCRIPTOR >
virtual void olb::BlockLattice< T, DESCRIPTOR >::addPostProcessor ( std::type_index stage,
PostProcessorPromise< T, DESCRIPTOR > && promise )
pure virtual

◆ collide()

template<typename T , typename DESCRIPTOR >
virtual void olb::BlockLattice< T, DESCRIPTOR >::collide ( )
pure virtual

◆ defineDynamics() [1/6]

template<typename T , typename DESCRIPTOR >
template<typename DYNAMICS >
void olb::BlockLattice< T, DESCRIPTOR >::defineDynamics ( BlockIndicatorF< T, DESCRIPTOR::d > & indicator)

Define DYNAMICS on a domain described by an indicator.

Definition at line 272 of file blockLattice.hh.

273{
274 if (!indicator.isEmpty()) {
275 this->forSpatialLocations([&](LatticeR<DESCRIPTOR::d> loc) {
276 if (indicator(loc)) {
277 setDynamics(this->getCellId(loc),
278 DynamicsPromise(meta::id<DYNAMICS>{}));
279 }
280 });
281 }
282}
virtual void setDynamics(CellID iCell, DynamicsPromise< T, DESCRIPTOR > &&)=0
Set dynamics at iCell to promised dynamics.
CellID getCellId(LatticeR< D > latticeR) const
Get 1D cell ID.
DynamicsPromise(meta::id< DYNAMICS >) -> DynamicsPromise< typename DYNAMICS::value_t, typename DYNAMICS::descriptor_t >

References olb::DynamicsPromise().

+ Here is the call graph for this function:

◆ defineDynamics() [2/6]

template<typename T , typename DESCRIPTOR >
void olb::BlockLattice< T, DESCRIPTOR >::defineDynamics ( BlockIndicatorF< T, DESCRIPTOR::d > & indicator,
Dynamics< T, DESCRIPTOR > * dynamics )

Define the dynamics on a domain described by an indicator.

Definition at line 258 of file blockLattice.hh.

260{
261 if (!indicator.isEmpty()) {
262 this->forSpatialLocations([&](LatticeR<DESCRIPTOR::d> loc) {
263 if (indicator(loc)) {
264 defineDynamics(loc, dynamics);
265 }
266 });
267 }
268}
void defineDynamics(LatticeR< DESCRIPTOR::d > latticeR, DynamicsPromise< T, DESCRIPTOR > &&promise)
Assign promised DYNAMICS to latticeR.

◆ defineDynamics() [3/6]

template<typename T , typename DESCRIPTOR >
void olb::BlockLattice< T, DESCRIPTOR >::defineDynamics ( Dynamics< T, DESCRIPTOR > * dynamics)

Define the same dynamics on all cells.

Definition at line 285 of file blockLattice.hh.

286{
287 this->forCellIndices([&](CellID iCell) {
288 setDynamics(iCell, dynamics);
289 });
290}
void forCellIndices(F f) const
std::uint32_t CellID
Type for sequential block-local cell indices.

◆ defineDynamics() [4/6]

template<typename T , typename DESCRIPTOR >
template<template< typename, typename > typename DYNAMICS>
void olb::BlockLattice< T, DESCRIPTOR >::defineDynamics ( LatticeR< DESCRIPTOR::d > latticeR)
inline

Assign DYNAMICS to latticeR.

Definition at line 249 of file blockLattice.h.

250 {
251 setDynamics(this->getCellId(latticeR),
252 DynamicsPromise(meta::id<DYNAMICS<T,DESCRIPTOR>>{}));
253 }

References olb::DynamicsPromise(), olb::BlockStructureD< D >::getCellId(), and olb::BlockLattice< T, DESCRIPTOR >::setDynamics().

+ Here is the call graph for this function:

◆ defineDynamics() [5/6]

template<typename T , typename DESCRIPTOR >
void olb::BlockLattice< T, DESCRIPTOR >::defineDynamics ( LatticeR< DESCRIPTOR::d > latticeR,
Dynamics< T, DESCRIPTOR > * dynamics )
inline

Assign dynamics to latticeR via pointer (legacy)

Definition at line 255 of file blockLattice.h.

257 {
258 setDynamics(this->getCellId(latticeR), dynamics);
259 }

References olb::BlockStructureD< D >::getCellId(), and olb::BlockLattice< T, DESCRIPTOR >::setDynamics().

+ Here is the call graph for this function:

◆ defineDynamics() [6/6]

template<typename T , typename DESCRIPTOR >
void olb::BlockLattice< T, DESCRIPTOR >::defineDynamics ( LatticeR< DESCRIPTOR::d > latticeR,
DynamicsPromise< T, DESCRIPTOR > && promise )
inline

Assign promised DYNAMICS to latticeR.

Definition at line 241 of file blockLattice.h.

243 {
244 setDynamics(this->getCellId(latticeR),
245 std::forward<DynamicsPromise<T,DESCRIPTOR>&&>(promise));
246 }

References olb::BlockStructureD< D >::getCellId(), and olb::BlockLattice< T, DESCRIPTOR >::setDynamics().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ defineField() [1/3]

template<typename T , typename DESCRIPTOR >
template<typename FIELD >
void olb::BlockLattice< T, DESCRIPTOR >::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.

Parameters
indicatorFDomain indicator to be reduced to BlockIndicatorFfromIndicatorF3D

Definition at line 186 of file blockLattice.hh.

189{
190 BlockIndicatorFfromIndicatorF<T,DESCRIPTOR::d> indicator(indicatorF, blockGeometry);
191 defineField<FIELD>(indicator, field);
192}

◆ defineField() [2/3]

template<typename T , typename DESCRIPTOR >
template<typename FIELD >
void olb::BlockLattice< T, DESCRIPTOR >::defineField ( BlockIndicatorF< T, DESCRIPTOR::d > & indicator,
AnalyticalF< DESCRIPTOR::d, T, T > & field )

Define a field on a domain described by an indicator.

Parameters
indicatorBlock indicator describing the target domain
fieldAnalytical functor (global)

Definition at line 151 of file blockLattice.hh.

153{
154 if (!indicator.isEmpty()) {
155 // Don't use FieldD here as long as AnalyticalF is fixed to T
156 std::array<T,DESCRIPTOR::template size<FIELD>()> fieldTmp;
157 T physR[DESCRIPTOR::d] = { };
158 this->forSpatialLocationsParallel([&](LatticeR<DESCRIPTOR::d> loc) {
159 if (indicator(loc)) {
160 indicator.getBlockGeometry().getPhysR(physR, loc);
161 field(fieldTmp.data(), physR);
162 get(loc).template setField<FIELD>(fieldTmp.data());
163 }
164 });
165 }
166}
Cell< T, DESCRIPTOR > get(CellID iCell)
Get Cell interface for index iCell.
void forSpatialLocationsParallel(F f) const
std::enable_if_t< DESCRIPTOR::d==2, std::shared_ptr< SuperF2D< T > > > field(SuperLattice< T, DESCRIPTOR > &sLattice)
Returns external field functor.

◆ defineField() [3/3]

template<typename T , typename DESCRIPTOR >
template<typename FIELD >
void olb::BlockLattice< T, DESCRIPTOR >::defineField ( BlockIndicatorF< T, DESCRIPTOR::d > & indicator,
BlockF< T, DESCRIPTOR::d > & field )

Define a field on a domain described by an indicator.

Parameters
indicatorBlock indicator describing the target domain
fieldBlock functor

Definition at line 170 of file blockLattice.hh.

172{
173 if (!indicator.isEmpty()) {
174 FieldD<T,DESCRIPTOR,FIELD> fieldTmp;
175 this->forSpatialLocations([&](LatticeR<DESCRIPTOR::d> loc) {
176 if (indicator(loc)) {
177 field(fieldTmp.data(), loc.data());
178 get(loc).template setField<FIELD>(fieldTmp);
179 }
180 });
181 }
182}

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

+ Here is the call graph for this function:

◆ definePopulations() [1/2]

template<typename T , typename DESCRIPTOR >
void olb::BlockLattice< T, DESCRIPTOR >::definePopulations ( BlockIndicatorF< T, DESCRIPTOR::d > & indicator,
AnalyticalF< DESCRIPTOR::d, T, T > & Pop )

Define a population on a domain described by an indicator.

Parameters
indicatorBlock indicator describing the target domain
PopAnalytical functor (global), target dimension DESCRIPTOR::q

Definition at line 118 of file blockLattice.hh.

120{
121 if (!indicator.isEmpty()) {
122 T physR[DESCRIPTOR::d] = { };
123 T pop[DESCRIPTOR::q];
124 this->forSpatialLocations([&](LatticeR<DESCRIPTOR::d> loc) {
125 if (indicator(loc)) {
126 indicator.getBlockGeometry().getPhysR(physR, loc);
127 popF(pop,physR);
128 get(loc).definePopulations(pop);
129 }
130 });
131 }
132}

◆ definePopulations() [2/2]

template<typename T , typename DESCRIPTOR >
void olb::BlockLattice< T, DESCRIPTOR >::definePopulations ( BlockIndicatorF< T, DESCRIPTOR::d > & indicator,
BlockF< T, DESCRIPTOR::d > & Pop )
Parameters
indicatorBlock indicator describing the target domain
PopBlock functor, target dimension DESCRIPTOR::q

Definition at line 135 of file blockLattice.hh.

137{
138 if (!indicator.isEmpty()) {
139 T pop[DESCRIPTOR::q];
140 this->forSpatialLocations([&](LatticeR<DESCRIPTOR::d> loc) {
141 if (indicator(loc)) {
142 popF(pop, loc);
143 get(loc).definePopulations(pop);
144 }
145 });
146 }
147}

◆ defineRho()

template<typename T , typename DESCRIPTOR >
void olb::BlockLattice< T, DESCRIPTOR >::defineRho ( BlockIndicatorF< T, DESCRIPTOR::d > & indicator,
AnalyticalF< DESCRIPTOR::d, T, T > & rho )

Define rho on a domain described by an indicator.

Parameters
indicatorBlock indicator describing the target domain
rhoAnalytical functor (global)

Definition at line 64 of file blockLattice.hh.

66{
67 if (!indicator.isEmpty()) {
68 T physR[DESCRIPTOR::d] = { };
69 T rhoTmp = T();
70 this->forSpatialLocations([&](LatticeR<DESCRIPTOR::d> loc) {
71 if (indicator(loc)) {
72 indicator.getBlockGeometry().getPhysR(physR, loc);
73 rho(&rhoTmp,physR);
74 get(loc).defineRho(rhoTmp);
75 }
76 });
77 }
78}

◆ defineRhoU()

template<typename T , typename DESCRIPTOR >
void olb::BlockLattice< T, DESCRIPTOR >::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.

Parameters
indicatorBlock indicator describing the target domain
rhoAnalytical functor (global)
uAnalytical functor (global)

Definition at line 98 of file blockLattice.hh.

101{
102 if (!indicator.isEmpty()) {
103 T physR[DESCRIPTOR::d] = { };
104 T uTmp[DESCRIPTOR::d] = { };
105 T rhoTmp = T();
106 this->forSpatialLocations([&](LatticeR<DESCRIPTOR::d> loc) {
107 if (indicator(loc)) {
108 indicator.getBlockGeometry().getPhysR(physR, loc);
109 rho(&rhoTmp,physR);
110 u(uTmp,physR);
111 get(loc).defineRhoU(rhoTmp,uTmp);
112 }
113 });
114 }
115}

◆ defineU()

template<typename T , typename DESCRIPTOR >
void olb::BlockLattice< T, DESCRIPTOR >::defineU ( BlockIndicatorF< T, DESCRIPTOR::d > & indicator,
AnalyticalF< DESCRIPTOR::d, T, T > & u )

Define u on a domain described by an indicator.

Parameters
indicatorBlock indicator describing the target domain
uAnalytical functor (global)

Definition at line 81 of file blockLattice.hh.

83{
84 if (!indicator.isEmpty()) {
85 T physR[DESCRIPTOR::d] = { };
86 T uTmp[DESCRIPTOR::d] = { };
87 this->forSpatialLocations([&](LatticeR<DESCRIPTOR::d> loc) {
88 if (indicator(loc)) {
89 indicator.getBlockGeometry().getPhysR(physR, loc);
90 u(uTmp,physR);
91 get(loc).defineU(uTmp);
92 }
93 });
94 }
95}

◆ executeCoupling()

template<typename T , typename DESCRIPTOR >
void olb::BlockLattice< T, DESCRIPTOR >::executeCoupling ( )

Execute couplings steps (legacy)

Definition at line 397 of file blockLattice.hh.

398{
399 postProcess<stage::Coupling>();
400}

◆ get() [1/6]

template<typename T , typename DESCRIPTOR >
Cell< T, DESCRIPTOR > olb::BlockLattice< T, DESCRIPTOR >::get ( CellID iCell)
inline

Get Cell interface for index iCell.

Definition at line 171 of file blockLattice.h.

172 {
173 return Cell<T,DESCRIPTOR>(*this, iCell);
174 }
+ Here is the caller graph for this function:

◆ get() [2/6]

template<typename T , typename DESCRIPTOR >
ConstCell< T, DESCRIPTOR > olb::BlockLattice< T, DESCRIPTOR >::get ( CellID iCell) const
inline

Get ConstCell interface for index iCell.

Definition at line 176 of file blockLattice.h.

177 {
178 return ConstCell<T,DESCRIPTOR>(*this, iCell);
179 }

◆ get() [3/6]

template<typename T , typename DESCRIPTOR >
Cell< T, DESCRIPTOR > olb::BlockLattice< T, DESCRIPTOR >::get ( LatticeR< DESCRIPTOR::d > loc)
inline

Get Cell interface for location loc.

Definition at line 182 of file blockLattice.h.

183 {
184 return get(this->getCellId(loc));
185 }

References olb::BlockLattice< T, DESCRIPTOR >::get(), and olb::BlockStructureD< D >::getCellId().

+ Here is the call graph for this function:

◆ get() [4/6]

template<typename T , typename DESCRIPTOR >
ConstCell< T, DESCRIPTOR > olb::BlockLattice< T, DESCRIPTOR >::get ( LatticeR< DESCRIPTOR::d > loc) const
inline

Get ConstCell interface for location loc.

Definition at line 187 of file blockLattice.h.

188 {
189 return get(this->getCellId(loc));
190 }

References olb::BlockLattice< T, DESCRIPTOR >::get(), and olb::BlockStructureD< D >::getCellId().

+ Here is the call graph for this function:

◆ get() [5/6]

template<typename T , typename DESCRIPTOR >
template<typename... R>
std::enable_if_t< sizeof...(R)==DESCRIPTOR::d, Cell< T, DESCRIPTOR > > olb::BlockLattice< T, DESCRIPTOR >::get ( R... latticeR)
inline

Get Cell interface for componentwise location latticeR.

Definition at line 195 of file blockLattice.h.

196 {
197 return get(this->getCellId(latticeR...));
198 }

References olb::BlockLattice< T, DESCRIPTOR >::get(), and olb::BlockStructureD< D >::getCellId().

+ Here is the call graph for this function:

◆ get() [6/6]

template<typename T , typename DESCRIPTOR >
template<typename... R>
std::enable_if_t< sizeof...(R)==DESCRIPTOR::d, ConstCell< T, DESCRIPTOR > > olb::BlockLattice< T, DESCRIPTOR >::get ( R... latticeR) const
inline

Get ConstCell interface for componentwise location latticeR.

Definition at line 202 of file blockLattice.h.

203 {
204 return get(this->getCellId(latticeR...));
205 }

References olb::BlockLattice< T, DESCRIPTOR >::get(), and olb::BlockStructureD< D >::getCellId().

+ Here is the call graph for this function:

◆ getCommunicatable()

template<typename T , typename DESCRIPTOR >
virtual Communicatable & olb::BlockLattice< T, DESCRIPTOR >::getCommunicatable ( std::type_index )
pure virtual

◆ getData() [1/2]

template<typename T , typename DESCRIPTOR >
template<typename FIELD_TYPE >
auto & olb::BlockLattice< T, DESCRIPTOR >::getData ( FIELD_TYPE field = FIELD_TYPE{})
inline

Return abstract interface for concrete FIELD_TYPE data.

Definition at line 146 of file blockLattice.h.

146 {})
147 {
148 return *callUsingConcretePlatform<ConcretizableBlockLattice<T,DESCRIPTOR>>(
149 _platform,
150 this,
151 [&](auto* lattice) -> auto* {
152 return &(lattice->template getData<FIELD_TYPE>().asAbstract());
153 });
154 }

◆ getData() [2/2]

template<typename T , typename DESCRIPTOR >
template<typename FIELD_TYPE >
const auto & olb::BlockLattice< T, DESCRIPTOR >::getData ( FIELD_TYPE field = FIELD_TYPE{}) const
inline

Return abstract interface for concrete FIELD_TYPE data.

Definition at line 134 of file blockLattice.h.

134 {}) const
135 {
136 return *callUsingConcretePlatform<ConcretizableBlockLattice<T,DESCRIPTOR>>(
137 _platform,
138 this,
139 [&](const auto* lattice) -> const auto* {
140 return &(lattice->template getData<FIELD_TYPE>().asAbstract());
141 });
142 }

◆ getDynamics() [1/4]

template<typename T , typename DESCRIPTOR >
template<typename DYNAMICS >
Dynamics< T, DESCRIPTOR > * olb::BlockLattice< T, DESCRIPTOR >::getDynamics ( )
inline

Return pointer to DYNAMICS (legacy)

Definition at line 226 of file blockLattice.h.

226 {
227 return getDynamics(DynamicsPromise(meta::id<DYNAMICS>{}));
228 }
Dynamics< T, DESCRIPTOR > * getDynamics()
Return pointer to DYNAMICS (legacy)

References olb::DynamicsPromise(), and olb::BlockLattice< T, DESCRIPTOR >::getDynamics().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDynamics() [2/4]

template<typename T , typename DESCRIPTOR >
virtual Dynamics< T, DESCRIPTOR > * olb::BlockLattice< T, DESCRIPTOR >::getDynamics ( CellID iCell)
pure virtual

◆ getDynamics() [3/4]

template<typename T , typename DESCRIPTOR >
virtual Dynamics< T, DESCRIPTOR > * olb::BlockLattice< T, DESCRIPTOR >::getDynamics ( DynamicsPromise< T, DESCRIPTOR > && )
pure virtual

◆ getDynamics() [4/4]

template<typename T , typename DESCRIPTOR >
template<typename... R>
std::enable_if_t< sizeof...(R)==DESCRIPTOR::d, Dynamics< T, DESCRIPTOR > * > olb::BlockLattice< T, DESCRIPTOR >::getDynamics ( R... latticeR)
inline

Return pointer to dynamics assigned to latticeR.

Definition at line 235 of file blockLattice.h.

236 {
237 return getDynamics(this->getCellId(latticeR...));
238 }

References olb::BlockStructureD< D >::getCellId(), and olb::BlockLattice< T, DESCRIPTOR >::getDynamics().

+ Here is the call graph for this function:

◆ getField() [1/2]

template<typename T , typename DESCRIPTOR >
template<typename FIELD >
auto & olb::BlockLattice< T, DESCRIPTOR >::getField ( FIELD field = FIELD{})
inline

Return abstract interface for FIELD array.

Definition at line 165 of file blockLattice.h.

165 {})
166 {
167 return getData(Array<FIELD>{});
168 }
const auto & getData(FIELD_TYPE field=FIELD_TYPE{}) const
Return abstract interface for concrete FIELD_TYPE data.

◆ getField() [2/2]

template<typename T , typename DESCRIPTOR >
template<typename FIELD >
const auto & olb::BlockLattice< T, DESCRIPTOR >::getField ( FIELD field = FIELD{}) const
inline

Return abstract interface for FIELD array.

Definition at line 158 of file blockLattice.h.

158 {}) const
159 {
160 return getData(Array<FIELD>{});
161 }

◆ getPlatform()

template<typename T , typename DESCRIPTOR >
Platform olb::BlockLattice< T, DESCRIPTOR >::getPlatform ( ) const
inline

Return platform used to process lattice.

Definition at line 117 of file blockLattice.h.

117 {
118 return _platform;
119 }

References olb::BlockLattice< T, DESCRIPTOR >::_platform.

◆ getPopulationPointers()

template<typename T , typename DESCRIPTOR >
virtual Vector< T *, DESCRIPTOR::q > olb::BlockLattice< T, DESCRIPTOR >::getPopulationPointers ( CellID iCell)
pure virtual

◆ getStatistics() [1/2]

template<typename T , typename DESCRIPTOR >
LatticeStatistics< T > & olb::BlockLattice< T, DESCRIPTOR >::getStatistics ( )

Return a handle to the LatticeStatistics object.

Definition at line 403 of file blockLattice.hh.

404{
405 return *_statistics;
406}
+ Here is the caller graph for this function:

◆ getStatistics() [2/2]

template<typename T , typename DESCRIPTOR >
const LatticeStatistics< T > & olb::BlockLattice< T, DESCRIPTOR >::getStatistics ( ) const

Return a constant handle to the LatticeStatistics object.

Definition at line 409 of file blockLattice.hh.

410{
411 return *_statistics;
412}

◆ hasCommunicatable()

template<typename T , typename DESCRIPTOR >
virtual bool olb::BlockLattice< T, DESCRIPTOR >::hasCommunicatable ( std::type_index ) const
pure virtual

◆ hasData()

template<typename T , typename DESCRIPTOR >
template<typename FIELD_TYPE >
bool olb::BlockLattice< T, DESCRIPTOR >::hasData ( )
inline

Return whether FIELD_TYPE is available / has been allocated.

Definition at line 123 of file blockLattice.h.

124 {
125 return callUsingConcretePlatform<ConcretizableBlockLattice<T,DESCRIPTOR>>(
126 _platform,
127 this,
128 [&](const auto* lattice) -> bool {
129 return lattice->template hasData<FIELD_TYPE>();
130 });
131 }

References olb::BlockLattice< T, DESCRIPTOR >::_platform.

◆ hasPostProcessor()

template<typename T , typename DESCRIPTOR >
virtual bool olb::BlockLattice< T, DESCRIPTOR >::hasPostProcessor ( std::type_index stage,
PostProcessorPromise< T, DESCRIPTOR > && promise )
pure virtual

◆ iniEquilibrium() [1/2]

template<typename T , typename DESCRIPTOR >
void olb::BlockLattice< T, DESCRIPTOR >::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.

Parameters
indicatorBlock indicator describing the target domain
rhoAnalytical functor (global)
uAnalytical functor (global)

Definition at line 195 of file blockLattice.hh.

198{
199 if (!indicator.isEmpty()) {
200 T physR[DESCRIPTOR::d] = { };
201 T uTmp[DESCRIPTOR::d] = { };
202 T rhoTmp = T();
203 this->forSpatialLocations([&](LatticeR<DESCRIPTOR::d> loc) {
204 if (indicator(loc)) {
205 indicator.getBlockGeometry().getPhysR(physR, loc);
206 u(uTmp, physR);
207 rho(&rhoTmp, physR);
208 get(loc).iniEquilibrium(rhoTmp, uTmp);
209 }
210 });
211 }
212}

◆ iniEquilibrium() [2/2]

template<typename T , typename DESCRIPTOR >
void olb::BlockLattice< T, DESCRIPTOR >::iniEquilibrium ( BlockIndicatorF< T, DESCRIPTOR::d > & indicator,
AnalyticalF< DESCRIPTOR::d, T, T > & rho,
BlockF< T, DESCRIPTOR::d > & u )

Definition at line 215 of file blockLattice.hh.

218{
219 if (!indicator.isEmpty()) {
220 T physR[DESCRIPTOR::d] = { };
221 T uTmp[DESCRIPTOR::d] = { };
222 T rhoTmp = T();
223 this->forSpatialLocations([&](LatticeR<DESCRIPTOR::d> loc) {
224 if (indicator(loc)) {
225 indicator.getBlockGeometry().getPhysR(physR, loc);
226 u(uTmp, loc.data());
227 rho(&rhoTmp, physR);
228 get(loc).iniEquilibrium(rhoTmp, uTmp);
229 }
230 });
231 }
232}

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

+ Here is the call graph for this function:

◆ iniRegularized()

template<typename T , typename DESCRIPTOR >
void olb::BlockLattice< T, DESCRIPTOR >::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.

Parameters
indicatorBlock indicator describing the target domain
rhoAnalytical functor (global)
uAnalytical functor (global)

Definition at line 235 of file blockLattice.hh.

239{
240 if (!indicator.isEmpty()) {
241 T physR[DESCRIPTOR::d] = { };
242 T uTmp[DESCRIPTOR::d] = { };
243 T rhoTmp = T();
244 T piTmp[util::TensorVal<DESCRIPTOR>::n] = { };
245 this->forSpatialLocations([&](LatticeR<DESCRIPTOR::d> loc) {
246 if (indicator(loc)) {
247 indicator.getBlockGeometry().getPhysR(physR, loc);
248 u(uTmp, physR);
249 rho(&rhoTmp, physR);
250 pi(piTmp, physR);
251 get(loc).iniRegularized(rhoTmp, uTmp, piTmp);
252 }
253 });
254 }
255}
static constexpr int n
result stored in n
Definition util.h:211

◆ initialize()

template<typename T , typename DESCRIPTOR >
void olb::BlockLattice< T, DESCRIPTOR >::initialize ( )

Initialize the lattice cells to become ready for simulation.

Definition at line 51 of file blockLattice.hh.

52{
53 addPostProcessor(typeid(stage::PostStream), meta::id<StatisticsPostProcessor>());
54
55 // Todo: Move to StatisticsPostProcessor::setup
56 _statistics = new LatticeStatistics<T>;
57 _statistics->initialize();
58
61}
virtual void setProcessingContext(ProcessingContext)=0
Set processing context.
void postProcess()
Execute post processors of STAGE.
@ Simulation
Data available on host for e.g. functor evaluation.

References olb::LatticeStatistics< T >::initialize(), and olb::Simulation.

+ Here is the call graph for this function:

◆ postProcess() [1/2]

template<typename T , typename DESCRIPTOR >
template<typename STAGE >
void olb::BlockLattice< T, DESCRIPTOR >::postProcess ( )
inline

Execute post processors of STAGE.

Definition at line 352 of file blockLattice.h.

352 {
353 postProcess(typeid(STAGE));
354 }

References olb::BlockLattice< T, DESCRIPTOR >::postProcess().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ postProcess() [2/2]

template<typename T , typename DESCRIPTOR >
virtual void olb::BlockLattice< T, DESCRIPTOR >::postProcess ( std::type_index stage = typeid(stage::PostStream))
pure virtual

◆ setDynamics() [1/2]

template<typename T , typename DESCRIPTOR >
virtual void olb::BlockLattice< T, DESCRIPTOR >::setDynamics ( CellID iCell,
Dynamics< T, DESCRIPTOR > *  )
pure virtual

◆ setDynamics() [2/2]

template<typename T , typename DESCRIPTOR >
virtual void olb::BlockLattice< T, DESCRIPTOR >::setDynamics ( CellID iCell,
DynamicsPromise< T, DESCRIPTOR > &&  )
pure virtual

◆ setParameter() [1/3]

template<typename T , typename DESCRIPTOR >
template<typename PARAMETER , typename FIELD >
void olb::BlockLattice< T, DESCRIPTOR >::setParameter ( AbstractFieldArrayD< T, DESCRIPTOR, FIELD > & fieldArray)
inline

Definition at line 289 of file blockLattice.h.

289 {
290 callUsingConcretePlatform<ConcretizableBlockLattice<T,DESCRIPTOR>>(
291 _platform,
292 this,
293 [&](auto* lattice) {
294 lattice->template setParameter<PARAMETER>(fieldArray);
295 });
296 }

References olb::BlockLattice< T, DESCRIPTOR >::_platform.

◆ setParameter() [2/3]

template<typename T , typename DESCRIPTOR >
template<typename PARAMETER , Platform PLATFORM, typename FIELD >
void olb::BlockLattice< T, DESCRIPTOR >::setParameter ( FieldArrayD< T, DESCRIPTOR, PLATFORM, FIELD > & fieldArray)
inline

Definition at line 298 of file blockLattice.h.

298 {
299 callUsingConcretePlatform<ConcretizableBlockLattice<T,DESCRIPTOR>>(
300 _platform,
301 this,
302 [&](auto* lattice) {
303 lattice->template setParameter<PARAMETER>(fieldArray);
304 });
305 }

References olb::BlockLattice< T, DESCRIPTOR >::_platform.

◆ setParameter() [3/3]

template<typename T , typename DESCRIPTOR >
template<typename FIELD >
void olb::BlockLattice< T, DESCRIPTOR >::setParameter ( FieldD< T, DESCRIPTOR, FIELD > value)
inline

Set value of parameter FIELD for any dynamics that provide it.

Most common way of defining parameters. E.g. to set the relaxation time descriptors::OMEGA for all dynamics to 0.6:

blockLattice.template setParameter<descriptors::OMEGA>(0.6);

Definition at line 279 of file blockLattice.h.

279 {
280 callUsingConcretePlatform<ConcretizableBlockLattice<T,DESCRIPTOR>>(
281 _platform,
282 this,
283 [&](auto* lattice) {
284 lattice->template setParameter<FIELD>(value);
285 });
286 }

References olb::BlockLattice< T, DESCRIPTOR >::_platform.

◆ setProcessingContext()

template<typename T , typename DESCRIPTOR >
virtual void olb::BlockLattice< T, DESCRIPTOR >::setProcessingContext ( ProcessingContext )
pure virtual

◆ setStatisticsEnabled()

template<typename T , typename DESCRIPTOR >
void olb::BlockLattice< T, DESCRIPTOR >::setStatisticsEnabled ( bool state)
inline

Definition at line 213 of file blockLattice.h.

213 {
214 _statisticsEnabled = state;
215 }

References olb::BlockLattice< T, DESCRIPTOR >::_statisticsEnabled.

◆ statisticsEnabled()

template<typename T , typename DESCRIPTOR >
bool olb::BlockLattice< T, DESCRIPTOR >::statisticsEnabled ( ) const
inline

Definition at line 210 of file blockLattice.h.

210 {
211 return _statisticsEnabled;
212 }

References olb::BlockLattice< T, DESCRIPTOR >::_statisticsEnabled.

+ Here is the caller graph for this function:

◆ stream()

template<typename T , typename DESCRIPTOR >
virtual void olb::BlockLattice< T, DESCRIPTOR >::stream ( )
pure virtual

◆ stripeOffDensityOffset()

template<typename T , typename DESCRIPTOR >
void olb::BlockLattice< T, DESCRIPTOR >::stripeOffDensityOffset ( T offset)

Subtract the given offset from all densities.

Definition at line 356 of file blockLattice.hh.

357{
358 if (!hasPostProcessor(typeid(StripeOffDensityOffsetO),
359 meta::id<StripeOffDensityOffsetO>{})) {
360 addPostProcessor(typeid(StripeOffDensityOffsetO),
361 meta::id<StripeOffDensityOffsetO>{});
362 }
363 // Update offset and execute
364 getData<OperatorParameters<StripeOffDensityOffsetO>>()
365 .template set<StripeOffDensityOffsetO::OFFSET>(offset);
366 postProcess(typeid(StripeOffDensityOffsetO));
367}
virtual bool hasPostProcessor(std::type_index stage, PostProcessorPromise< T, DESCRIPTOR > &&promise)=0
Returns true if stage contains post processor.

Member Data Documentation

◆ _platform

template<typename T , typename DESCRIPTOR >
const Platform olb::BlockLattice< T, DESCRIPTOR >::_platform
protected

Definition at line 89 of file blockLattice.h.

◆ _statistics

template<typename T , typename DESCRIPTOR >
LatticeStatistics<T>* olb::BlockLattice< T, DESCRIPTOR >::_statistics
protected

Definition at line 92 of file blockLattice.h.

◆ _statisticsEnabled

template<typename T , typename DESCRIPTOR >
bool olb::BlockLattice< T, DESCRIPTOR >::_statisticsEnabled
protected

Definition at line 91 of file blockLattice.h.


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