25#ifndef SUPER_LATTICE_HH
26#define SUPER_LATTICE_HH
53template<
typename T,
typename DESCRIPTOR>
54void SuperLattice<T,DESCRIPTOR>::collectStatistics()
63 getStatistics().reset();
65 for (
int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
66 delta = this->_cuboidGeometry.get(this->_loadBalancer.glob(iC)).getDeltaR();
67 weight = _block[iC]->getStatistics().getNumCells() * delta
70 average_rho += _block[iC]->getStatistics().getAverageRho()
72 average_energy += _block[iC]->getStatistics().getAverageEnergy()
74 if (maxU < _block[iC]->getStatistics().getMaxU()) {
75 maxU = _block[iC]->getStatistics().getMaxU();
79#ifdef PARALLEL_MODE_MPI
86 average_rho = average_rho / sum_weight;
87 average_energy = average_energy / sum_weight;
89 getStatistics().reset(average_rho, average_energy, maxU, (
int) sum_weight);
90 getStatistics().incrementTime();
92 for (
int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
93 delta = this->_cuboidGeometry.get(this->_loadBalancer.glob(iC)).getDeltaR();
94 _block[iC]->getStatistics().reset(average_rho, average_energy,
95 maxU, (
int) sum_weight);
96 _block[iC]->getStatistics().incrementTime();
100template<
typename T,
typename DESCRIPTOR>
102 :
SuperStructure<T,DESCRIPTOR::d>(superGeometry.getCuboidGeometry(),
103 superGeometry.getLoadBalancer(),
104 superGeometry.getOverlap()),
107 using namespace stage;
111 for (
int iC = 0; iC <
load.size(); ++iC) {
113 #ifdef PLATFORM_GPU_CUDA
116 throw std::runtime_error(
"Load balancer requested GPU processing for cuboid "
117 + std::to_string(
load.glob(iC))
118 +
" but no CUDA device was found on rank "
125 load.platform(iC), cuboid.getExtent(), this->getOverlap()));
130 communicator.template requestField<descriptors::POPULATION>();
131 communicator.requestOverlap(1);
132 communicator.exchangeRequests();
137 DESCRIPTOR::fields_t::for_each([&](
auto field) {
138 communicator.template requestField<typename decltype(field)::type>();
141 communicator.requestOverlap(std::min(2, this->
getOverlap()));
142 communicator.exchangeRequests();
145 _statisticsEnabled =
true;
146 _communicationNeeded =
true;
149template<
typename T,
typename DESCRIPTOR>
152#ifdef PARALLEL_MODE_MPI
153 if (this->_loadBalancer.isLocal(latticeR[0])) {
154 if constexpr (DESCRIPTOR::d == 3) {
155 return _block[this->_loadBalancer.loc(latticeR[0])]->get(latticeR[1], latticeR[2], latticeR[3]);
157 return _block[this->_loadBalancer.loc(latticeR[0])]->get(latticeR[1], latticeR[2]);
161 throw std::domain_error(
"Cuboid iC must be locally available");
164 if constexpr (DESCRIPTOR::d == 3) {
165 return _block[this->_loadBalancer.loc(latticeR[0])]->get(latticeR[1], latticeR[2], latticeR[3]);
167 return _block[this->_loadBalancer.loc(latticeR[0])]->get(latticeR[1], latticeR[2]);
172template<
typename T,
typename DESCRIPTOR>
173template<
typename... R>
177 return get({latticeR...});
180template<
typename T,
typename DESCRIPTOR>
183 for (
int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
184 _block[iC]->initialize();
186 _communicationNeeded =
true;
189template<
typename T,
typename DESCRIPTOR>
190template<
typename DYNAMICS>
193 for (
int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
194 _block[iC]->template defineDynamics<DYNAMICS>(indicator->getBlockIndicatorF(iC));
198template<
typename T,
typename DESCRIPTOR>
199template<
typename DYNAMICS>
205template<
typename T,
typename DESCRIPTOR>
206template<
template<
typename...>
typename DYNAMICS>
209 for (
int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
210 _block[iC]->template defineDynamics<DYNAMICS<T,DESCRIPTOR>>(indicator->getBlockIndicatorF(iC));
214template<
typename T,
typename DESCRIPTOR>
215template<
template<
typename...>
typename DYNAMICS>
218 defineDynamics<DYNAMICS>(sGeometry.getMaterialIndicator(material));
221template<
typename T,
typename DESCRIPTOR>
225 for (
int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
226 _block[iC]->defineDynamics(indicator->getBlockIndicatorF(iC), dynamics);
230template<
typename T,
typename DESCRIPTOR>
237template<
typename T,
typename DESCRIPTOR>
241 for (
int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
242 _block[iC]->defineRho(indicator->getBlockIndicatorF(iC),
245 _communicationNeeded =
true;
248template<
typename T,
typename DESCRIPTOR>
255template<
typename T,
typename DESCRIPTOR>
259 #ifdef PARALLEL_MODE_OMP
260 #pragma omp parallel for schedule(dynamic,1)
262 for (
int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
263 _block[iC]->defineU(indicator->getBlockIndicatorF(iC),
266 _communicationNeeded =
true;
269template<
typename T,
typename DESCRIPTOR>
276template<
typename T,
typename DESCRIPTOR>
281 #ifdef PARALLEL_MODE_OMP
282 #pragma omp parallel for schedule(dynamic,1)
284 for (
int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
285 _block[iC]->defineRhoU(indicator->getBlockIndicatorF(iC),
288 _communicationNeeded =
true;
291template<
typename T,
typename DESCRIPTOR>
299template<
typename T,
typename DESCRIPTOR>
303 for (
int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
304 _block[iC]->definePopulations(indicator->getBlockIndicatorF(iC), Pop);
306 _communicationNeeded =
true;
309template<
typename T,
typename DESCRIPTOR>
316template<
typename T,
typename DESCRIPTOR>
320 for (
int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
321 _block[iC]->definePopulations(indicator->getBlockIndicatorF(iC), Pop.getBlockF(iC));
323 _communicationNeeded =
true;
326template<
typename T,
typename DESCRIPTOR>
334template<
typename T,
typename DESCRIPTOR>
335template <
typename FIELD>
339 if (field->getBlockFSize() == this->_loadBalancer.size()) {
340 for (
int iC=0; iC < this->_loadBalancer.size(); ++iC) {
341 _block[iC]->template defineField<FIELD>(indicator->getBlockIndicatorF(iC),
342 field->getBlockF(iC));
346 FieldD<T,DESCRIPTOR,FIELD> fieldTmp;
347 int coords[DESCRIPTOR::d+1];
348 for (
int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
349 _block[iC]->forSpatialLocations([&](LatticeR<DESCRIPTOR::d> loc) {
351 for (
int j = 0; j < DESCRIPTOR::d; ++j) {
352 coords[j+1] = loc[j];
354 if (indicator(coords)) {
355 field(fieldTmp.data(), coords);
356 _block[iC]->get(loc).template setField<FIELD>(fieldTmp);
361 _communicationNeeded =
true;
364template<
typename T,
typename DESCRIPTOR>
365template <
typename FIELD>
369 for (
int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
370 _block[iC]->template defineField<FIELD>(indicator->getBlockIndicatorF(iC),
373 _communicationNeeded =
true;
376template<
typename T,
typename DESCRIPTOR>
377template <
typename FIELD>
381 defineField<FIELD>(sGeometry.
getMaterialIndicator(material), std::forward<
decltype(field)>(field));
384template<
typename T,
typename DESCRIPTOR>
385template <
typename FIELD>
393template<
typename T,
typename DESCRIPTOR>
394template <
typename FIELD>
399 defineField<FIELD>(indicatorF, field);
402template<
typename T,
typename DESCRIPTOR>
403template <
typename FIELD>
408 defineField<FIELD>(indicatorF, field);
411template<
typename T,
typename DESCRIPTOR>
412template <
typename PARAMETER>
415 for (
int iC=0; iC < this->getLoadBalancer().size(); ++iC) {
416 _block[iC]->template setParameter<PARAMETER>(field);
420template<
typename T,
typename DESCRIPTOR>
421template <
typename PARAMETER,
typename DYNAMICS>
424 for (
int iC=0; iC < this->getLoadBalancer().size(); ++iC) {
425 _block[iC]->template getData<OperatorParameters<DYNAMICS>>().
template set<PARAMETER>(
426 std::forward<
decltype(field)>(field));
430template<
typename T,
typename DESCRIPTOR>
431template <
typename PARAMETER,
template<
typename...>
typename DYNAMICS>
434 setParameterOfDynamics<PARAMETER,DYNAMICS<T,DESCRIPTOR>>(std::forward<decltype(field)>(field));
437template<
typename T,
typename DESCRIPTOR>
438template <
typename PARAMETER, Platform PLATFORM,
typename FIELD>
441 static_assert(DESCRIPTOR::template size<PARAMETER>() == DESCRIPTOR::template size<FIELD>(),
442 "PARAMETER size must equal FIELD size");
443 static_assert(std::is_same_v<typename PARAMETER::template value_type<T>,
444 typename FIELD::template value_type<T>*>,
445 "PARAMETER must store pointers to FIELD components");
446 for (
int iC=0; iC < this->getLoadBalancer().size(); ++iC) {
447 _block[iC]->template setParameter<PARAMETER>(fieldArray);
451template<
typename T,
typename DESCRIPTOR>
456 for (
int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
457 _block[iC]->iniEquilibrium(indicator->getBlockIndicatorF(iC), rho, u);
459 _communicationNeeded =
true;
462template<
typename T,
typename DESCRIPTOR>
470template<
typename T,
typename DESCRIPTOR>
475 for (
int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
476 _block[iC]->iniEquilibrium(indicator->getBlockIndicatorF(iC), rho, u.getBlockF(iC));
478 _communicationNeeded =
true;
481template<
typename T,
typename DESCRIPTOR>
490template<
typename T,
typename DESCRIPTOR>
496 for (
int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
497 _block[iC]->iniRegularized(indicator->getBlockIndicatorF(iC), rho, u, pi);
499 _communicationNeeded =
true;
502template<
typename T,
typename DESCRIPTOR>
511template<
typename T,
typename DESCRIPTOR>
514 using namespace stage;
516 waitForBackgroundTasks(PreCollide());
517 auto& load = this->_loadBalancer;
519 if (_statisticsEnabled) {
520 setParameter<statistics::AVERAGE_RHO>(getStatistics().getAverageRho());
524 executePostProcessors(PreCollide());
526 #ifdef PARALLEL_MODE_OMP
529 for (
int iC = 0; iC < load.size(); ++iC) {
530 _block[iC]->collide();
534 executePostProcessors(PostCollide());
537 for (
int iC = 0; iC < load.size(); ++iC) {
538 _block[iC]->stream();
542 executePostProcessors(PostStream());
546 executeCustomTasks(PostStream());
549 getCommunicator(PostPostProcess()).communicate();
551 if (_statisticsEnabled) {
554 _communicationNeeded =
true;
557template<
typename T,
typename DESCRIPTOR>
558template<
typename STAGE>
561 #ifdef PLATFORM_GPU_CUDA
565 getCommunicator(stage).communicate();
567 auto& load = this->_loadBalancer;
569 #ifdef PARALLEL_MODE_OMP
572 for (
int iC = 0; iC < load.size(); ++iC) {
573 _block[iC]->template postProcess<STAGE>();
577template<
typename T,
typename DESCRIPTOR>
578template<
typename STAGE>
581 auto iter = _communicator.find(
typeid(STAGE));
582 if (iter == _communicator.end()) {
583 iter = std::get<0>(_communicator.emplace(
typeid(STAGE),
586 return *std::get<1>(*iter);
589template<
typename T,
typename DESCRIPTOR>
592 if (_communicationNeeded) {
594 _communicationNeeded =
false;
598template<
typename T,
typename DESCRIPTOR>
601 for (
int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
602 _block[iC]->stripeOffDensityOffset(offset);
604 _communicationNeeded =
true;
607template<
typename T,
typename DESCRIPTOR>
613template<
typename T,
typename DESCRIPTOR>
619template<
typename T,
typename DESCRIPTOR>
620template<
typename STAGE>
624 for (
int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
625 int overlap = getBlock(iC).getPadding();
627 extractedPpGen->
reset(-overlap+1, getBlock(iC).getExtent()+overlap-2);
628 getBlock(iC).template addPostProcessor<STAGE>(*extractedPpGen);
629 delete extractedPpGen;
633template<
typename T,
typename DESCRIPTOR>
634template<
typename STAGE>
638 for (
int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
639 getBlock(iC).template addPostProcessor<STAGE>(indicator->getBlockIndicatorF(iC),
642 _communicationNeeded =
true;
645template<
typename T,
typename DESCRIPTOR>
646template<
typename STAGE>
650 for (
int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
651 getBlock(iC).addPostProcessor(
typeid(STAGE),
652 indicator->getBlockIndicatorF(iC),
653 std::forward<
decltype(promise)>(promise));
657template<
typename T,
typename DESCRIPTOR>
658template<
typename STAGE>
661 for (
int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
662 getBlock(iC).addPostProcessor(
typeid(STAGE),
663 std::forward<
decltype(promise)>(promise));
667template<
typename T,
typename DESCRIPTOR>
668template<
typename STAGE>
676template<
typename T,
typename DESCRIPTOR>
677template<
typename PARTNER_DESCRIPTOR>
682 for (
int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
683 std::vector<BlockStructureD<DESCRIPTOR::d>*> partners;
684 for (
auto partnerLattice: partnerLattices) {
685 partners.push_back(&partnerLattice->getBlock(iC));
687 int overlap = getBlock(iC).getPadding();
689 extractedLcGen->reset(-overlap+1, getBlock(iC).getExtent()+overlap-2);
690 getBlock(iC).addLatticeCoupling(*extractedLcGen, partners);
691 delete extractedLcGen;
696template<
typename T,
typename DESCRIPTOR>
697template<
typename PARTNER_DESCRIPTOR>
702 for (
int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
703 std::vector<BlockStructureD<DESCRIPTOR::d>*> partners;
704 for (
auto partnerLattice: partnerLattices) {
705 partners.push_back(&partnerLattice->getBlock(iC));
707 getBlock(iC).addLatticeCoupling(indicator->getBlockIndicatorF(iC),
713template<
typename T,
typename DESCRIPTOR>
714template<
typename PARTNER_DESCRIPTOR>
720 lcGen, partnerLattices);
723template<
typename T,
typename DESCRIPTOR>
724template<
typename... PARTNER_DESCRIPTORS>
727 PARTNER_DESCRIPTORS&... partnerLattices)
729 for (
int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
730 std::vector<BlockStructureD<DESCRIPTOR::d>*> partners{&partnerLattices.getBlock(iC)...};
731 int overlap = getBlock(iC).getPadding();
733 extractedLcGen->reset(-overlap+1, getBlock(iC).getExtent()+overlap-2);
734 getBlock(iC).addLatticeCoupling(*extractedLcGen, partners);
735 delete extractedLcGen;
740template<
typename T,
typename DESCRIPTOR>
741template<
typename... PARTNER_DESCRIPTORS>
744 PARTNER_DESCRIPTORS&... partnerLattices)
746 for (
int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
747 std::vector<BlockStructureD<DESCRIPTOR::d>*> partners{&partnerLattices.getBlock(iC)...};
748 getBlock(iC).addLatticeCoupling(indicator->getBlockIndicatorF(iC),
754template<
typename T,
typename DESCRIPTOR>
755template<
typename... PARTNER_DESCRIPTORS>
758 PARTNER_DESCRIPTORS&... partnerLattices)
761 lcGen, partnerLattices...);
764template<
typename T,
typename DESCRIPTOR>
768 for (
int iC = 0; iC < this->_loadBalancer.size(); ++iC) {
769 _block[iC]->executeCoupling();
773 _communicationNeeded =
true;
776template<
typename T,
typename DESCRIPTOR>
777template<
typename STAGE>
780 for (
auto& f : _customTasks[
typeid(STAGE)]) {
785template<
typename T,
typename DESCRIPTOR>
786template <
typename STAGE,
typename F>
792template<
typename T,
typename DESCRIPTOR>
796 auto& load = this->getLoadBalancer();
797 for (
int iC=0; iC < load.size(); ++iC) {
799 scheduleBackgroundTask<stage::PreCollide>(std::bind(f, iC));
802 for (
int iC=0; iC < load.size(); ++iC) {
804 scheduleBackgroundTask<stage::PreContextSwitchTo<ProcessingContext::Evaluation>>(std::bind(f, iC));
809template<
typename T,
typename DESCRIPTOR>
810template <
typename CONTEXT>
813 vtkContext([](
auto& writer, std::size_t iT) {
816 scheduleBackgroundOutput([vtkContext](
int iC) {
817 vtkContext([&](
auto& writer, std::size_t iT) {
818 writer.writeVTI(iT, iC);
823template<
typename T,
typename DESCRIPTOR>
824template <
typename STAGE>
827 if (!_backgroundTasks[
typeid(STAGE)].empty()) {
829 _backgroundTasks[
typeid(STAGE)].clear();
833template<
typename T,
typename DESCRIPTOR>
836 return std::accumulate(_block.begin(), _block.end(),
size_t(0), [](std::size_t sum,
auto& b) -> std::size_t {
837 return sum + b->getNblock();
842template<
typename T,
typename DESCRIPTOR>
845 return std::accumulate(_block.begin(), _block.end(),
size_t(0), [](std::size_t sum,
auto& b) -> std::size_t {
846 return sum + b->getSerializableSize();
850template<
typename T,
typename DESCRIPTOR>
853 std::size_t currentBlock = 0;
854 bool* dataPtr =
nullptr;
856 for (std::size_t iC=0; iC < _block.size(); ++iC) {
857 registerSerializableOfConstSize(iBlock, sizeBlock, currentBlock, dataPtr, getBlock(iC), loadingMode);
863template<
typename T,
typename DESCRIPTOR>
866 for (
int iC=0; iC < this->_loadBalancer.size(); ++iC) {
867 _block[iC]->postLoad();
Definition of a LB cell – header file.
AnalyticalF are applications from DD to XD, where X is set by the constructor.
Highest-level interface to Cell data.
SoA storage for instances of a single FIELD.
Smart pointer for managing the various ways of passing functors around.
IndicatorF2D is an application from .
IndicatorF3D is an application from .
Factory for instances of a specific POST_PROCESSOR type.
bool load(std::string fileName="", const bool enforceUint=false)
Load Serializable from file fileName
Generic communicator for overlaps between blocks of SUPER.
Representation of a statistic for a parallel 2D geometry.
std::unique_ptr< SuperIndicatorF< T, D > > getMaterialIndicator(std::vector< int > &&materials)
Returns a material indicator using the given vector of materials.
SuperIndicatorF2D from IndicatorF2D.
SuperIndicatorF3D from IndicatorF3D.
Super class maintaining block lattices for a cuboid decomposition.
void communicate() override
Perform full overlap communication if needed.
SuperCommunicator< T, SuperLattice > & getCommunicator(STAGE stage=STAGE())
Return communicator for given communication stage.
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 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 collideAndStream()
Core implementation of a single iteration of the collide and stream loop.
void addPostProcessor(PostProcessorGenerator< T, DESCRIPTOR > const &ppGen)
Add a non-local post-processing step (legacy)
void executeCoupling()
Executes coupling with partner lattices (legacy)
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.
void defineRho(FunctorPtr< SuperIndicatorF< T, DESCRIPTOR::d > > &&, AnalyticalF< DESCRIPTOR::d, T, T > &rho)
Define rho on a domain described by an indicator.
void addLatticeCoupling(LatticeCouplingGenerator< T, DESCRIPTOR > const &lcGen, std::vector< SuperLattice< T, PARTNER_DESCRIPTOR > * > partnerLattices)
Adds a coupling generator for a vector of partner superLattice (legacy)
void setParameter(FieldD< T, DESCRIPTOR, PARAMETER > field)
Update PARAMETER in all dynamics and post processors.
void stripeOffDensityOffset(T offset)
Subtract constant offset from the density.
void definePopulations(FunctorPtr< SuperIndicatorF< T, DESCRIPTOR::d > > &&indicator, AnalyticalF< DESCRIPTOR::d, T, T > &Pop)
Define a population on a domain described by an indicator.
std::size_t getSerializableSize() const override
Binary size for the serializer.
std::size_t getNblock() const override
Number of data blocks for the serializable interface.
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.
SuperLattice(SuperGeometry< T, DESCRIPTOR::d > &superGeometry)
Construct lattice for the cuboid decomposition of superGeometry.
void executeCustomTasks(STAGE stage=STAGE())
Executes custom tasks assigned to STAGE.
void defineDynamics(FunctorPtr< SuperIndicatorF< T, DESCRIPTOR::d > > &&indicator)
Set dynamics of indicated cells to DYNAMICS.
void initialize()
Initialize lattice to be ready for simulation.
BlockLattice< T, DESCRIPTOR > & getBlock(int locC)
Return BlockLattice with local index locC.
void defineU(FunctorPtr< SuperIndicatorF< T, DESCRIPTOR::d > > &&indicator, AnalyticalF< DESCRIPTOR::d, T, T > &u)
Define u on a domain described by an indicator.
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 scheduleBackgroundOutput(F &&f)
Schedule F(iC) for one-off background output of block data.
void scheduleBackgroundOutputVTK(CONTEXT &&vtkContext)
Schedule one-off background output of given VTK CONTEXT.
void setParameterOfDynamics(FieldD< T, DESCRIPTOR, PARAMETER > &&field)
Update PARAMETER in DYNAMICS.
void scheduleBackgroundTask(F &&f)
Schedule F for one-off background execution to be finished by STAGE.
Cell< T, DESCRIPTOR > get(LatticeR< DESCRIPTOR::d+1 > latticeR)
Get local cell interface.
void executePostProcessors(STAGE stage=STAGE())
Executes post processors for STAGE.
int getOverlap()
Read and write access to the overlap.
CuboidGeometry< T, D > & _cuboidGeometry
The grid structure is stored here.
LoadBalancer< T > & getLoadBalancer()
Read and write access to the load balancer.
std::future< R > schedule(F &&f)
Schedule F and return future of its return value.
void waitFor(std::vector< std::future< T > > &futures)
Blocks until all tasks producing the given futures are completed.
void reduceAndBcast(T &reductVal, MPI_Op op, int root=0, MPI_Comm comm=MPI_COMM_WORLD)
Reduction operation, followed by a broadcast.
int getRank() const
Returns the process ID.
The description of a vector of 2D cuboid – header file.
The description of a vector of 3D cuboid – header file.
Wrapper functions that simplify the use of MPI.
std::enable_if_t< DESCRIPTOR::d==2, std::shared_ptr< SuperF2D< T > > > field(SuperLattice< T, DESCRIPTOR > &sLattice)
Returns external field functor.
int getCount()
Return number of available devices.
void synchronize()
Synchronize device.
Top level namespace for all of OpenLB.
std::conditional_t< DESCRIPTOR::d==2, LatticeCouplingGenerator2D< T, DESCRIPTOR >, LatticeCouplingGenerator3D< T, DESCRIPTOR > > LatticeCouplingGenerator
@ GPU_CUDA
Vector CPU (AVX2 / AVX-512 collision)
std::conditional_t< D==2, SuperF2D< T, U >, SuperF3D< T, U > > SuperF
constexpr bool isPlatformCPU(Platform platform)
Returns true if platform is equal to Platform::CPU_*.
CONCRETIZABLE::base_t * constructUsingConcretePlatform(Platform platform, ARGS &&... args)
std::conditional_t< DESCRIPTOR::d==2, PostProcessorGenerator2D< T, DESCRIPTOR >, PostProcessorGenerator3D< T, DESCRIPTOR > > PostProcessorGenerator
std::conditional_t< D==2, SuperIndicatorF2D< T >, SuperIndicatorF3D< T > > SuperIndicatorF
Curried ConcreteBlockLattice template for use in callUsingConcretePlatform.
Interface for per-cell dynamics.
Coupling post processors.
On-demand communication at SuperLattice::communicate.
Communication after coupling.
Communication prior to coupling.
Representation of the 2D geometry – generic implementation.