OpenLB 1.8.1
Loading...
Searching...
No Matches
olb::SuperLattice< T, DESCRIPTOR > Class Template Reference

Super class maintaining block lattices for a cuboid decomposition. More...

#include <superLattice.h>

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

Public Types

using value_t = T
 Base value type of the lattice.
 
using descriptor_t = DESCRIPTOR
 Descriptor / discrete velocity set of the lattice.
 
using block_t = ConcretizableBlockLattice<T,DESCRIPTOR>
 
- Public Types inherited from olb::SuperStructure< T, DESCRIPTOR::d >
using value_t
 

Public Member Functions

 SuperLattice (CuboidDecomposition< T, DESCRIPTOR::d > &cuboidDecomposition, LoadBalancer< T > &loadBalancer, unsigned overlap=3)
 
 SuperLattice (CuboidDecomposition< T, DESCRIPTOR::d > &cuboidDecomposition, LoadBalancer< T > &loadBalancer, unsigned overlap, const UnitConverter< T, DESCRIPTOR > &converter)
 
 SuperLattice (SuperGeometry< T, DESCRIPTOR::d > &sGeometry)
 
 SuperLattice (const SuperLattice &)=delete
 
 ~SuperLattice ()=default
 
const UnitConverter< T, DESCRIPTOR > & getConverter () const
 
BlockLattice< T, DESCRIPTOR > & getBlock (int locC)
 Return BlockLattice with local index locC.
 
template<typename BLOCK >
BLOCK & getBlock (int locC)
 Return locC-th block lattice casted to BLOCK.
 
const BlockLattice< T, DESCRIPTOR > & getBlock (int locC) const
 Return read-only BlockLattice with local index locC.
 
template<typename BLOCK >
const BLOCK & getBlock (int locIC) const
 Return locC-th block lattice casted to BLOCK (read-only)
 
template<Platform PLATFORM, typename F >
void forBlocksOnPlatform (F f)
 Apply f to every ConcreteBlockLattice of PLATFORM.
 
void setProcessingContext (ProcessingContext context)
 Set processing context of block lattices.
 
template<typename FIELD_TYPE >
void setProcessingContext (ProcessingContext context)
 Set processing context of FIELD_TYPE in block lattices.
 
template<typename STAGE >
SuperCommunicator< T, SuperLattice > & getCommunicator (STAGE stage=STAGE())
 Return communicator for given communication stage.
 
void communicate () override
 Perform full overlap communication if needed.
 
LatticeStatistics< T > & getStatistics ()
 Return a handle to the LatticeStatistics object.
 
LatticeStatistics< T > const & getStatistics () const
 Return a constant handle to the LatticeStatistics object.
 
Cell< T, DESCRIPTOR > get (LatticeR< DESCRIPTOR::d+1 > latticeR)
 Get local cell interface.
 
template<typename... R>
std::enable_if_t< sizeof...(R)==DESCRIPTOR::d+1, Cell< T, DESCRIPTOR > > get (R... latticeR)
 Get local cell interface.
 
void initialize ()
 Initialize lattice to be ready for simulation.
 
void printSummary () const
 Prints a summary of all dynamics and post processors.
 
void writeSummary (std::string fileName="lattice") const
 Writes a summary of all dynamics and post processors.
 
template<typename DYNAMICS >
void defineDynamics ()
 Set dynamics of all cells to DYNAMICS.
 
template<template< typename... > typename DYNAMICS>
void defineDynamics ()
 Set dynamics of all cells to DYNAMICS.
 
template<typename DYNAMICS >
void defineDynamics (FunctorPtr< SuperIndicatorF< T, DESCRIPTOR::d > > &&indicator)
 
template<typename DYNAMICS >
void defineDynamics (SuperGeometry< T, DESCRIPTOR::d > &sGeometry, int material)
 Set dynamics of material cells to DYNAMICS.
 
template<template< typename... > typename DYNAMICS>
void defineDynamics (FunctorPtr< SuperIndicatorF< T, DESCRIPTOR::d > > &&indicator)
 Set dynamics of indicated cells to DYNAMICS<T,DESCRIPTOR>
 
template<template< typename... > typename DYNAMICS>
void defineDynamics (SuperGeometry< T, DESCRIPTOR::d > &sGeometry, int material)
 Set dynamics of indicated cells to DYNAMICS<T,DESCRIPTOR>
 
void defineDynamics (FunctorPtr< SuperIndicatorF< T, DESCRIPTOR::d > > &&indicator, DynamicsPromise< T, DESCRIPTOR > &&promise)
 
void defineRho (FunctorPtr< SuperIndicatorF< T, DESCRIPTOR::d > > &&, AnalyticalF< DESCRIPTOR::d, T, T > &rho)
 Define rho on a domain described by an indicator.
 
void defineRho (SuperGeometry< T, DESCRIPTOR::d > &sGeometry, int material, AnalyticalF< DESCRIPTOR::d, T, T > &rho)
 Define rho on a domain with a particular material number.
 
void defineU (FunctorPtr< SuperIndicatorF< T, DESCRIPTOR::d > > &&indicator, AnalyticalF< DESCRIPTOR::d, T, T > &u)
 Define u on a domain described by an indicator.
 
void defineU (SuperGeometry< T, DESCRIPTOR::d > &sGeometry, int material, AnalyticalF< DESCRIPTOR::d, T, T > &u)
 Define u on a domain with a particular material number.
 
