24#ifndef GPU_CUDA_OPERATOR_H
25#define GPU_CUDA_OPERATOR_H
40template <
typename T,
typename DESCRIPTOR,
typename... DYNAMICS>
41std::function<void(ConcreteBlockLattice<T,DESCRIPTOR,Platform::GPU_CUDA>&)>
getFusedCollisionO();
47template <
typename T,
typename DESCRIPTOR,
typename DYNAMICS>
51 std::unique_ptr<DYNAMICS> _dynamics;
75 std::type_index
id()
const override
77 return typeid(DYNAMICS);
82 return _mask->weight();
85 void set(
CellID iCell,
bool state,
bool overlap)
override
88 if constexpr (!std::is_same_v<DYNAMICS,NoDynamics<T,DESCRIPTOR>>) {
90 _mask->set(iCell, state);
94 _dynamicsOfCells[iCell] = _deviceDynamics.
get();
101 return _dynamics.get();
116 return applyDominant(block, subdomain);
118 return applyIndividual(block, subdomain);
120 throw std::runtime_error(
"Invalid collision dispatch strategy");
128template <
typename T,
typename DESCRIPTOR, concepts::CellOperator OPERATOR>
130 :
public BlockO<T,DESCRIPTOR,Platform::GPU_CUDA> {
140 std::type_index
id()
const override
147 return _cells.
size();
169template <
typename T,
typename DESCRIPTOR, concepts::CellOperator OPERATOR>
171 :
public BlockO<T,DESCRIPTOR,Platform::GPU_CUDA> {
183 std::type_index
id()
const override
190 return _cells.
size();
204 _parameters = &block.template getData<OperatorParameters<OPERATOR>>();
216template <
typename T,
typename DESCRIPTOR, concepts::BlockOperator OPERATOR>
218 :
public BlockO<T,DESCRIPTOR,Platform::GPU_CUDA> {
220 std::type_index
id()
const override
232 throw std::logic_error(
"BlockO::set not supported for OperatorScope::PerBlock");
249template <
typename COUPLER,
typename COUPLEES>
253 template <
typename VALUED_DESCRIPTOR>
255 typename VALUED_DESCRIPTOR::descriptor_t,
264 std::unique_ptr<ConcreteBlockMask<typename COUPLEES::values_t::template get<0>::value_t,
268 template <
typename LATTICES>
273 std::type_index
id()
const override {
274 return typeid(COUPLER);
281 void set(
CellID iCell,
bool state)
override;
283 void execute()
override;
288template <
typename COUPLER,
typename COUPLEES>
292 template <
typename VALUED_DESCRIPTOR>
294 typename VALUED_DESCRIPTOR::descriptor_t,
301 typename COUPLER::parameters::template decompose_into<
305 std::unique_ptr<ConcreteBlockMask<typename COUPLEES::values_t::template get<0>::value_t,
309 template <
typename LATTICES>
314 std::type_index
id()
const override {
315 return typeid(COUPLER);
322 void set(
CellID iCell,
bool state)
override;
324 void execute()
override;
329template <
typename COUPLER,
typename COUPLEES>
333 template <
typename VALUED_DESCRIPTOR>
334 using ptr_to_lattice = std::conditional_t<
335 VALUED_DESCRIPTOR::descriptor_t::template provides<descriptors::POPULATION>(),
337 typename VALUED_DESCRIPTOR::descriptor_t,
340 typename VALUED_DESCRIPTOR::descriptor_t,
355 typename COUPLER::parameters,
364 template <
typename LATTICES>
372 std::type_index
id()
const override {
373 return typeid(COUPLER);
380 void set(
CellID iCell,
bool state)
override;
382 void execute()
override;
#define OPERATOR(OP, rhs)
Collision operation of concrete DYNAMICS on concrete block lattices of PLATFORM.
Coupling of COUPLEES using concrete OPERATOR with SCOPE on PLATFORM lattices.
Implementation of BlockD on a concrete PLATFORM.
Implementation of BlockLattice on a concrete PLATFORM.
Block application of concrete OPERATOR called using SCOPE on PLATFORM.
Particle coupling of COUPLEES using concrete OPERATOR with SCOPE on PLATFORM lattices.
Plain column for CUDA GPU targets.
std::size_t size() const override
Basic wrapper for device stream.
Managed pointer for device-side memory.
std::function< void(ConcreteBlockLattice< T, DESCRIPTOR, Platform::GPU_CUDA > &)> getFusedCollisionO()
Helper for constructing fused collision operators.
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.
typename COUPLEES::values_t::template get< 0 >::value_t value_t
Value type used for coupling parameters.
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.