Open Qmin  0.8.0
GPU-accelerated Q-tensor-based liquid crystal simulations
Public Member Functions | Public Attributes | List of all members
Index3D Class Reference

Switch between a 3-dimensional grid to a flattened, 1D index. More...

#include <indexer.h>

Public Member Functions

HOSTDEVICE Index3D (unsigned int w=0)
 
HOSTDEVICE Index3D (int3 w)
 
HOSTDEVICE void setSizes (unsigned int w)
 
HOSTDEVICE void setSizes (int3 w)
 
HOSTDEVICE unsigned int operator() (const int x, const int y, const int z) const
 
HOSTDEVICE unsigned int operator() (const int3 &i) const
 
HOSTDEVICE int3 inverseIndex (int i)
 What iVec would correspond to a given unsigned int IndexDD(iVec) More...
 
HOSTDEVICE unsigned int getNumElements () const
 Return the number of elements that the indexer can index. More...
 
HOSTDEVICE int3 getSizes () const
 Get the iVec of sizes. More...
 

Public Attributes

int3 sizes
 a list of the size of the full array in each of the d dimensions More...
 
int3 intermediateSizes
 intermediateSizes[a] = Product_{d<=a} sizes. intermediateSizes[0]=1; More...
 
unsigned int numberOfElements
 
unsigned int width
 The total number of elements that the indexer can index. More...
 

Detailed Description

Switch between a 3-dimensional grid to a flattened, 1D index.

A class for converting between a 3d index and a 1-d array, which makes calculation on the GPU a bit easier. This was inspired by the indexer class of Hoomd-blue

Constructor & Destructor Documentation

◆ Index3D() [1/2]

HOSTDEVICE Index3D::Index3D ( unsigned int  w = 0)
inline

References setSizes().

◆ Index3D() [2/2]

HOSTDEVICE Index3D::Index3D ( int3  w)
inline

References setSizes().

Member Function Documentation

◆ setSizes() [1/2]

HOSTDEVICE void Index3D::setSizes ( unsigned int  w)
inline

Referenced by Index3D().

◆ setSizes() [2/2]

HOSTDEVICE void Index3D::setSizes ( int3  w)
inline

◆ operator()() [1/2]

HOSTDEVICE unsigned int Index3D::operator() ( const int  x,
const int  y,
const int  z 
) const
inline

References intermediateSizes.

◆ operator()() [2/2]

HOSTDEVICE unsigned int Index3D::operator() ( const int3 &  i) const
inline

References intermediateSizes.

◆ inverseIndex()

HOSTDEVICE int3 Index3D::inverseIndex ( int  i)
inline

◆ getNumElements()

HOSTDEVICE unsigned int Index3D::getNumElements ( ) const
inline

Return the number of elements that the indexer can index.

References numberOfElements.

◆ getSizes()

HOSTDEVICE int3 Index3D::getSizes ( ) const
inline

Get the iVec of sizes.

References sizes.

Referenced by gpu_lattice_spin_force_nn(), and gpu_qTensor_computeBoundaryForcesGPU_kernel().

Member Data Documentation

◆ sizes

int3 Index3D::sizes

◆ intermediateSizes

int3 Index3D::intermediateSizes

intermediateSizes[a] = Product_{d<=a} sizes. intermediateSizes[0]=1;

Referenced by operator()(), and setSizes().

◆ numberOfElements

unsigned int Index3D::numberOfElements

Referenced by getNumElements(), and setSizes().

◆ width

unsigned int Index3D::width

The total number of elements that the indexer can index.

array width


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