void defineRhoU (FunctorPtr< SuperIndicatorF< 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 defineRhoU (SuperGeometry< T, DESCRIPTOR::d > &sGeometry, int material, AnalyticalF< DESCRIPTOR::d, T, T > &rho, AnalyticalF< DESCRIPTOR::d, T, T > &u)
 Define rho and u on a domain with a particular material number.
 
void definePopulations (FunctorPtr< SuperIndicatorF< T, DESCRIPTOR::d > > &&indicator, AnalyticalF< DESCRIPTOR::d, T, T > &Pop)
 Define a population on a domain described by an indicator.
 
void definePopulations (SuperGeometry< T, DESCRIPTOR::d > &sGeometry, int material, AnalyticalF< DESCRIPTOR::d, T, T > &Pop)
 Define a population on a domain with a particular material number.
 
void definePopulations (FunctorPtr< SuperIndicatorF< T, DESCRIPTOR::d > > &&indicator, SuperF< DESCRIPTOR::d, T, T > &Pop)
 
void definePopulations (SuperGeometry< T, DESCRIPTOR::d > &sGeometry, int material, SuperF< DESCRIPTOR::d, T, T > &Pop)
 Define a population on a domain with a particular material number.
 
template<typename FIELD >
void defineField (FunctorPtr< SuperIndicatorF< T, DESCRIPTOR::d > > &&indicator, FunctorPtr< SuperF< DESCRIPTOR::d, T, T > > &&field)
 Define an external field on a domain described by an indicator.
 
template<typename FIELD >
void defineField (FunctorPtr< SuperIndicatorF< T, DESCRIPTOR::d > > &&indicator, AnalyticalF< DESCRIPTOR::d, T, T > &field)
 Defines a field on a domain described by an indicator.
 
template<typename FIELD >
void defineField (SuperGeometry< T, DESCRIPTOR::d > &sGeometry, int material, FunctorPtr< SuperF< DESCRIPTOR::d, T, T > > &&field)
 Define an external field on a domain with a particular material number.
 
template<typename FIELD >
void defineField (SuperGeometry< T, DESCRIPTOR::d > &sGeometry, int material, AnalyticalF< DESCRIPTOR::d, T, T > &field)
 Defines a field on a domain with a particular material number.
 
template<typename FIELD >
void defineField (SuperGeometry< T, DESCRIPTOR::d > &sGeometry, IndicatorF< T, DESCRIPTOR::d > &indicator, AnalyticalF< DESCRIPTOR::d, T, T > &field)
 Defines a field on a indicated domain.
 
template<typename FIELD >
void defineField (SuperGeometry< T, DESCRIPTOR::d > &sGeometry, IndicatorF< T, DESCRIPTOR::d > &indicator, FunctorPtr< SuperF< DESCRIPTOR::d, T, T > > &&field)
 Defines a field on a indicated domain.
 
template<typename PARAMETER >
void setParameter (FieldD< T, DESCRIPTOR, PARAMETER > field)
 Update PARAMETER in all dynamics and post processors.
 
template<typename PARAMETER , typename DYNAMICS >
void setParameterOfDynamics (FieldD< T, DESCRIPTOR, PARAMETER > &&field)
 Update PARAMETER in DYNAMICS.
 
template<typename PARAMETER , template< typename... > typename DYNAMICS>
void setParameterOfDynamics (FieldD< T, DESCRIPTOR, PARAMETER > &&field)
 Update PARAMETER in DYNAMICS<T,DESCRIPTOR>
 
template<typename PARAMETER , typename _DESCRIPTOR , typename FIELD >
void setParameter (AbstractFieldArrayD< T, _DESCRIPTOR, FIELD > &abstractFieldArray)
 Set PARAMETER to column pointers of given field array.
 
void iniEquilibrium (FunctorPtr< SuperIndicatorF< 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 (SuperGeometry< T, DESCRIPTOR::d > &sGeometry, int material, AnalyticalF< DESCRIPTOR::d, T, T > &rho, AnalyticalF< DESCRIPTOR::d, T, T > &u)
 Initialize by equilibrium on a domain with a particular material number.
 
void iniEquilibrium (FunctorPtr< SuperIndicatorF< T, DESCRIPTOR::d > > &&indicator, AnalyticalF< DESCRIPTOR::d, T, T > &rho, SuperF< DESCRIPTOR::d, T, T > &u)
 
void iniEquilibrium (SuperGeometry< T, DESCRIPTOR::d > &sGeometry, int material, AnalyticalF< DESCRIPTOR::d, T, T > &rho, SuperF< DESCRIPTOR::d, T, T > &u)
 
void iniRegularized (FunctorPtr< SuperIndicatorF< 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 iniRegularized (SuperGeometry< T, DESCRIPTOR::d > &sGeometry, int material, 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 with a particular material number.
 
void collideAndStream ()
 Core implementation of a single iteration of the collide and stream loop.
 
void stripeOffDensityOffset (T offset)
 Subtract constant offset from the density.
 
void statisticsOn ()
 Switch Statistics on (default on)
 
void statisticsOff ()
 Switch Statistics off (default on)
 
template<typename STAGE = stage::PostStream>
void addPostProcessor (FunctorPtr< SuperIndicatorF< T, DESCRIPTOR::d > > &&indicator, PostProcessorPromise< T, DESCRIPTOR > &&promise)
 Add a non-local post-processing step.
 
template<typename STAGE = stage::PostStream>
void addPostProcessor (PostProcessorPromise< T, DESCRIPTOR > &&promise)
 Add a non-local post-processing step.
 
template<typename STAGE = stage::PostStream>
void executePostProcessors (STAGE stage=STAGE())
 Executes post processors for STAGE.
 
template<typename STAGE >
void addCustomTask (std::function< void()> f)
 Schedules f for execution during every invocation of STAGE.
 
template<typename STAGE >
void executeCustomTasks (STAGE stage=STAGE())
 Executes custom tasks assigned to STAGE.
 
template<typename STAGE , typename F >
void scheduleBackgroundTask (F &&f)
 Schedule F for one-off background execution to be finished by STAGE.
 
template<typename F >
void scheduleBackgroundOutput (F &&f)
 Schedule F(iC) for one-off background output of block data.
 
template<typename CONTEXT >
void scheduleBackgroundOutputVTK (CONTEXT &&vtkContext)
 Schedule one-off background output of given VTK CONTEXT.
 
template<typename STAGE >
void waitForBackgroundTasks (STAGE stage=STAGE{})
 Block until all background tasks scheduled for STAGE are completed.
 
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
 
template<typename STAGE >
SuperCommunicator< T, SuperLattice< T, DESCRIPTOR > > & getCommunicator (STAGE stage)
 
- Public Member Functions inherited from olb::SuperStructure< T, DESCRIPTOR::d >
virtual ~SuperStructure ()
 Virtual Destructor for inheritance.
 
 SuperStructure (CuboidDecomposition< T, D > &cuboidDecomposition, LoadBalancer< T > &loadBalancer, int overlap=2)
 Construction of a super structure.
 
CuboidDecomposition< T, D > & getCuboidDecomposition ()
 Read and write access to cuboid geometry.
 
const CuboidDecomposition< T, D > & getCuboidDecomposition () const
 Read only access to cuboid geometry.
 
int getOverlap ()
 Read and write access to the overlap.
 
int getOverlap () const
 Read only access to the overlap.
 
LoadBalancer< T > & getLoadBalancer ()
 Read and write access to the load balancer.
 
LoadBalancer< T > const & getLoadBalancer () const
 Read only access to the load balancer.
 
void forCorePhysLocations (F f) const
 Iterate over discrete physical locations.
 
void forCorePhysLocations (PhysR< T, D > min, PhysR< T, D > max, F f) const
 Iterate over discrete physical locations between min and max.
 
void forCoreSpatialLocations (F f) const
 Iterate over spatial locations NOTE: Based on physical locations (as opposed to its blockStructure version)
 
void forCoreSpatialLocations (PhysR< T, D > min, PhysR< T, D > max, F f) const
 Iterate over spatial locations between min and max NOTE: Based on physical locations (as opposed to its blockStructure version)
 
- 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 unsigned d = DESCRIPTOR::d
 

Additional Inherited Members

- Protected Member Functions inherited from olb::BufferSerializable
template<typename DataType >
void registerSerializable (const std::size_t iBlock, std::size_t &sizeBlock, std::size_t &currentBlock, size_t &sizeBufferIndex, bool *&dataPtr, DataType &data, const bool loadingMode=false)
 Register Serializable object of dynamic size.
 
template<typename DataType >
void registerStdVectorOfVars (const std::size_t iBlock, std::size_t &sizeBlock, std::size_t &currentBlock, size_t &sizeBufferIndex, bool *&dataPtr, std::vector< DataType > &data, const bool loadingMode=false)
 Method for registering a std::vector<DataType> of primitive DataType (int, double, ...)
 
template<typename DataType >
void registerStdVectorOfSerializablesOfConstSize (const std::size_t iBlock, std::size_t &sizeBlock, std::size_t &currentBlock, size_t &sizeBufferIndex, bool *&dataPtr, std::vector< DataType > &data, const bool loadingMode=false)
 Method for registering a std::vector<DataType> of constant-sized Serializable
 
template<typename DataType >
void registerStdVectorOfSerializables (const std::size_t iBlock, std::size_t &sizeBlock, std::size_t &currentBlock, size_t &sizeBufferIndex, bool *&dataPtr, std::vector< DataType > &data, const bool loadingMode=false)
 Method for registering a std::vector<DataType> of dynamic-sized DataType
 
template<typename DataTypeKey , typename DataTypeValue >
void registerMap (const std::size_t iBlock, std::size_t &sizeBlock, std::size_t &currentBlock, size_t &sizeBufferIndex, bool *&dataPtr, std::map< DataTypeKey, DataTypeValue > &data, const bool loadingMode=false)
 Method for registering a std::map<DataTypeKey, DataTypeValue> of fixed-sized types (i.e. int, double)
 
size_t addSizeToBuffer (const std::size_t iBlock, std::size_t &sizeBlock, std::size_t &currentBlock, size_t &sizeBufferIndex, bool *&dataPtr, const size_t data) const
 Add a size_t to the sizeBuffer in the n-th util::round and return that size_t in all successive rounds.
 
- 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.
 
- Protected Attributes inherited from olb::SuperStructure< T, DESCRIPTOR::d >
CuboidDecomposition< T, D > & _cuboidDecomposition
 The grid structure is referenced here.
 
LoadBalancer< T > & _loadBalancer
 Distribution of the cuboids of the cuboid structure.
 
int _overlap
 Size of ghost cell layer (must be greater than 1 and greater_overlapBC, default =1)
 
OstreamManager clout
 class specific output stream
 
- Protected Attributes inherited from olb::BufferSerializable
std::vector< bool * > _dataBuffer
 Data buffer for data that has to be buffered between two getBlock() iterations.
 
std::vector< size_t > _sizeBuffer
 std::vector of integer buffers (e.g. for std::vector size) to be buffered for the whole iteration process
 

Detailed Description

template<typename T, typename DESCRIPTOR>
class olb::SuperLattice< T, DESCRIPTOR >

Super class maintaining block lattices for a cuboid decomposition.

Definition at line 47 of file superBaseF3D.h.

Member Typedef Documentation

◆ block_t

template<typename T , typename DESCRIPTOR >
using olb::SuperLattice< T, DESCRIPTOR >::block_t = ConcretizableBlockLattice<T,DESCRIPTOR>

Definition at line 82 of file superLattice.h.

◆ descriptor_t

template<typename T , typename DESCRIPTOR >
using olb::SuperLattice< T, DESCRIPTOR >::descriptor_t = DESCRIPTOR

Descriptor / discrete velocity set of the lattice.

Definition at line 80 of file superLattice.h.

◆ value_t

template<typename T , typename DESCRIPTOR >
using olb::SuperLattice< T, DESCRIPTOR >::value_t = T

Base value type of the lattice.

Definition at line 78 of file superLattice.h.

Constructor & Destructor Documentation

◆ SuperLattice() [1/4]

template<typename T , typename DESCRIPTOR >
olb::SuperLattice< T, DESCRIPTOR >::SuperLattice ( CuboidDecomposition< T, DESCRIPTOR::d > & cuboidDecomposition,
LoadBalancer< T > & loadBalancer,
unsigned overlap = 3 )

Definition at line 109 of file superLattice.hh.

112 : SuperStructure<T,DESCRIPTOR::d>(decomposition,
113 loadBalancer,
114 overlap),
115 _statistics()
116{
117 using namespace stage;
118
119 auto& load = this->getLoadBalancer();
120
121 for (int iC = 0; iC < load.size(); ++iC) {
122 auto& cuboid = this->_cuboidDecomposition.get(load.glob(iC));
123 #ifdef PLATFORM_GPU_CUDA
124 if (load.platform(iC) == Platform::GPU_CUDA) {
125 if (gpu::cuda::device::getCount() == 0) {
126 throw std::runtime_error("Load balancer requested GPU processing for cuboid "
127 + std::to_string(load.glob(iC))
128 + " but no CUDA device was found on rank "
129 + std::to_string(singleton::mpi().getRank()));
130
131 }
132 }
133 #endif
134 _block.emplace_back(constructUsingConcretePlatform<ConcretizableBlockLattice<T,DESCRIPTOR>>(
135 load.platform(iC), cuboid.getExtent(), this->getOverlap()));
136 }
137
138 {
139 auto& communicator = getCommunicator(PostCollide());
140 communicator.template requestField<descriptors::POPULATION>();
141 communicator.requestOverlap(1); // Required for inter-block propagation
142 communicator.exchangeRequests();
143 }
144
145 {
146 auto& communicator = getCommunicator(Full());
147 DESCRIPTOR::fields_t::for_each([&](auto field) {
148 communicator.template requestField<typename decltype(field)::type>();
149 });
150 // VTK output includes overlap of 1, some implicit dependencies for overlap of 2 exist
151 communicator.requestOverlap(std::min(2, this->getOverlap()));
152 communicator.exchangeRequests();
153 }
154
155 _statisticsEnabled = true;
156 _communicationNeeded = true;
157}
bool load(std::string fileName="", const bool enforceUint=false)
Load Serializable from file fileName
SuperCommunicator< T, SuperLattice > & getCommunicator(STAGE stage=STAGE())
Return communicator for given communication stage.
CuboidDecomposition< T, D > & _cuboidDecomposition
int getRank() const
Returns the process ID.
int getCount()
Return number of available devices.
Definition device.hh:42
MpiManager & mpi()
@ GPU_CUDA
Vector CPU (AVX2 / AVX-512 collision)
CONCRETIZABLE::base_t * constructUsingConcretePlatform(Platform platform, ARGS &&... args)
Definition dispatch.h:107

References olb::SuperStructure< T, DESCRIPTOR::d >::_cuboidDecomposition, olb::constructUsingConcretePlatform(), olb::SuperLattice< T, DESCRIPTOR >::getCommunicator(), olb::gpu::cuda::device::getCount(), olb::SuperStructure< T, DESCRIPTOR::d >::getLoadBalancer(), olb::SuperStructure< T, DESCRIPTOR::d >::getOverlap(), olb::singleton::MpiManager::getRank(), olb::GPU_CUDA, olb::Serializable::load(), and olb::singleton::mpi().

+ Here is the call graph for this function:

◆ SuperLattice() [2/4]

template<typename T , typename DESCRIPTOR >
olb::SuperLattice< T, DESCRIPTOR >::SuperLattice ( CuboidDecomposition< T, DESCRIPTOR::d > & cuboidDecomposition,
LoadBalancer< T > & loadBalancer,
unsigned overlap,
const UnitConverter< T, DESCRIPTOR > & converter )
inline

Definition at line 88 of file superLattice.h.

92 : SuperLattice(cuboidDecomposition, loadBalancer, overlap)
93 {
94 _converter = &converter;
95 }
SuperLattice(CuboidDecomposition< T, DESCRIPTOR::d > &cuboidDecomposition, LoadBalancer< T > &loadBalancer, unsigned overlap=3)

◆ SuperLattice() [3/4]

template<typename T , typename DESCRIPTOR >
olb::SuperLattice< T, DESCRIPTOR >::SuperLattice ( SuperGeometry< T, DESCRIPTOR::d > & sGeometry)
inline

Definition at line 97 of file superLattice.h.

98 : SuperLattice(sGeometry.getCuboidDecomposition(),
99 sGeometry.getLoadBalancer(),
100 sGeometry.getOverlap())
101 { }

◆ SuperLattice() [4/4]

template<typename T , typename DESCRIPTOR >
olb::SuperLattice< T, DESCRIPTOR >::SuperLattice ( const SuperLattice< T, DESCRIPTOR > & )
delete

◆ ~SuperLattice()

template<typename T , typename DESCRIPTOR >
olb::SuperLattice< T, DESCRIPTOR >::~SuperLattice ( )
default

Member Function Documentation

◆ addCustomTask()

template<typename T , typename DESCRIPTOR >
template<typename STAGE >
void olb::SuperLattice< T, DESCRIPTOR >::addCustomTask ( std::function< void()> f)
inline

Schedules f for execution during every invocation of STAGE.

Definition at line 423 of file superLattice.h.

423 {
424 _customTasks[typeid(STAGE)].emplace_back(f);
425 }

◆ addPostProcessor() [1/2]

template<typename T , typename DESCRIPTOR >
template<typename STAGE >
void olb::SuperLattice< T, DESCRIPTOR >::addPostProcessor ( FunctorPtr< SuperIndicatorF< T, DESCRIPTOR::d > > && indicator,
PostProcessorPromise< T, DESCRIPTOR > && promise )

Add a non-local post-processing step.

Definition at line 729 of file superLattice.hh.

731{
732 for (int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
733 getBlock(iC).addPostProcessor(typeid(STAGE),
734 indicator->getBlockIndicatorF(iC),
735 std::forward<decltype(promise)>(promise));
736 }
737}
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.
BlockLattice< T, DESCRIPTOR > & getBlock(int locC)
Return BlockLattice with local index locC.

◆ addPostProcessor() [2/2]

template<typename T , typename DESCRIPTOR >
template<typename STAGE >
void olb::SuperLattice< T, DESCRIPTOR >::addPostProcessor ( PostProcessorPromise< T, DESCRIPTOR > && promise)

Add a non-local post-processing step.

Definition at line 741 of file superLattice.hh.

742{
743 for (int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
744 getBlock(iC).addPostProcessor(typeid(STAGE),
745 std::forward<decltype(promise)>(promise));
746 }
747}

◆ collideAndStream()

template<typename T , typename DESCRIPTOR >
void olb::SuperLattice< T, DESCRIPTOR >::collideAndStream ( )

Core implementation of a single iteration of the collide and stream loop.

  1. Pre-collision communication (optional)
  1. Collide interior of all local block lattices
  2. Post-collision communicate for inter-block propagation
  3. Block local streaming
  4. Post-stream communication for boundary conditions / post processors (optional)
  5. Execute default post processors on all local block lattices
  6. Execute manually scheduled post processing callables (optional)
  7. Post-post-process communication (optional)
  8. Reset lattice statistics and mark overlap state as unclean

Definition at line 602 of file superLattice.hh.

603{
604 if (!_initialized) [[unlikely]] {
605 initialize();
606 }
607
608 using namespace stage;
609
610 waitForBackgroundTasks(PreCollide());
611 auto& load = this->_loadBalancer;
612
613 if (_statisticsEnabled) {
615 }
616
617 // Optional pre processing stage
618 executePostProcessors(PreCollide());
619
620 // Execute custom tasks (arbitrary callables)
621 // (used for multi-stage models such as bubble model)
622 executeCustomTasks(PreCollide());
623
624 #ifdef PARALLEL_MODE_OMP
625 #pragma omp taskloop
626 #endif
627 for (int iC = 0; iC < load.size(); ++iC) {
628 _block[iC]->collide();
629 }
630
631 // Communicate propagation overlap, optional post processing
632 executePostProcessors(PostCollide());
633
634 // Block-local propagation
635 for (int iC = 0; iC < load.size(); ++iC) {
636 _block[iC]->stream();
637 }
638
639 // Communicate (default) post processor neighborhood and apply them
640 executePostProcessors(PostStream());
641
642 // Execute custom tasks (arbitrary callables)
643 // (used for multi-stage models such as free surface)
644 executeCustomTasks(PostStream());
645
646 // Final communication stage (e.g. for external coupling)
647 getCommunicator(PostPostProcess()).communicate();
648
649 if (_statisticsEnabled) {
650 collectStatistics();
651 }
652 _communicationNeeded = true;
653
654#ifdef FEATURE_EXPORT_CODE_GENERATION_TARGETS
655 if (introspection::iLattice > 1) {
656 introspection::iLattice -= 1;
657 } else {
658 this->clout << "Terminating after export of code generation targets." << std::endl
659 << "If you are confused by this message EXPORT_CODE_GENERATION_TARGETS was wrongly enabled." << std::endl;
660 std::exit(0);
661 }
662#endif
663}
void waitForBackgroundTasks(STAGE stage=STAGE{})
Block until all background tasks scheduled for STAGE are completed.
LatticeStatistics< T > & getStatistics()
Return a handle to the LatticeStatistics object.
void setParameter(FieldD< T, DESCRIPTOR, PARAMETER > field)
Update PARAMETER in all dynamics and post processors.
void executeCustomTasks(STAGE stage=STAGE())
Executes custom tasks assigned to STAGE.
void initialize()
Initialize lattice to be ready for simulation.
void executePostProcessors(STAGE stage=STAGE())
Executes post processors for STAGE.

References olb::initialize().

+ Here is the call graph for this function:

◆ communicate()

template<typename T , typename DESCRIPTOR >
void olb::SuperLattice< T, DESCRIPTOR >::communicate ( )
overridevirtual

Perform full overlap communication if needed.

Reimplemented from olb::SuperStructure< T, DESCRIPTOR::d >.

Definition at line 698 of file superLattice.hh.

699{
700 if (_communicationNeeded) {
701 getCommunicator(stage::Full()).communicate();
702 _communicationNeeded = false;
703 }
704}
+ Here is the caller graph for this function:

◆ defineDynamics() [1/7]

template<typename T , typename DESCRIPTOR >
template<template< typename... > typename DYNAMICS>
void olb::SuperLattice< T, DESCRIPTOR >::defineDynamics ( )

Set dynamics of all cells to DYNAMICS.

Definition at line 261 of file superLattice.hh.

262{
263 for (int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
264 _block[iC]->template defineDynamics<DYNAMICS>();
265 }
266}
void defineDynamics()
Set dynamics of all cells to DYNAMICS.
+ Here is the caller graph for this function:

◆ defineDynamics() [2/7]

template<typename T , typename DESCRIPTOR >
template<template< typename... > typename DYNAMICS>
void olb::SuperLattice< T, DESCRIPTOR >::defineDynamics ( )

Set dynamics of all cells to DYNAMICS.

◆ defineDynamics() [3/7]

template<typename T , typename DESCRIPTOR >
template<template< typename... > typename DYNAMICS>
void olb::SuperLattice< T, DESCRIPTOR >::defineDynamics ( FunctorPtr< SuperIndicatorF< T, DESCRIPTOR::d > > && indicator)

Definition at line 279 of file superLattice.hh.

280{
281 for (int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
282 _block[iC]->template defineDynamics<DYNAMICS>(indicator->getBlockIndicatorF(iC));
283 }
284}

◆ defineDynamics() [4/7]

template<typename T , typename DESCRIPTOR >
template<template< typename... > typename DYNAMICS>
void olb::SuperLattice< T, DESCRIPTOR >::defineDynamics ( FunctorPtr< SuperIndicatorF< T, DESCRIPTOR::d > > && indicator)

Set dynamics of indicated cells to DYNAMICS<T,DESCRIPTOR>

◆ defineDynamics() [5/7]

template<typename T , typename DESCRIPTOR >
void olb::SuperLattice< T, DESCRIPTOR >::defineDynamics ( FunctorPtr< SuperIndicatorF< T, DESCRIPTOR::d > > && indicator,
DynamicsPromise< T, DESCRIPTOR > && promise )

Definition at line 310 of file superLattice.hh.

312{
313 for (int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
314 _block[iC]->defineDynamics(indicator->getBlockIndicatorF(iC), std::forward<DynamicsPromise<T,DESCRIPTOR>&&>(promise));
315 }
316}
DynamicsPromise(meta::id< DYNAMICS >) -> DynamicsPromise< typename DYNAMICS::value_t, typename DYNAMICS::descriptor_t >

◆ defineDynamics() [6/7]

template<typename T , typename DESCRIPTOR >
template<template< typename... > typename DYNAMICS>
void olb::SuperLattice< T, DESCRIPTOR >::defineDynamics ( SuperGeometry< T, DESCRIPTOR::d > & sGeometry,
int material )

Set dynamics of material cells to DYNAMICS.

Definition at line 288 of file superLattice.hh.

289{
290 defineDynamics<DYNAMICS>(sGeometry.getMaterialIndicator(material));
291}

References olb::SuperGeometry< T, D >::getMaterialIndicator().

+ Here is the call graph for this function:

◆ defineDynamics() [7/7]

template<typename T , typename DESCRIPTOR >
template<template< typename... > typename DYNAMICS>
void olb::SuperLattice< T, DESCRIPTOR >::defineDynamics ( SuperGeometry< T, DESCRIPTOR::d > & sGeometry,
int material )

Set dynamics of indicated cells to DYNAMICS<T,DESCRIPTOR>

◆ defineField() [1/6]

template<typename T , typename DESCRIPTOR >
template<typename FIELD >
void olb::SuperLattice< T, DESCRIPTOR >::defineField ( FunctorPtr< SuperIndicatorF< T, DESCRIPTOR::d > > && indicator,
AnalyticalF< DESCRIPTOR::d, T, T > & field )

Defines a field on a domain described by an indicator.

Definition at line 448 of file superLattice.hh.

450{
451 for (int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
452 _block[iC]->template defineField<FIELD>(indicator->getBlockIndicatorF(iC),
453 field);
454 }
455 _communicationNeeded = true;
456}
void defineField(FunctorPtr< SuperIndicatorF< T, DESCRIPTOR::d > > &&indicator, FunctorPtr< SuperF< DESCRIPTOR::d, T, T > > &&field)
Define an external field on a domain described by an indicator.

◆ defineField() [2/6]

template<typename T , typename DESCRIPTOR >
template<typename FIELD >
void olb::SuperLattice< T, DESCRIPTOR >::defineField ( FunctorPtr< SuperIndicatorF< T, DESCRIPTOR::d > > && indicator,
FunctorPtr< SuperF< DESCRIPTOR::d, T, T > > && field )

Define an external field on a domain described by an indicator.

Definition at line 418 of file superLattice.hh.

420{
421 if (field->getBlockFSize() == this->_loadBalancer.size()) {
422 for (int iC=0; iC < this->_loadBalancer.size(); ++iC) {
423 _block[iC]->template defineField<FIELD>(indicator->getBlockIndicatorF(iC),
424 field->getBlockF(iC));
425 }
426 }
427 else {
429 int coords[DESCRIPTOR::d+1];
430 for (int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
431 _block[iC]->forSpatialLocations([&](LatticeR<DESCRIPTOR::d> loc) {
432 coords[0] = iC;
433 for (int j = 0; j < DESCRIPTOR::d; ++j) {
434 coords[j+1] = loc[j];
435 }
436 if (indicator(coords)) {
437 field(fieldTmp.data(), coords);
438 _block[iC]->get(loc).template setField<FIELD>(fieldTmp);
439 }
440 });
441 }
442 }
443 _communicationNeeded = true;
444}
std::enable_if_t< DESCRIPTOR::d==2, std::shared_ptr< SuperF2D< T > > > field(SuperLattice< T, DESCRIPTOR > &sLattice)
Returns external field functor.
Vector< typename FIELD::template value_type< T >, DESCRIPTOR::template size< FIELD >() > FieldD
Vector storing a single field instance.
Definition vector.h:480
Vector< std::int32_t, D > LatticeR
Type for spatial block-local lattice coordinates.

◆ defineField() [3/6]

template<typename T , typename DESCRIPTOR >
template<typename FIELD >
void olb::SuperLattice< T, DESCRIPTOR >::defineField ( SuperGeometry< T, DESCRIPTOR::d > & sGeometry,
IndicatorF< T, DESCRIPTOR::d > & indicator,
AnalyticalF< DESCRIPTOR::d, T, T > & field )

Defines a field on a indicated domain.

Definition at line 477 of file superLattice.hh.

480{
481 SuperIndicatorFfromIndicatorF<T,DESCRIPTOR::d> indicatorF(indicator, sGeometry);
482 defineField<FIELD>(indicatorF, field);
483}
std::conditional_t< D==2, SuperIndicatorFfromIndicatorF2D< T >, SuperIndicatorFfromIndicatorF3D< T > > SuperIndicatorFfromIndicatorF
Definition aliases.h:277

◆ defineField() [4/6]

template<typename T , typename DESCRIPTOR >
template<typename FIELD >
void olb::SuperLattice< T, DESCRIPTOR >::defineField ( SuperGeometry< T, DESCRIPTOR::d > & sGeometry,
IndicatorF< T, DESCRIPTOR::d > & indicator,
FunctorPtr< SuperF< DESCRIPTOR::d, T, T > > && field )

Defines a field on a indicated domain.

Definition at line 487 of file superLattice.hh.

490{
491 SuperIndicatorFfromIndicatorF<T,DESCRIPTOR::d> indicatorF(indicator, sGeometry);
492 defineField<FIELD>(indicatorF, std::forward<decltype(field)>(field));
493}

◆ defineField() [5/6]

template<typename T , typename DESCRIPTOR >
template<typename FIELD >
void olb::SuperLattice< T, DESCRIPTOR >::defineField ( SuperGeometry< T, DESCRIPTOR::d > & sGeometry,
int material,
AnalyticalF< DESCRIPTOR::d, T, T > & field )

Defines a field on a domain with a particular material number.

Definition at line 468 of file superLattice.hh.

471{
472 defineField<FIELD>(sGeometry.getMaterialIndicator(material), field);
473}

References olb::SuperGeometry< T, D >::getMaterialIndicator().

+ Here is the call graph for this function:

◆ defineField() [6/6]

template<typename T , typename DESCRIPTOR >
template<typename FIELD >
void olb::SuperLattice< T, DESCRIPTOR >::defineField ( SuperGeometry< T, DESCRIPTOR::d > & sGeometry,
int material,
FunctorPtr< SuperF< DESCRIPTOR::d, T, T > > && field )

Define an external field on a domain with a particular material number.

Definition at line 460 of file superLattice.hh.

462{
463 defineField<FIELD>(sGeometry.getMaterialIndicator(material), std::forward<decltype(field)>(field));
464}

References olb::SuperGeometry< T, D >::getMaterialIndicator().

+ Here is the call graph for this function:

◆ definePopulations() [1/4]

template<typename T , typename DESCRIPTOR >
void olb::SuperLattice< T, DESCRIPTOR >::definePopulations ( FunctorPtr< SuperIndicatorF< T, DESCRIPTOR::d > > && indicator,
AnalyticalF< DESCRIPTOR::d, T, T > & Pop )

Define a population on a domain described by an indicator.

Parameters
indicatorIndicator describing the target domain
PopAnalytical functor, target dimension DESCRIPTOR::q

Definition at line 382 of file superLattice.hh.

384{
385 for (int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
386 _block[iC]->definePopulations(indicator->getBlockIndicatorF(iC), Pop);
387 }
388 _communicationNeeded = true;
389}

◆ definePopulations() [2/4]

template<typename T , typename DESCRIPTOR >
void olb::SuperLattice< T, DESCRIPTOR >::definePopulations ( FunctorPtr< SuperIndicatorF< T, DESCRIPTOR::d > > && indicator,
SuperF< DESCRIPTOR::d, T, T > & Pop )
Parameters
indicatorIndicator describing the target domain
PopSuper functor, target dimension DESCRIPTOR::q

Definition at line 399 of file superLattice.hh.

401{
402 for (int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
403 _block[iC]->definePopulations(indicator->getBlockIndicatorF(iC), Pop.getBlockF(iC));
404 }
405 _communicationNeeded = true;
406}

◆ definePopulations() [3/4]

template<typename T , typename DESCRIPTOR >
void olb::SuperLattice< T, DESCRIPTOR >::definePopulations ( SuperGeometry< T, DESCRIPTOR::d > & sGeometry,
int material,
AnalyticalF< DESCRIPTOR::d, T, T > & Pop )

Define a population on a domain with a particular material number.

Definition at line 392 of file superLattice.hh.

394{
395 definePopulations(sGeometry.getMaterialIndicator(material), Pop);
396}
void definePopulations(FunctorPtr< SuperIndicatorF< T, DESCRIPTOR::d > > &&indicator, AnalyticalF< DESCRIPTOR::d, T, T > &Pop)
Define a population on a domain described by an indicator.

References olb::SuperGeometry< T, D >::getMaterialIndicator().

+ Here is the call graph for this function:

◆ definePopulations() [4/4]

template<typename T , typename DESCRIPTOR >
void olb::SuperLattice< T, DESCRIPTOR >::definePopulations ( SuperGeometry< T, DESCRIPTOR::d > & sGeometry,
int material,
SuperF< DESCRIPTOR::d, T, T > & Pop )

Define a population on a domain with a particular material number.

Definition at line 409 of file superLattice.hh.

411{
412 definePopulations(sGeometry.getMaterialIndicator(material), Pop);
413}

◆ defineRho() [1/2]

template<typename T , typename DESCRIPTOR >
void olb::SuperLattice< T, DESCRIPTOR >::defineRho ( FunctorPtr< SuperIndicatorF< T, DESCRIPTOR::d > > && indicator,
AnalyticalF< DESCRIPTOR::d, T, T > & rho )

Define rho on a domain described by an indicator.

Parameters
indicatorIndicator describing the target domain
rhoAnalytical functor

Definition at line 320 of file superLattice.hh.

322{
323 for (int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
324 _block[iC]->defineRho(indicator->getBlockIndicatorF(iC),
325 rho);
326 }
327 _communicationNeeded = true;
328}

◆ defineRho() [2/2]

template<typename T , typename DESCRIPTOR >
void olb::SuperLattice< T, DESCRIPTOR >::defineRho ( SuperGeometry< T, DESCRIPTOR::d > & sGeometry,
int material,
AnalyticalF< DESCRIPTOR::d, T, T > & rho )

Define rho on a domain with a particular material number.

Definition at line 331 of file superLattice.hh.

333{
334 defineRho(sGeometry.getMaterialIndicator(material), rho);
335}
void defineRho(FunctorPtr< SuperIndicatorF< T, DESCRIPTOR::d > > &&, AnalyticalF< DESCRIPTOR::d, T, T > &rho)
Define rho on a domain described by an indicator.

References olb::SuperGeometry< T, D >::getMaterialIndicator().

+ Here is the call graph for this function:

◆ defineRhoU() [1/2]

template<typename T , typename DESCRIPTOR >
void olb::SuperLattice< T, DESCRIPTOR >::defineRhoU ( FunctorPtr< SuperIndicatorF< 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
indicatorIndicator describing the target domain
rhoAnalytical functor
uAnalytical functor

Definition at line 359 of file superLattice.hh.

362{
363 #ifdef PARALLEL_MODE_OMP
364 #pragma omp parallel for schedule(dynamic,1)
365 #endif
366 for (int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
367 _block[iC]->defineRhoU(indicator->getBlockIndicatorF(iC),
368 rho, u);
369 }
370 _communicationNeeded = true;
371}

◆ defineRhoU() [2/2]

template<typename T , typename DESCRIPTOR >
void olb::SuperLattice< T, DESCRIPTOR >::defineRhoU ( SuperGeometry< T, DESCRIPTOR::d > & sGeometry,
int material,
AnalyticalF< DESCRIPTOR::d, T, T > & rho,
AnalyticalF< DESCRIPTOR::d, T, T > & u )

Define rho and u on a domain with a particular material number.

Definition at line 374 of file superLattice.hh.

377{
378 defineRhoU(sGeometry.getMaterialIndicator(material), rho, u);
379}
void defineRhoU(FunctorPtr< SuperIndicatorF< 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.

References olb::SuperGeometry< T, D >::getMaterialIndicator().

+ Here is the call graph for this function:

◆ defineU() [1/2]

template<typename T , typename DESCRIPTOR >
void olb::SuperLattice< T, DESCRIPTOR >::defineU ( FunctorPtr< SuperIndicatorF< T, DESCRIPTOR::d > > && indicator,
AnalyticalF< DESCRIPTOR::d, T, T > & u )

Define u on a domain described by an indicator.

Parameters
indicatorIndicator describing the target domain
uAnalytical functor

Definition at line 338 of file superLattice.hh.

340{
341 #ifdef PARALLEL_MODE_OMP
342 #pragma omp parallel for schedule(dynamic,1)
343 #endif
344 for (int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
345 _block[iC]->defineU(indicator->getBlockIndicatorF(iC),
346 u);
347 }
348 _communicationNeeded = true;
349}

◆ defineU() [2/2]

template<typename T , typename DESCRIPTOR >
void olb::SuperLattice< T, DESCRIPTOR >::defineU ( SuperGeometry< T, DESCRIPTOR::d > & sGeometry,
int material,
AnalyticalF< DESCRIPTOR::d, T, T > & u )

Define u on a domain with a particular material number.

Definition at line 352 of file superLattice.hh.

354{
355 defineU(sGeometry.getMaterialIndicator(material), u);
356}
void defineU(FunctorPtr< SuperIndicatorF< T, DESCRIPTOR::d > > &&indicator, AnalyticalF< DESCRIPTOR::d, T, T > &u)
Define u on a domain described by an indicator.

References olb::SuperGeometry< T, D >::getMaterialIndicator().

+ Here is the call graph for this function:

◆ executeCustomTasks()

template<typename T , typename DESCRIPTOR >
template<typename STAGE >
void olb::SuperLattice< T, DESCRIPTOR >::executeCustomTasks ( STAGE stage = STAGE())

Executes custom tasks assigned to STAGE.

Definition at line 751 of file superLattice.hh.

752{
753 for (auto& f : _customTasks[typeid(STAGE)]) {
754 f();
755 }
756}

◆ executePostProcessors()

template<typename T , typename DESCRIPTOR >
template<typename STAGE >
void olb::SuperLattice< T, DESCRIPTOR >::executePostProcessors ( STAGE stage = STAGE())

Executes post processors for STAGE.

  1. Pre-communication for STAGE
  2. Execute post processors for STAGE on all block lattices

Definition at line 667 of file superLattice.hh.

668{
669 #ifdef PLATFORM_GPU_CUDA
671 #endif
672
673 getCommunicator(stage).communicate();
674
675 auto& load = this->_loadBalancer;
676
677 #ifdef PARALLEL_MODE_OMP
678 #pragma omp taskloop
679 #endif
680 for (int iC = 0; iC < load.size(); ++iC) {
681 _block[iC]->template postProcess<STAGE>();
682 }
683}
void synchronize()
Synchronize device.
Definition device.hh:64

References olb::gpu::cuda::device::synchronize().

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

◆ forBlocksOnPlatform()

template<typename T , typename DESCRIPTOR >
template<Platform PLATFORM, typename F >
void olb::SuperLattice< T, DESCRIPTOR >::forBlocksOnPlatform ( F f)
inline

Apply f to every ConcreteBlockLattice of PLATFORM.

Definition at line 142 of file superLattice.h.

142 {
143 for (int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
144 if (_block[iC]->getPlatform() == PLATFORM) {
145 f(static_cast<ConcreteBlockLattice<T,DESCRIPTOR,PLATFORM>&>(*_block[iC]));
146 }
147 }
148 };

References olb::SuperStructure< T, DESCRIPTOR::d >::_loadBalancer.

◆ get() [1/2]

template<typename T , typename DESCRIPTOR >
Cell< T, DESCRIPTOR > olb::SuperLattice< T, DESCRIPTOR >::get ( LatticeR< DESCRIPTOR::d+1 > latticeR)

Get local cell interface.

Definition at line 160 of file superLattice.hh.

161{
162#ifdef PARALLEL_MODE_MPI
163 if (this->_loadBalancer.isLocal(latticeR[0])) {
164 if constexpr (DESCRIPTOR::d == 3) {
165 return _block[this->_loadBalancer.loc(latticeR[0])]->get(latticeR[1], latticeR[2], latticeR[3]);
166 } else {
167 return _block[this->_loadBalancer.loc(latticeR[0])]->get(latticeR[1], latticeR[2]);
168 }
169 }
170 else {
171 throw std::domain_error("Cuboid iC must be locally available");
172 }
173#else
174 if constexpr (DESCRIPTOR::d == 3) {
175 return _block[this->_loadBalancer.loc(latticeR[0])]->get(latticeR[1], latticeR[2], latticeR[3]);
176 } else {
177 return _block[this->_loadBalancer.loc(latticeR[0])]->get(latticeR[1], latticeR[2]);
178 }
179#endif
180}
+ Here is the caller graph for this function:

◆ get() [2/2]

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

Get local cell interface.

Definition at line 185 of file superLattice.hh.

186{
187 return get({latticeR...});
188}
Cell< T, DESCRIPTOR > get(LatticeR< DESCRIPTOR::d+1 > latticeR)
Get local cell interface.

◆ getBlock() [1/5]

template<typename T , typename DESCRIPTOR >
BlockLattice< T, DESCRIPTOR > & olb::SuperLattice< T, DESCRIPTOR >::getBlock ( int locC)
inline

Return BlockLattice with local index locC.

Definition at line 115 of file superLattice.h.

116 {
117 return *_block[locC];
118 };
+ Here is the caller graph for this function:

◆ getBlock() [2/5]

template<typename T , typename DESCRIPTOR >
template<typename BLOCK >
BLOCK & olb::SuperLattice< T, DESCRIPTOR >::getBlock ( int locC)
inline

Return locC-th block lattice casted to BLOCK.

Only safe to use under external knownledge that the locC-th block is of type BLOCK

Definition at line 124 of file superLattice.h.

125 {
126 return *dynamic_cast<BLOCK*>(_block[locC].get());
127 };

◆ getBlock() [3/5]

template<typename T , typename DESCRIPTOR >
const BlockLattice< T, DESCRIPTOR > & olb::SuperLattice< T, DESCRIPTOR >::getBlock ( int locC) const
inline

Return read-only BlockLattice with local index locC.

Definition at line 129 of file superLattice.h.

130 {
131 return *_block[locC];
132 };

◆ getBlock() [4/5]

template<typename T , typename DESCRIPTOR >
template<typename BLOCK >
const BLOCK & olb::SuperLattice< T, DESCRIPTOR >::getBlock ( int locIC) const
inline

Return locC-th block lattice casted to BLOCK (read-only)

Definition at line 135 of file superLattice.h.

136 {
137 return *dynamic_cast<const BLOCK*>(_block[locIC].get());
138 };

◆ getBlock() [5/5]

template<typename T , typename DESCRIPTOR >
bool * olb::SuperLattice< T, DESCRIPTOR >::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 824 of file superLattice.hh.

825{
826 std::size_t currentBlock = 0;
827 bool* dataPtr = nullptr;
828
829 for (std::size_t iC=0; iC < _block.size(); ++iC) {
830 registerSerializableOfConstSize(iBlock, sizeBlock, currentBlock, dataPtr, getBlock(iC), loadingMode);
831 }
832
833 return dataPtr;
834}
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

◆ getCommunicator() [1/2]

template<typename T , typename DESCRIPTOR >
template<typename STAGE >
SuperCommunicator< T, SuperLattice< T, DESCRIPTOR > > & olb::SuperLattice< T, DESCRIPTOR >::getCommunicator ( STAGE stage)

Definition at line 687 of file superLattice.hh.

688{
689 auto iter = _communicator.find(typeid(STAGE));
690 if (iter == _communicator.end()) {
691 iter = std::get<0>(_communicator.emplace(typeid(STAGE),
692 std::make_unique<SuperCommunicator<T,SuperLattice>>(*this)));
693 }
694 return *std::get<1>(*iter);
695}
SuperCommunicator(SUPER &) -> SuperCommunicator< typename SUPER::value_t, SUPER >

◆ getCommunicator() [2/2]

template<typename T , typename DESCRIPTOR >
template<typename STAGE >
SuperCommunicator< T, SuperLattice > & olb::SuperLattice< T, DESCRIPTOR >::getCommunicator ( STAGE stage = STAGE())

Return communicator for given communication stage.

+ Here is the caller graph for this function:

◆ getConverter()

template<typename T , typename DESCRIPTOR >
const UnitConverter< T, DESCRIPTOR > & olb::SuperLattice< T, DESCRIPTOR >::getConverter ( ) const
inline

Definition at line 106 of file superLattice.h.

106 {
107 if (_converter) {
108 return **_converter;
109 } else {
110 throw std::runtime_error("Unit converter not provided");
111 }
112 }
+ Here is the caller graph for this function:

◆ getNblock()

template<typename T , typename DESCRIPTOR >
std::size_t olb::SuperLattice< T, DESCRIPTOR >::getNblock ( ) const
overridevirtual

Number of data blocks for the serializable interface.

Implements olb::Serializable.

Definition at line 807 of file superLattice.hh.

808{
809 return std::accumulate(_block.begin(), _block.end(), size_t(0), [](std::size_t sum, auto& b) -> std::size_t {
810 return sum + b->getNblock();
811 });
812}

◆ getSerializableSize()

template<typename T , typename DESCRIPTOR >
std::size_t olb::SuperLattice< T, DESCRIPTOR >::getSerializableSize ( ) const
overridevirtual

Binary size for the serializer.

Implements olb::Serializable.

Definition at line 816 of file superLattice.hh.

817{
818 return std::accumulate(_block.begin(), _block.end(), size_t(0), [](std::size_t sum, auto& b) -> std::size_t {
819 return sum + b->getSerializableSize();
820 });
821}

◆ getStatistics() [1/2]

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

Return a handle to the LatticeStatistics object.

Definition at line 716 of file superLattice.hh.

717{
718 return _statistics;
719}

◆ getStatistics() [2/2]

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

Return a constant handle to the LatticeStatistics object.

Definition at line 722 of file superLattice.hh.

723{
724 return _statistics;
725}

◆ iniEquilibrium() [1/4]

template<typename T , typename DESCRIPTOR >
void olb::SuperLattice< T, DESCRIPTOR >::iniEquilibrium ( FunctorPtr< SuperIndicatorF< 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
indicatorIndicator describing the target domain
rhoAnalytical functor (global)
uAnalytical functor (global)

Definition at line 542 of file superLattice.hh.

545{
546 for (int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
547 _block[iC]->iniEquilibrium(indicator->getBlockIndicatorF(iC), rho, u);
548 }
549 _communicationNeeded = true;
550}

◆ iniEquilibrium() [2/4]

template<typename T , typename DESCRIPTOR >
void olb::SuperLattice< T, DESCRIPTOR >::iniEquilibrium ( FunctorPtr< SuperIndicatorF< T, DESCRIPTOR::d > > && indicator,
AnalyticalF< DESCRIPTOR::d, T, T > & rho,
SuperF< DESCRIPTOR::d, T, T > & u )

Definition at line 561 of file superLattice.hh.

564{
565 for (int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
566 _block[iC]->iniEquilibrium(indicator->getBlockIndicatorF(iC), rho, u.getBlockF(iC));
567 }
568 _communicationNeeded = true;
569}

◆ iniEquilibrium() [3/4]

template<typename T , typename DESCRIPTOR >
void olb::SuperLattice< T, DESCRIPTOR >::iniEquilibrium ( SuperGeometry< T, DESCRIPTOR::d > & sGeometry,
int material,
AnalyticalF< DESCRIPTOR::d, T, T > & rho,
AnalyticalF< DESCRIPTOR::d, T, T > & u )

Initialize by equilibrium on a domain with a particular material number.

Definition at line 553 of file superLattice.hh.

556{
557 iniEquilibrium(sGeometry.getMaterialIndicator(material), rho, u);
558}
void iniEquilibrium(FunctorPtr< SuperIndicatorF< 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.

References olb::SuperGeometry< T, D >::getMaterialIndicator().

+ Here is the call graph for this function:

◆ iniEquilibrium() [4/4]

template<typename T , typename DESCRIPTOR >
void olb::SuperLattice< T, DESCRIPTOR >::iniEquilibrium ( SuperGeometry< T, DESCRIPTOR::d > & sGeometry,
int material,
AnalyticalF< DESCRIPTOR::d, T, T > & rho,
SuperF< DESCRIPTOR::d, T, T > & u )

Definition at line 572 of file superLattice.hh.

575{
576 iniEquilibrium(sGeometry.getMaterialIndicator(material), rho, u);
577}

References olb::SuperGeometry< T, D >::getMaterialIndicator().

+ Here is the call graph for this function:

◆ iniRegularized() [1/2]

template<typename T , typename DESCRIPTOR >
void olb::SuperLattice< T, DESCRIPTOR >::iniRegularized ( FunctorPtr< SuperIndicatorF< 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
indicatorIndicator describing the target domain
rhoAnalytical functor (global)
uAnalytical functor (global)
piAnalytical functor (global)

Definition at line 581 of file superLattice.hh.

585{
586 for (int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
587 _block[iC]->iniRegularized(indicator->getBlockIndicatorF(iC), rho, u, pi);
588 }
589 _communicationNeeded = true;
590}

◆ iniRegularized() [2/2]

template<typename T , typename DESCRIPTOR >
void olb::SuperLattice< T, DESCRIPTOR >::iniRegularized ( SuperGeometry< T, DESCRIPTOR::d > & sGeometry,
int material,
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 with a particular material number.

Definition at line 593 of file superLattice.hh.

597{
598 iniRegularized(sGeometry.getMaterialIndicator(material), rho, u, pi);
599}
void iniRegularized(FunctorPtr< SuperIndicatorF< 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.

References olb::SuperGeometry< T, D >::getMaterialIndicator().

+ Here is the call graph for this function:

◆ initialize()

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

Initialize lattice to be ready for simulation.

Calls default post processors (PostStream) once and switches processing context to simulation.

Definition at line 191 of file superLattice.hh.

192{
193 if (!_initialized) {
194 for (int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
195 _block[iC]->initialize();
196 }
197 _communicationNeeded = true;
198
199#ifdef FEATURE_EXPORT_CODE_GENERATION_TARGETS
200 writeSummary("lattice" + std::to_string(introspection::iLattice++));
201#endif
202 _initialized = true;
203 }
204}
void writeSummary(std::string fileName="lattice") const
Writes a summary of all dynamics and post processors.
+ Here is the caller graph for this function:

◆ postLoad()

template<typename T , typename DESCRIPTOR >
void olb::SuperLattice< T, DESCRIPTOR >::postLoad ( )
overridevirtual

Reimplemented from olb::Serializable.

Definition at line 837 of file superLattice.hh.

838{
839 for (int iC=0; iC < this->_loadBalancer.size(); ++iC) {
840 _block[iC]->postLoad();
841 }
842}

◆ printSummary()

template<typename T , typename DESCRIPTOR >
void olb::SuperLattice< T, DESCRIPTOR >::printSummary ( ) const

Prints a summary of all dynamics and post processors.

For brevity only of the first block of the root process

Definition at line 207 of file superLattice.hh.

208{
209 _block[0]->writeDescription(this->clout);
210}

◆ scheduleBackgroundOutput()

template<typename T , typename DESCRIPTOR >
template<typename F >
void olb::SuperLattice< T, DESCRIPTOR >::scheduleBackgroundOutput ( F && f)

Schedule F(iC) for one-off background output of block data.

Definition at line 767 of file superLattice.hh.

768{
769 auto& load = this->getLoadBalancer();
770 for (int iC=0; iC < load.size(); ++iC) {
771 if (isPlatformCPU(load.platform(iC))) {
773 }
774 }
775 for (int iC=0; iC < load.size(); ++iC) {
776 if (load.platform(iC) == Platform::GPU_CUDA) {
778 }
779 }
780}
void scheduleBackgroundTask(F &&f)
Schedule F for one-off background execution to be finished by STAGE.
constexpr bool isPlatformCPU(Platform platform)
Returns true if platform is equal to Platform::CPU_*.
Definition platform.h:83

References olb::GPU_CUDA, and olb::isPlatformCPU().

+ Here is the call graph for this function:

◆ scheduleBackgroundOutputVTK()

template<typename T , typename DESCRIPTOR >
template<typename CONTEXT >
void olb::SuperLattice< T, DESCRIPTOR >::scheduleBackgroundOutputVTK ( CONTEXT && vtkContext)

Schedule one-off background output of given VTK CONTEXT.

CONTEXT must accept tasks as a callable task for which it provides SuperVTMwriter(2,3)D and iT arguments.

Definition at line 784 of file superLattice.hh.

785{
786 vtkContext([](auto& writer, std::size_t iT) {
787 writer.writePVD(iT);
788 });
789 scheduleBackgroundOutput([vtkContext](int iC) {
790 vtkContext([&](auto& writer, std::size_t iT) {
791 writer.writeVTI(iT, iC);
792 });
793 });
794}
void scheduleBackgroundOutput(F &&f)
Schedule F(iC) for one-off background output of block data.

◆ scheduleBackgroundTask()

template<typename T , typename DESCRIPTOR >
template<typename STAGE , typename F >
void olb::SuperLattice< T, DESCRIPTOR >::scheduleBackgroundTask ( F && f)

Schedule F for one-off background execution to be finished by STAGE.

Definition at line 760 of file superLattice.hh.

761{
762 _backgroundTasks[typeid(STAGE)].emplace_back(singleton::pool().schedule(f));
763}
ThreadPool & pool()
Definition olbInit.cpp:41

References olb::singleton::pool().

+ Here is the call graph for this function:

◆ setParameter() [1/2]

template<typename T , typename DESCRIPTOR >
template<typename PARAMETER , typename _DESCRIPTOR , typename FIELD >
void olb::SuperLattice< T, DESCRIPTOR >::setParameter ( AbstractFieldArrayD< T, _DESCRIPTOR, FIELD > & abstractFieldArray)

Set PARAMETER to column pointers of given field array.

PARAMETER must store size(FIELD) pointers to the value type of FIELD.

Useful for providing dynamically sized field arrays as parameters to certain post processors.

Definition at line 527 of file superLattice.hh.

528{
529 static_assert(DESCRIPTOR::template size<PARAMETER>() == DESCRIPTOR::template size<FIELD>(),
530 "PARAMETER size must equal FIELD size");
531 static_assert(std::is_same_v<typename PARAMETER::template value_type<T>,
532 typename FIELD::template value_type<T>*>,
533 "PARAMETER must store pointers to FIELD components");
534 // auto test = PARAMETER::template getMaxValue<T,DESCRIPTOR>();
535 // std::cout << test<< std::endl;
536 for (int iC=0; iC < this->getLoadBalancer().size(); ++iC) {
537 _block[iC]->template setParameter<PARAMETER>(abstractFieldArray);
538 }
539}

◆ setParameter() [2/2]

template<typename T , typename DESCRIPTOR >
template<typename PARAMETER >
void olb::SuperLattice< T, DESCRIPTOR >::setParameter ( FieldD< T, DESCRIPTOR, PARAMETER > field)

Update PARAMETER in all dynamics and post processors.

e.g. SuperLattice::setParameter<OMEGA>(0.6) sets the parameter OMEGA to 0.6 in all operators that declare it as one of their parameters.

Definition at line 497 of file superLattice.hh.

498{
499 if (!PARAMETER::template isValid<T,DESCRIPTOR,PARAMETER>(field)) {
500 const std::string error = "Value of parameter " + fields::name<PARAMETER>() + " is invalid";
501 throw std::invalid_argument(error);
502 }
503 for (int iC=0; iC < this->getLoadBalancer().size(); ++iC) {
504 _block[iC]->template setParameter<PARAMETER>(field);
505 }
506}
std::string name()
Returns name of FIELD for human consumption.
Definition fields.h:49

References olb::fields::name().

+ Here is the call graph for this function:

◆ setParameterOfDynamics() [1/2]

template<typename T , typename DESCRIPTOR >
template<typename PARAMETER , template< typename... > typename DYNAMICS>
void olb::SuperLattice< T, DESCRIPTOR >::setParameterOfDynamics ( FieldD< T, DESCRIPTOR, PARAMETER > && field)

Update PARAMETER in DYNAMICS.

Definition at line 510 of file superLattice.hh.

511{
512 for (int iC=0; iC < this->getLoadBalancer().size(); ++iC) {
513 _block[iC]->template getData<OperatorParameters<DYNAMICS>>().template set<PARAMETER>(
514 std::forward<decltype(field)>(field));
515 }
516}

◆ setParameterOfDynamics() [2/2]

template<typename T , typename DESCRIPTOR >
template<typename PARAMETER , template< typename... > typename DYNAMICS>
void olb::SuperLattice< T, DESCRIPTOR >::setParameterOfDynamics ( FieldD< T, DESCRIPTOR, PARAMETER > && field)

Update PARAMETER in DYNAMICS<T,DESCRIPTOR>

◆ setProcessingContext() [1/2]

template<typename T , typename DESCRIPTOR >
void olb::SuperLattice< T, DESCRIPTOR >::setProcessingContext ( ProcessingContext context)
inline

Set processing context of block lattices.

Used to sync data between device and host

Definition at line 154 of file superLattice.h.

155 {
156 // Communicate overlap prior to evaluation
157 if (context == ProcessingContext::Evaluation) {
158 communicate();
160 }
161 for (int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
162 _block[iC]->setProcessingContext(context);
163 }
164 };
void communicate() override
Perform full overlap communication if needed.

References olb::SuperStructure< T, DESCRIPTOR::d >::_loadBalancer, olb::SuperLattice< T, DESCRIPTOR >::communicate(), olb::Evaluation, and olb::SuperLattice< T, DESCRIPTOR >::waitForBackgroundTasks().

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

◆ setProcessingContext() [2/2]

template<typename T , typename DESCRIPTOR >
template<typename FIELD_TYPE >
void olb::SuperLattice< T, DESCRIPTOR >::setProcessingContext ( ProcessingContext context)
inline

Set processing context of FIELD_TYPE in block lattices.

Used to sync data between device and host

Definition at line 171 of file superLattice.h.

172 {
173 for (int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
174 if (_block[iC]->template hasData<FIELD_TYPE>()) {
175 _block[iC]->template getData<FIELD_TYPE>().setProcessingContext(context);
176 }
177 }
178 };

References olb::SuperStructure< T, DESCRIPTOR::d >::_loadBalancer.

◆ statisticsOff()

template<typename T , typename DESCRIPTOR >
void olb::SuperLattice< T, DESCRIPTOR >::statisticsOff ( )
inline

Switch Statistics off (default on)

This speeds up the execution time

Definition at line 397 of file superLattice.h.

398 {
399 _statisticsEnabled = false;
400 for (int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
401 _block[iC]->setStatisticsEnabled(false);
402 }
403 };

References olb::SuperStructure< T, DESCRIPTOR::d >::_loadBalancer.

◆ statisticsOn()

template<typename T , typename DESCRIPTOR >
void olb::SuperLattice< T, DESCRIPTOR >::statisticsOn ( )
inline

Switch Statistics on (default on)

Definition at line 386 of file superLattice.h.

387 {
388 _statisticsEnabled = true;
389 for (int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
390 _block[iC]->setStatisticsEnabled(true);
391 }
392 };

References olb::SuperStructure< T, DESCRIPTOR::d >::_loadBalancer.

◆ stripeOffDensityOffset()

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

Subtract constant offset from the density.

Definition at line 707 of file superLattice.hh.

708{
709 for (int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
710 _block[iC]->stripeOffDensityOffset(offset);
711 }
712 _communicationNeeded = true;
713}

◆ waitForBackgroundTasks()

template<typename T , typename DESCRIPTOR >
template<typename STAGE >
void olb::SuperLattice< T, DESCRIPTOR >::waitForBackgroundTasks ( STAGE stage = STAGE{})

Block until all background tasks scheduled for STAGE are completed.

Definition at line 798 of file superLattice.hh.

799{
800 if (!_backgroundTasks[typeid(STAGE)].empty()) {
801 singleton::pool().waitFor(_backgroundTasks[typeid(STAGE)]);
802 _backgroundTasks[typeid(STAGE)].clear();
803 }
804}
void waitFor(std::vector< std::future< T > > &futures)
Blocks until all tasks producing the given futures are completed.
Definition threadPool.h:205

References olb::singleton::pool(), and olb::ThreadPool::waitFor().

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

◆ writeSummary()

template<typename T , typename DESCRIPTOR >
void olb::SuperLattice< T, DESCRIPTOR >::writeSummary ( std::string fileName = "lattice") const

Writes a summary of all dynamics and post processors.

Definition at line 213 of file superLattice.hh.

214{
215 const auto& cGeometry = this->getCuboidDecomposition();
216 for (int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
217 const int globC = this->_loadBalancer.glob(iC);
218 {
219 std::string dataFile = singleton::directories().getIntrospectionOutDir()
220 + fileName + "_globC_" + std::to_string(globC)
221 + ".log";
222 std::ofstream fout(dataFile.c_str(), std::ios::trunc);
223 if (!fout) {
224 this->clout << "writeSummary error: can not open std::ofstream" << std::endl;
225 } else {
226 cGeometry.get(globC).write(fout);
227 fout << std::endl;
228 _block[iC]->writeDescription(fout);
229 fout.close();
230 }
231 }
232 {
233 std::string dataFile = singleton::directories().getIntrospectionOutDir()
234 + fileName + "_globC_" + std::to_string(globC)
235 + ".dynamics";
236 std::ofstream fout(dataFile.c_str(), std::ios::trunc);
237 if (!fout) {
238 this->clout << "writeSummary error: can not open std::ofstream" << std::endl;
239 } else {
240 _block[iC]->writeDynamicsAsCSV(fout);
241 fout.close();
242 }
243 }
244 {
245 std::string dataFile = singleton::directories().getIntrospectionOutDir()
246 + fileName + "_globC_" + std::to_string(globC)
247 + ".operator";
248 std::ofstream fout(dataFile.c_str(), std::ios::trunc);
249 if (!fout) {
250 this->clout << "writeSummary error: can not open std::ofstream" << std::endl;
251 } else {
252 _block[iC]->writeOperatorAsCSV(fout);
253 fout.close();
254 }
255 }
256 }
257}
CuboidDecomposition< T, D > & getCuboidDecomposition()
std::string getIntrospectionOutDir() const
Definition singleton.h:111
Directories & directories()
Definition singleton.h:162

Member Data Documentation

◆ d

template<typename T , typename DESCRIPTOR >
unsigned olb::SuperLattice< T, DESCRIPTOR >::d = DESCRIPTOR::d
staticconstexpr

Definition at line 75 of file superLattice.h.


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