Cell-Based or Node-Based Indices. More...
#include <AMReX_IndexType.H>
Public Types | |
| enum | CellIndex { CELL = 0 , NODE = 1 } |
| The cell index type: one of CELL or NODE. More... | |
Public Member Functions | |
| constexpr AMREX_GPU_HOST_DEVICE | IndexType () noexcept=default |
| The default constructor. More... | |
| AMREX_GPU_HOST_DEVICE | IndexType (const IntVect &iv) noexcept |
| Construct an IndexType identical to an IntVect. More... | |
| constexpr AMREX_GPU_HOST_DEVICE | IndexType (AMREX_D_DECL(CellIndex i, CellIndex j, CellIndex k)) noexcept |
| Construct an IndexType given an explicit CellIndex for each direction. AMREX_D_DECL is a macro that sets the constructor to take AMREX_SPACEDIM arguments. More... | |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void | set (int dir) noexcept |
| Set IndexType to be NODE based in direction dir. More... | |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void | unset (int dir) noexcept |
| Set IndexType to be CELL based in direction dir. More... | |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool | test (int dir) const noexcept |
| True if IndexType is NODE based in direction dir. More... | |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void | setall () noexcept |
| Set NODE based in all directions. More... | |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void | clear () noexcept |
| Set CELL based in all directions. More... | |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool | any () const noexcept |
| True if this IndexType is NODE based in any direction. More... | |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool | ok () const noexcept |
| True if IndexType is valid. More... | |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void | flip (int i) noexcept |
| Change from CELL to NODE or NODE to CELL in direction dir. More... | |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool | operator== (const IndexType &t) const noexcept |
| True if IndexTypes are identical. More... | |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool | operator!= (const IndexType &t) const noexcept |
| True if IndexTypes are not identical. More... | |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool | operator< (const IndexType &t) const noexcept |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool | cellCentered () const noexcept |
| True if the IndexType is CELL based in all directions. More... | |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool | cellCentered (int dir) const noexcept |
| True if the IndexType is CELL based in dir-direction. More... | |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool | nodeCentered () const noexcept |
| True if the IndexType is NODE based in all directions. More... | |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool | nodeCentered (int dir) const noexcept |
| True if the IndexType is NODE based in dir-direction. More... | |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void | setType (int dir, CellIndex t) noexcept |
| Set IndexType to CellIndex type t in direction dir. More... | |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE CellIndex | ixType (int dir) const noexcept |
| Returns the CellIndex in direction dir. More... | |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int | operator[] (int dir) const noexcept |
| Return an integer representing the IndexType in direction dir. More... | |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVect | ixType () const noexcept |
| Fill an IntVect of size AMREX_SPACEDIM with IndexTypes. More... | |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVect | toIntVect () const noexcept |
| Fill an IntVect of size AMREX_SPACEDIM with IndexTypes. More... | |
Static Public Member Functions | |
| AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE IndexType | TheCellType () noexcept |
| This static member function returns an IndexType object of value IndexType::CELL. It is provided as a convenience to our users when defining a Box all of whose faces should be of type IndexType::CELL. More... | |
| AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE IndexType | TheNodeType () noexcept |
| This static member function returns an IndexType object of value IndexType::NODE. It is provided as a convenience to our users when defining a Box all of whose faces should be of type IndexType::NODE. More... | |
Static Private Member Functions | |
| AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE int | mask (int k) noexcept |
| Returns 1<<k. More... | |
Private Attributes | |
| unsigned int | itype {0} |
| An integer holding the CellIndex in bits 0 - AMREX_SPACEDIM-1. More... | |
Friends | |
| MPI_Datatype | ParallelDescriptor::Mpi_typemap () |
Cell-Based or Node-Based Indices.
The class IndexType defines an index as being cell based or node (edge) based in each of the AMREX_SPACEDIM directions. This class defines an enumerated type CellIndex to be either CELL or NODE; i.e. each of the AMREX_SPACEDIM dimensions must be either CELL or NODE.
|
constexprdefaultnoexcept |
The default constructor.
|
inlineexplicitnoexcept |
Construct an IndexType identical to an IntVect.
|
inlineconstexprnoexcept |
Construct an IndexType given an explicit CellIndex for each direction. AMREX_D_DECL is a macro that sets the constructor to take AMREX_SPACEDIM arguments.
|
inlinenoexcept |
True if this IndexType is NODE based in any direction.
|
inlinenoexcept |
True if the IndexType is CELL based in all directions.
|
inlinenoexcept |
True if the IndexType is CELL based in dir-direction.
|
inlinenoexcept |
Set CELL based in all directions.
|
inlinenoexcept |
Change from CELL to NODE or NODE to CELL in direction dir.
|
inlinenoexcept |
Fill an IntVect of size AMREX_SPACEDIM with IndexTypes.
|
inlinenoexcept |
Returns the CellIndex in direction dir.
|
inlinestaticprivatenoexcept |
Returns 1<<k.
|
inlinenoexcept |
True if the IndexType is NODE based in all directions.
|
inlinenoexcept |
True if the IndexType is NODE based in dir-direction.
|
inlinenoexcept |
True if IndexType is valid.
|
inlinenoexcept |
True if IndexTypes are not identical.
|
inlinenoexcept |
|
inlinenoexcept |
True if IndexTypes are identical.
|
inlinenoexcept |
Return an integer representing the IndexType in direction dir.
|
inlinenoexcept |
Set IndexType to be NODE based in direction dir.
|
inlinenoexcept |
Set NODE based in all directions.
|
inlinenoexcept |
Set IndexType to CellIndex type t in direction dir.
|
inlinenoexcept |
True if IndexType is NODE based in direction dir.
|
inlinestaticconstexprnoexcept |
This static member function returns an IndexType object of value IndexType::CELL. It is provided as a convenience to our users when defining a Box all of whose faces should be of type IndexType::CELL.
|
inlinestaticconstexprnoexcept |
This static member function returns an IndexType object of value IndexType::NODE. It is provided as a convenience to our users when defining a Box all of whose faces should be of type IndexType::NODE.
|
inlinenoexcept |
Fill an IntVect of size AMREX_SPACEDIM with IndexTypes.
|
inlinenoexcept |
Set IndexType to be CELL based in direction dir.
|
friend |
|
private |
An integer holding the CellIndex in bits 0 - AMREX_SPACEDIM-1.