OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | List of all members
olb::gpu::cuda::DeviceBlockLattice< T, DESCRIPTOR > Class Template Referencefinal

Device-side view of a block lattice. More...

#include <context.hh>

+ Inheritance diagram for olb::gpu::cuda::DeviceBlockLattice< T, DESCRIPTOR >:
+ Collaboration diagram for olb::gpu::cuda::DeviceBlockLattice< T, DESCRIPTOR >:

Public Member Functions

 DeviceBlockLattice (ConcreteBlockLattice< T, DESCRIPTOR, Platform::GPU_CUDA > &lattice) __host__
 
CellID getCellId (LatticeR< DESCRIPTOR::d > loc) const __device__
 
CellDistance getNeighborDistance (LatticeR< DESCRIPTOR::d > dir) const __device__
 
Cell< T, DESCRIPTOR > get (CellID iCell) __device__
 
Cell< T, DESCRIPTOR > get (LatticeR< DESCRIPTOR::d > loc) __device__
 
- Public Member Functions inherited from olb::gpu::cuda::DeviceContext< T, DESCRIPTOR >
 DeviceContext (ConcreteBlockLattice< T, DESCRIPTOR, Platform::GPU_CUDA > &lattice) __host__
 
std::size_t getNcells () const any_platform
 
template<typename FIELD >
FIELD::template value_type< T > ** getField () __device__
 

Additional Inherited Members

- Public Types inherited from olb::gpu::cuda::DeviceContext< T, DESCRIPTOR >
using value_t = T
 
using descriptor_t = DESCRIPTOR
 

Detailed Description

template<typename T, typename DESCRIPTOR>
class olb::gpu::cuda::DeviceBlockLattice< T, DESCRIPTOR >

Device-side view of a block lattice.

Used for non-local operators such as post processors

Definition at line 207 of file context.hh.

Constructor & Destructor Documentation

◆ DeviceBlockLattice()

template<typename T , typename DESCRIPTOR >
olb::gpu::cuda::DeviceBlockLattice< T, DESCRIPTOR >::DeviceBlockLattice ( ConcreteBlockLattice< T, DESCRIPTOR, Platform::GPU_CUDA > & lattice)
inline

Definition at line 213 of file context.hh.

213 :
214 DeviceContext<T,DESCRIPTOR>(lattice),
215 _padding{lattice.getPadding()}
216 {
217 auto size = lattice.getExtent() + 2*_padding;
218 if constexpr (DESCRIPTOR::d == 3) {
219 _projection = {size[1]*size[2], size[2], 1};
220 } else {
221 _projection = {size[1], 1};
222 }
223 }
int getPadding() const
Read only access to padding.
LatticeR< D > getExtent() const

Member Function Documentation

◆ get() [1/2]

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

Definition at line 233 of file context.hh.

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

◆ get() [2/2]

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

Definition at line 237 of file context.hh.

237 {
238 return get(getCellId(loc));
239 }
CellID getCellId(LatticeR< DESCRIPTOR::d > loc) const __device__
Definition context.hh:225
Cell< T, DESCRIPTOR > get(CellID iCell) __device__
Definition context.hh:233

References olb::gpu::cuda::DeviceBlockLattice< T, DESCRIPTOR >::get(), and olb::gpu::cuda::DeviceBlockLattice< T, DESCRIPTOR >::getCellId().

+ Here is the call graph for this function:

◆ getCellId()

template<typename T , typename DESCRIPTOR >
CellID olb::gpu::cuda::DeviceBlockLattice< T, DESCRIPTOR >::getCellId ( LatticeR< DESCRIPTOR::d > loc) const
inline

Definition at line 225 of file context.hh.

225 {
226 return (loc+_padding) * _projection;
227 }
+ Here is the caller graph for this function:

◆ getNeighborDistance()

template<typename T , typename DESCRIPTOR >
CellDistance olb::gpu::cuda::DeviceBlockLattice< T, DESCRIPTOR >::getNeighborDistance ( LatticeR< DESCRIPTOR::d > dir) const
inline

Definition at line 229 of file context.hh.

229 {
230 return dir * _projection;
231 }

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