13#include <boost/mpl/size_t.hpp>
15#include <Grid/grid_sm.hpp>
16#include "SparseGridGpu/TemplateUtils/mathUtils.hpp"
17#include "util/zmorton.hpp"
24template<
unsigned int dim,
unsigned int blockEdgeSize,
typename indexT>
32 __host__ __device__
grid_zmb(
const size_t (& sz)[dim])
36 __host__ __device__
grid_zmb(
const size_t domainBlockEdgeSize)
47 __host__ __device__
grid_zmb(
const dim3 blockDimensions)
64 template<
typename indexT_>
71 for (
int d = 0 ; d < dim; d++)
73 key_b.
set_d(d,coord.
get(d) / blockEdgeSize);
74 localLinId += coord.
get(d) % blockEdgeSize * sr;
77 return lin_zid(key_b) * this->blockSize + localLinId;
82 indexT linIdB = linId / this->blockSize;
83 int localLinId = linId % this->blockSize;
85 return InvLinId(linIdB,localLinId);
91 invlin_zid(blockLinId,k);
93 for (indexT i = 0 ; i < dim ; i++)
95 k.set_d(i,k.get(i)*blockEdgeSize + localLinId % blockEdgeSize);
96 localLinId /= blockEdgeSize;
102 template<
typename indexT_>
105 return lin_zid(blockCoord);
111 invlin_zid(blockLinId,k);
116 __host__ __device__
const indexT (& getSize()
const)[dim]
123 template<
typename indexT_>
129 inline indexT getBlockSize()
const
134 __host__ __device__
const indexT & size(
int i)
const
144 __host__ __device__
inline indexT getBlockEgdeSize()
const
146 return blockEdgeSize;
149 __host__ __device__
inline indexT size()
const
grid_key_dx is the key to access any element in the grid
__device__ __host__ void set_d(index_type i, index_type id)
Set the i index.
__device__ __host__ index_type get(index_type i) const
Get the i index.