Block-Structured AMR Software Framework
Loading...
Searching...
No Matches
Integer Index Space

Types and operations for discrete integer index space in AMReX. More...

Classes

struct  amrex::CellIndexEnum
 Type for defining CellIndex so that all IndexTypeND with different dimensions have the same CellIndex type. More...
 
class  amrex::BoxND< dim >
 A Rectangular Domain on an Integer Lattice. More...
 
class  amrex::IndexTypeND< dim >
 Cell-Based or Node-Based Indices. More...
 
class  amrex::IntVectND< dim >
 An Integer Vector in dim-Dimensional Space. More...
 

Functions

template<int dim>
__host__ __device__ BoxND< dim > amrex::grow (const BoxND< dim > &b, int i) noexcept
 Grow BoxND in all directions by given amount.
 
template<int dim>
__host__ __device__ BoxND< dim > amrex::grow (const BoxND< dim > &b, const IntVectND< dim > &v) noexcept
 Grow BoxND in all directions by given amount.
 
template<int dim>
__host__ __device__ BoxND< dim > amrex::grow (const BoxND< dim > &b, int idir, int n_cell) noexcept
 Grow BoxND in given direction by given amount.
 
template<int dim>
__host__ __device__ BoxND< dim > amrex::grow (const BoxND< dim > &b, Direction d, int n_cell) noexcept
 Grow BoxND in given direction by given amount.
 
template<int dim>
__host__ __device__ BoxND< dim > amrex::coarsen (const BoxND< dim > &b, int ref_ratio) noexcept
 Coarsen BoxND by given (positive) coarsening ratio.
 
template<int dim>
__host__ __device__ BoxND< dim > amrex::coarsen (const BoxND< dim > &b, const IntVectND< dim > &ref_ratio) noexcept
 Coarsen BoxND by given (positive) coarsening ratio.
 
template<int dim>
__host__ __device__ BoxND< dim > amrex::refine (const BoxND< dim > &b, int ref_ratio) noexcept
 
template<int dim>
__host__ __device__ BoxND< dim > amrex::refine (const BoxND< dim > &b, const IntVectND< dim > &ref_ratio) noexcept
 Refine BoxND by given (positive) refinement ratio.
 

Detailed Description

Types and operations for discrete integer index space in AMReX.

These types define the integer space on which AMReX data structures are defined. They are independent of physical coordinates and units.

Central types include:

Common operations include:

Function Documentation

◆ coarsen() [1/2]

template<int dim>
__host__ __device__ BoxND< dim > amrex::coarsen ( const BoxND< dim > &  b,
const IntVectND< dim > &  ref_ratio 
)
inlinenoexcept

Coarsen BoxND by given (positive) coarsening ratio.

NOTE: if type(dir) = CELL centered: lo <- lo/ratio and hi <- hi/ratio. NOTE: if type(dir) = NODE centered: lo <- lo/ratio and hi <- hi/ratio + ((hiratio)==0 ? 0 : 1). That is, refinement of coarsened BoxND must contain the original BoxND.

Parameters
binput Box
ref_ratiocoarsening ratio
Returns
the coarsened Box

◆ coarsen() [2/2]

template<int dim>
__host__ __device__ BoxND< dim > amrex::coarsen ( const BoxND< dim > &  b,
int  ref_ratio 
)
inlinenoexcept

Coarsen BoxND by given (positive) coarsening ratio.

NOTE: if type(dir) = CELL centered: lo <- lo/ratio and hi <- hi/ratio. NOTE: if type(dir) = NODE centered: lo <- lo/ratio and hi <- hi/ratio + ((hiratio)==0 ? 0 : 1). That is, refinement of coarsened BoxND must contain the original BoxND.

Parameters
binput Box
ref_ratiocoarsening ratio
Returns
the coarsened Box

◆ grow() [1/4]

template<int dim>
__host__ __device__ BoxND< dim > amrex::grow ( const BoxND< dim > &  b,
const IntVectND< dim > &  v 
)
inlinenoexcept

Grow BoxND in all directions by given amount.

Note that a negative number shrinks the BoxND by that number of cells.

Parameters
binput Box
vnumber of cells to grow
Returns
the grown Box

◆ grow() [2/4]

template<int dim>
__host__ __device__ BoxND< dim > amrex::grow ( const BoxND< dim > &  b,
Direction  d,
int  n_cell 
)
inlinenoexcept

Grow BoxND in given direction by given amount.

Note that a negative number shrinks the BoxND by that number of cells.

Parameters
binput Box
ddirection to grow
n_cellnumber of cells to grow
Returns
the grown Box

◆ grow() [3/4]

template<int dim>
__host__ __device__ BoxND< dim > amrex::grow ( const BoxND< dim > &  b,
int  i 
)
inlinenoexcept

Grow BoxND in all directions by given amount.

Note that a negative shrinks the BoxND by that number of cells.

Parameters
binput Box
inumber of cells to grow
Returns
the grown Box

◆ grow() [4/4]

template<int dim>
__host__ __device__ BoxND< dim > amrex::grow ( const BoxND< dim > &  b,
int  idir,
int  n_cell 
)
inlinenoexcept

Grow BoxND in given direction by given amount.

Note that a negative number shrinks the BoxND by that number of cells.

Parameters
binput Box
idirdirection to grow
n_cellnumber of cells to grow
Returns
the grown Box

◆ refine() [1/2]

template<int dim>
__host__ __device__ BoxND< dim > amrex::refine ( const BoxND< dim > &  b,
const IntVectND< dim > &  ref_ratio 
)
inlinenoexcept

Refine BoxND by given (positive) refinement ratio.

NOTE: if type(dir) = CELL centered: lo <- lo*ratio and hi <- (hi+1)*ratio - 1. NOTE: if type(dir) = NODE centered: lo <- lo*ratio and hi <- hi*ratio.

Parameters
binput Box
ref_ratiorefinement ratio
Returns
the coarsened Box

◆ refine() [2/2]

template<int dim>
__host__ __device__ BoxND< dim > amrex::refine ( const BoxND< dim > &  b,
int  ref_ratio 
)
inlinenoexcept

Refine BoxND by given (positive) refinement ratio.

NOTE: if type(dir) = CELL centered: lo <- lo*ratio and hi <- (hi+1)*ratio - 1. NOTE: if type(dir) = NODE centered: lo <- lo*ratio and hi <- hi*ratio.

Parameters
binput Box
ref_ratiorefinement ratio
Returns
the coarsened Box