Block-Structured AMR Software Framework
 
Loading...
Searching...
No Matches
AMReX_Morton.H File Reference
#include <AMReX_Config.H>
#include <AMReX_REAL.H>
#include <AMReX_Dim3.H>
#include <AMReX_Array.H>
#include <AMReX_GpuQualifiers.H>
#include <cstdint>

Go to the source code of this file.

Namespaces

namespace  amrex
 
namespace  amrex::Morton
 

Functions

__host__ __device__ std::uint32_t amrex::Morton::makeSpace (std::uint32_t x) noexcept
 This makes space in the input 32-bit integer by splitting the bits so they can be interleaved.
 
__host__ __device__ std::uint32_t amrex::Morton::toUInt10 (amrex::Real x, amrex::Real xmin, amrex::Real xmax) noexcept
 Convert a Real to a uint32, keeping only 10 significant bits. This puts the first 10 bits of x into retval with the 22 highest bits set to 0. It is assumed that xmin <= x < xmax.
 
__host__ __device__ std::uint32_t amrex::Morton::toUInt16 (amrex::Real x, amrex::Real xmin, amrex::Real xmax) noexcept
 Convert a Real to a uint32, keeping only 16 significant bits. This puts the first 16 bits of x into retval with the 16 highest bits set to 0. It is assumed that xmin <= x < xmax.
 
__host__ __device__ std::uint32_t amrex::Morton::toUInt32 (amrex::Real x, amrex::Real xmin, amrex::Real xmax) noexcept
 Convert a Real to a uint32, keeping all significant bits. It is assumed that xmin <= x < xmax.
 
__host__ __device__ std::uint32_t amrex::Morton::get32BitCode (Real x, Real y, Real z, const GpuArray< amrex::Real, 3 > &plo, const GpuArray< amrex::Real, 3 > &phi) noexcept
 Given a 3D real-space coordinate, returns a Morton code stored in an unsigned 32 bit integer.
 
__host__ __device__ std::uint32_t amrex::Morton::get32BitCode (const XDim3 &p, const GpuArray< amrex::Real, 3 > &plo, const GpuArray< amrex::Real, 3 > &phi) noexcept
 Given a 3D real-space coordinate, returns a Morton code stored in an unsigned 32 bit integer.