24#ifndef GPU_CUDA_OPERATOR_H
25#define GPU_CUDA_OPERATOR_H
40template <
typename T,
typename DESCRIPTOR,
typename DYNAMICS>
44 std::unique_ptr<DYNAMICS> _dynamics;
68 std::type_index
id()
const override
70 return typeid(DYNAMICS);
75 return _mask->weight();
78 void set(
CellID iCell,
bool state,
bool overlap)
override
81 if constexpr (!std::is_same_v<DYNAMICS,NoDynamics<T,DESCRIPTOR>>) {
83 _mask->set(iCell, state);
87 _dynamicsOfCells[iCell] = _deviceDynamics.
get();
94 return _dynamics.get();
109 return applyDominant(block, subdomain);
111 return applyIndividual(block, subdomain);
113 throw std::runtime_error(
"Invalid collision dispatch strategy");
121template <
typename T,
typename DESCRIPTOR, CONCEPT(CellOperator) OPERATOR>
123 :
public BlockO<T,DESCRIPTOR,Platform::GPU_CUDA> {
133 std::type_index
id()
const override
135 return typeid(OPERATOR);
157template <
typename T,
typename DESCRIPTOR, CONCEPT(CellOperator) OPERATOR>
159 :
public BlockO<T,DESCRIPTOR,Platform::GPU_CUDA> {
171 std::type_index
id()
const override
173 return typeid(OPERATOR);
187 _parameters = &block.template getData<OperatorParameters<OPERATOR>>();
199template <
typename T,
typename DESCRIPTOR, CONCEPT(BlockOperator) OPERATOR>
201 :
public BlockO<T,DESCRIPTOR,Platform::GPU_CUDA> {
203 std::type_index
id()
const override
205 return typeid(OPERATOR);
210 throw std::logic_error(
"BlockO::set not supported for OperatorScope::PerBlock");
215 OPERATOR().setup(block);
220 OPERATOR().apply(block);
227template <
typename COUPLER,
typename COUPLEES>
231 template <
typename VALUED_DESCRIPTOR>
233 typename VALUED_DESCRIPTOR::descriptor_t,
242 std::unique_ptr<ConcreteBlockMask<typename COUPLEES::values_t::template get<0>::value_t,
246 template <
typename LATTICES>
251 std::type_index
id()
const override {
252 return typeid(COUPLER);
259 void set(
CellID iCell,
bool state)
override;
261 void execute()
override;
266template <
typename COUPLER,
typename COUPLEES>
270 template <
typename VALUED_DESCRIPTOR>
272 typename VALUED_DESCRIPTOR::descriptor_t,
279 typename COUPLER::parameters::template decompose_into<
283 std::unique_ptr<ConcreteBlockMask<typename COUPLEES::values_t::template get<0>::value_t,
287 template <
typename LATTICES>
292 std::type_index
id()
const override {
293 return typeid(COUPLER);
300 void set(
CellID iCell,
bool state)
override;
302 void execute()
override;
Collision operation of concrete DYNAMICS on concrete block lattices of PLATFORM.
Coupling of COUPLEES using concrete OPERATOR with SCOPE on PLATFORM lattices.
Implementation of BlockLattice on a concrete PLATFORM.
Block application of concrete OPERATOR called using SCOPE on PLATFORM.
Plain column for CUDA GPU targets.
Basic wrapper for device stream.
Managed pointer for device-side memory.
Top level namespace for all of OpenLB.
std::uint32_t CellID
Type for sequential block-local cell indices.
Platform
OpenLB execution targets.
@ GPU_CUDA
Vector CPU (AVX2 / AVX-512 collision)
CollisionDispatchStrategy
Collision dispatch strategy.
@ Individual
Apply all dynamics individually (async for Platform::GPU_CUDA)
@ Dominant
Apply dominant dynamics using mask and fallback to virtual dispatch for others.
@ PerBlock
Per-block application, i.e. OPERATOR::apply is passed a ConcreteBlockLattice.
@ PerCell
Per-cell application, i.e. OPERATOR::apply is passed a CELL concept implementation.
@ PerCellWithParameters
Per-cell application with parameters, i.e. OPERATOR::apply is passed a CELL concept implementation an...
Base of block-wide coupling operators executed by SuperLatticeCoupling.
Dynamic access interface for FIELD-valued parameters.
Collision operation on concrete blocks of PLATFORM.
Base of block-wide operators such as post processors.
Concrete storage of ParametersD in olb::Data.
Interface for per-cell dynamics.
Set of FIELD-valued parameters.
Virtual interface for device-side dynamically-dispatched dynamics access.
Mapping between KEYs and instances of type VALUEs.