Block-Structured AMR Software Framework
AMReX_IndexType.H File Reference
#include <AMReX_Config.H>
#include <AMReX_IntVect.H>
#include <AMReX_SPACE.H>
#include <AMReX_Tuple.H>
#include <iosfwd>

Go to the source code of this file.

Classes

struct  amrex::CellIndexEnum
 Type for defining CellIndex so that all IndexTypeND with different dimensions have the same CellIndex type. More...
 
class  amrex::IndexTypeND< dim >
 Cell-Based or Node-Based Indices. More...
 
struct  std::tuple_size< amrex::IndexTypeND< dim > >
 
struct  std::tuple_element< s, amrex::IndexTypeND< dim > >
 

Namespaces

 amrex
 
 amrex::detail
 

Functions

template<int dim>
AMREX_GPU_HOST_DEVICE amrex::IndexTypeND (const IntVectND< dim > &) -> IndexTypeND< dim >
 
template<class... Args, std::enable_if_t< IsConvertible_v< IndexType::CellIndex, Args... >, int > = 0>
AMREX_GPU_HOST_DEVICE amrex::IndexTypeND (IndexType::CellIndex, Args...) -> IndexTypeND< sizeof...(Args)+1 >
 
std::ostream & amrex::detail::index_type_write (std::ostream &os, const unsigned int &iv, int dim)
 
std::istream & amrex::detail::index_type_read (std::istream &is, unsigned int &iv, int dim)
 
template<class T , std::size_t... Ns>
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINEamrex::detail::IndexTypeSplit_imp (T &retval, std::index_sequence< Ns... >, unsigned int src) noexcept
 
template<int dim>
std::ostream & amrex::operator<< (std::ostream &os, const IndexTypeND< dim > &it)
 Write an IndexTypeND to an ostream in ASCII. More...
 
template<int dim>
std::istream & amrex::operator>> (std::istream &is, IndexTypeND< dim > &it)
 Read an IndexTypeND from an istream. More...
 
template<int d, int... dims>
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE IndexTypeND< detail::get_sum< d, dims... >)> amrex::IndexTypeCat (const IndexTypeND< d > &v, const IndexTypeND< dims > &...vects) noexcept
 Returns a IndexTypeND obtained by concatenating the input IndexTypeNDs. The dimension of the return value equals the sum of the dimensions of the inputted IndexTypeNDs. More...
 
template<int d, int... dims>
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE GpuTuple< IndexTypeND< d >, IndexTypeND< dims >... > amrex::IndexTypeSplit (const IndexTypeND< detail::get_sum< d, dims... >()> &v) noexcept
 Returns a tuple of IndexTypeND obtained by splitting the input IndexTypeND according to the dimensions specified by the template arguments. More...
 
template<int new_dim, int old_dim>
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE IndexTypeND< new_dim > amrex::IndexTypeShrink (const IndexTypeND< old_dim > &v) noexcept
 Returns a new IndexTypeND of size new_dim and assigns the first new_dim values of v to it. More...
 
template<int new_dim, int old_dim>
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE IndexTypeND< new_dim > amrex::IndexTypeExpand (const IndexTypeND< old_dim > &v, IndexType::CellIndex fill_extra=IndexType::CellIndex::CELL) noexcept
 Returns a new IndexTypeND of size new_dim and assigns all values of iv to it and fill_extra to the remaining elements. More...
 
template<int new_dim, int old_dim>
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE IndexTypeND< new_dim > amrex::IndexTypeResize (const IndexTypeND< old_dim > &v, IndexType::CellIndex fill_extra=IndexType::CellIndex::CELL) noexcept
 Returns a new IndexTypeND of size new_dim by either shrinking or expanding iv. More...