Cabana 0.8.0-dev
 
Loading...
Searching...
No Matches
Cabana_Grid_SparseIndexSpace.hpp File Reference

Sparse grid mapping. More...

#include <Cabana_Grid_GlobalMesh.hpp>
#include <Cabana_Grid_IndexSpace.hpp>
#include <Kokkos_Core.hpp>
#include <Kokkos_UnorderedMap.hpp>
#include <array>
#include <memory>
#include <string>
Include dependency graph for Cabana_Grid_SparseIndexSpace.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Cabana::Grid::TileID2HashKey< Key, HashTypes::Naive >
 Compute the hash key from the 3D tile ijk.
 
struct  Cabana::Grid::TileID2HashKey< Key, HashTypes::Morton >
 Compute the hash key from the 3D tile ijk.
 
struct  Cabana::Grid::HashKey2TileID< Key, HashTypes::Naive >
 Compute the 3D tile ijk from the hash key.
 
struct  Cabana::Grid::HashKey2TileID< Key, HashTypes::Morton >
 Compute the 3D tile ijk from the hash key.
 
class  Cabana::Grid::SparseMap< MemorySpace, CellPerTileDim, Hash, Key, Value >
 Sparse index space, with a hierarchical structure (cell->tile->block) More...
 
class  Cabana::Grid::BlockMap< MemorySpace, CBits, CNumPerDim, CNumPerTile, Hash, Key, Value >
 Declaration of BlockMap. More...
 
class  Cabana::Grid::TileMap< CBits, CNumPerDim, CNumPerTile >
 Declaration of TileMap. More...
 
class  Cabana::Grid::TileIndexSpace< N, cellBitsPerTileDim, >
 Index space with tile as unit; _min and _max forms the tile range. Note this is for sparse grid only, mainly used in sparse halo impl. More...
 

Namespaces

namespace  Cabana
 Core: particle data structures and algorithms.
 

Enumerations

enum class  Cabana::Grid::HashTypes : unsigned char { Naive = 0 , Morton = 1 }
 Hash table type tag.
 

Functions

template<typename Integer>
KOKKOS_INLINE_FUNCTION constexpr Integer Cabana::Grid::bitLength (Integer input_int) noexcept
 (Host/Device) Compute the least bit number/length needed to represent the given input integer
 
template<typename Integer>
KOKKOS_INLINE_FUNCTION constexpr Integer Cabana::Grid::bitCount (Integer input_int) noexcept
 (Host/Device) Compute the lease bit number needed to index input integer
 
template<typename Integer>
KOKKOS_INLINE_FUNCTION constexpr Integer Cabana::Grid::binaryReverse (Integer input_int, char loc=sizeof(Integer) *8 - 1)
 (Host/Device) Given a integer, reverse the corresponding binary string, return the resulting integer.
 
template<typename Integer>
KOKKOS_INLINE_FUNCTION constexpr unsigned Cabana::Grid::countLeadingZeros (Integer input_int)
 (Host/Device) Count the leading zeros in the corresponding binary string of the input integer
 
KOKKOS_INLINE_FUNCTION constexpr int Cabana::Grid::bitPack (const uint64_t mask, const uint64_t data)
 (Host/Device) Pack up the data bits where the corresponding bit of the mask is 1
 
KOKKOS_INLINE_FUNCTION constexpr uint64_t Cabana::Grid::bitSpread (const uint64_t mask, const int data)
 (Host/Device) Spread out the data bits where the corresponding bit of the mask is 1
 
template<typename MemorySpace, class Scalar, unsigned long long CellPerTileDim = 4, HashTypes Hash = HashTypes::Naive, typename Key = uint64_t, typename Value = uint64_t>
SparseMap< MemorySpace, CellPerTileDim, Hash, Key, Value > Cabana::Grid::createSparseMap (const std::shared_ptr< GlobalMesh< SparseMesh< Scalar > > > &global_mesh, int pre_alloc_size)
 Creation function for SparseMap from GlobalMesh<SparseMesh>
 

Detailed Description

Sparse grid mapping.

Function Documentation

◆ binaryReverse()

template<typename Integer>
KOKKOS_INLINE_FUNCTION constexpr Integer Cabana::Grid::binaryReverse ( Integer input_int,
char loc = sizeof( Integer ) * 8 - 1 )
constexpr

(Host/Device) Given a integer, reverse the corresponding binary string, return the resulting integer.

Parameters
input_intinteger that is going to be evaluated
loclocation for next round reverse

◆ bitCount()

template<typename Integer>
KOKKOS_INLINE_FUNCTION constexpr Integer Cabana::Grid::bitCount ( Integer input_int)
constexprnoexcept

(Host/Device) Compute the lease bit number needed to index input integer

Parameters
input_intinteger that is going to be evaluated

◆ bitLength()

template<typename Integer>
KOKKOS_INLINE_FUNCTION constexpr Integer Cabana::Grid::bitLength ( Integer input_int)
constexprnoexcept

(Host/Device) Compute the least bit number/length needed to represent the given input integer

Parameters
input_intinteger that is going to be evaluated

◆ bitPack()

KOKKOS_INLINE_FUNCTION constexpr int Cabana::Grid::bitPack ( const uint64_t mask,
const uint64_t data )
constexpr

(Host/Device) Pack up the data bits where the corresponding bit of the mask is 1

Parameters
maskmask value
datainteger to be packed

◆ bitSpread()

KOKKOS_INLINE_FUNCTION constexpr uint64_t Cabana::Grid::bitSpread ( const uint64_t mask,
const int data )
constexpr

(Host/Device) Spread out the data bits where the corresponding bit of the mask is 1

Parameters
maskmask value
datainteger to be spread

◆ countLeadingZeros()

template<typename Integer>
KOKKOS_INLINE_FUNCTION constexpr unsigned Cabana::Grid::countLeadingZeros ( Integer input_int)
constexpr

(Host/Device) Count the leading zeros in the corresponding binary string of the input integer

Parameters
input_intinteger that is going to be evaluated

◆ createSparseMap()

template<typename MemorySpace, class Scalar, unsigned long long CellPerTileDim = 4, HashTypes Hash = HashTypes::Naive, typename Key = uint64_t, typename Value = uint64_t>
SparseMap< MemorySpace, CellPerTileDim, Hash, Key, Value > Cabana::Grid::createSparseMap ( const std::shared_ptr< GlobalMesh< SparseMesh< Scalar > > > & global_mesh,
int pre_alloc_size )

Creation function for SparseMap from GlobalMesh<SparseMesh>

Returns
SparseMap