Cell-Based or Node-Based Indices. More...
#include <AMReX_IndexType.H>
Public Types | |
| using | value_type = CellIndex |
Public Types inherited from amrex::CellIndexEnum | |
| enum | CellIndex { CELL = 0 , NODE = 1 } |
| The cell index type: one of CELL or NODE. More... | |
Public Member Functions | |
| __host__ __device__ constexpr | IndexTypeND () noexcept=default |
| The default constructor. | |
| __host__ __device__ | IndexTypeND (const IntVectND< dim > &iv) noexcept |
| Construct an IndexTypeND identical to an IntVectND. | |
| template<class... Args, std::enable_if_t<(sizeof...(Args)+1==dim) &&IsConvertible_v< CellIndex, Args... >, int > = 0> | |
| __host__ __device__ constexpr | IndexTypeND (CellIndex i, Args...js) noexcept |
| Construct an IndexTypeND given an explicit CellIndex for each direction. The inputs for this constructor are N CellIndex, where N is equal to the number of dimensions of the IndexTypeND. | |
| __host__ __device__ void | set (int dir) noexcept |
| Set IndexTypeND to be NODE based in direction dir. | |
| __host__ __device__ void | unset (int dir) noexcept |
| Set IndexTypeND to be CELL based in direction dir. | |
| __host__ __device__ bool | test (int dir) const noexcept |
| True if IndexTypeND is NODE based in direction dir. | |
| __host__ __device__ constexpr void | setall () noexcept |
| Set NODE based in all directions. | |
| __host__ __device__ void | clear () noexcept |
| Set CELL based in all directions. | |
| __host__ __device__ bool | any () const noexcept |
| True if this IndexTypeND is NODE based in any direction. | |
| __host__ __device__ bool | ok () const noexcept |
| True if IndexTypeND is valid. | |
| __host__ __device__ void | flip (int i) noexcept |
| Change from CELL to NODE or NODE to CELL in direction dir. | |
| __host__ __device__ bool | operator== (const IndexTypeND &t) const noexcept |
| True if IndexTypeNDs are identical. | |
| __host__ __device__ bool | operator!= (const IndexTypeND &t) const noexcept |
| True if IndexTypeNDs are not identical. | |
| __host__ __device__ bool | operator< (const IndexTypeND &t) const noexcept |
| __host__ __device__ bool | cellCentered () const noexcept |
| True if the IndexTypeND is CELL based in all directions. | |
| __host__ __device__ bool | cellCentered (int dir) const noexcept |
| True if the IndexTypeND is CELL based in dir-direction. | |
| __host__ __device__ bool | nodeCentered () const noexcept |
| True if the IndexTypeND is NODE based in all directions. | |
| __host__ __device__ bool | nodeCentered (int dir) const noexcept |
| True if the IndexTypeND is NODE based in dir-direction. | |
| __host__ __device__ void | setType (int dir, CellIndex t) noexcept |
| Set IndexTypeND to CellIndex type t in direction dir. | |
| __host__ __device__ constexpr CellIndex | ixType (int dir) const noexcept |
| Returns the CellIndex in direction dir. | |
| __host__ __device__ int | operator[] (int dir) const noexcept |
| Return an integer representing the IndexTypeND in direction dir. | |
| template<std::size_t i> | |
| __host__ __device__ constexpr CellIndex | get () const noexcept |
| Returns the i'th CellIndex of the IndexTypeND. Used by structured bindings. | |
| __host__ __device__ IntVectND< dim > | ixType () const noexcept |
| Fill an IntVectND of size dim with IndexTypeNDs. | |
| __host__ __device__ IntVectND< dim > | toIntVect () const noexcept |
| Fill an IntVectND of size dim with IndexTypeNDs. | |
| template<int new_dim> | |
| __host__ __device__ IndexTypeND< new_dim > | shrink () const noexcept |
| Returns a new IndexTypeND of size new_dim and assigns the first new_dim values of this IndexTypeND to it. | |
| template<int new_dim> | |
| __host__ __device__ IndexTypeND< new_dim > | expand (CellIndex fill_extra=CellIndex::CELL) const noexcept |
| Returns a new IndexTypeND of size new_dim and assigns all values of this IndexTypeND to it and fill_extra to the remaining elements. | |
| template<int new_dim> | |
| __host__ __device__ IndexTypeND< new_dim > | resize (CellIndex fill_extra=CellIndex::CELL) const noexcept |
| Returns a new IndexTypeND of size new_dim by either shrinking or expanding this IndexTypeND. | |
| __host__ __device__ constexpr unsigned int & | getBits () noexcept |
| Return the bit field representing the underlying data. | |
| __host__ __device__ constexpr const unsigned int & | getBits () const noexcept |
| Return the bit field representing the underlying data. | |
Static Public Member Functions | |
| __host__ static __device__ constexpr IndexTypeND< dim > | TheCellType () noexcept |
| This static member function returns an IndexTypeND object of value IndexTypeND::CELL. It is provided as a convenience to our users when defining a Box all of whose faces should be of type IndexTypeND::CELL. | |
| __host__ static __device__ constexpr IndexTypeND< dim > | TheNodeType () noexcept |
| This static member function returns an IndexTypeND object of value IndexTypeND::NODE. It is provided as a convenience to our users when defining a Box all of whose faces should be of type IndexTypeND::NODE. | |
| __host__ static __device__ constexpr std::size_t | size () noexcept |
| Return the size of this IndexTypeND. | |
| __host__ static __device__ constexpr int | isize () noexcept |
| Return the size of this IndexTypeND. | |
Static Private Member Functions | |
| __host__ static __device__ constexpr unsigned int | mask (int k) noexcept |
| Returns 1<<k. | |
Private Attributes | |
| unsigned int | itype {0} |
| An integer holding the CellIndex in bits 0 - dim-1. | |
Cell-Based or Node-Based Indices.
The class IndexTypeND defines an index as being cell based or node (edge) based in each of the dim directions. This class defines an enumerated type CellIndex to be either CELL or NODE; i.e. each of the dim dimensions must be either CELL or NODE.
| using amrex::IndexTypeND< dim >::value_type = CellIndex |
|
constexprdefaultnoexcept |
The default constructor.
|
inlineexplicitnoexcept |
Construct an IndexTypeND identical to an IntVectND.
|
inlineconstexprnoexcept |
Construct an IndexTypeND given an explicit CellIndex for each direction. The inputs for this constructor are N CellIndex, where N is equal to the number of dimensions of the IndexTypeND.
|
inlinenoexcept |
True if this IndexTypeND is NODE based in any direction.
|
inlinenoexcept |
True if the IndexTypeND is CELL based in all directions.
|
inlinenoexcept |
True if the IndexTypeND is CELL based in dir-direction.
|
inlinenoexcept |
Set CELL based in all directions.
|
inlinenoexcept |
Returns a new IndexTypeND of size new_dim and assigns all values of this IndexTypeND to it and fill_extra to the remaining elements.
|
inlinenoexcept |
Change from CELL to NODE or NODE to CELL in direction dir.
|
inlineconstexprnoexcept |
Returns the i'th CellIndex of the IndexTypeND. Used by structured bindings.
|
inlineconstexprnoexcept |
Return the bit field representing the underlying data.
|
inlineconstexprnoexcept |
Return the bit field representing the underlying data.
|
inlinestaticconstexprnoexcept |
Return the size of this IndexTypeND.
|
inlinenoexcept |
Fill an IntVectND of size dim with IndexTypeNDs.
|
inlineconstexprnoexcept |
Returns the CellIndex in direction dir.
|
inlinestaticconstexprprivatenoexcept |
Returns 1<<k.
|
inlinenoexcept |
True if the IndexTypeND is NODE based in all directions.
|
inlinenoexcept |
True if the IndexTypeND is NODE based in dir-direction.
|
inlinenoexcept |
True if IndexTypeND is valid.
|
inlinenoexcept |
True if IndexTypeNDs are not identical.
|
inlinenoexcept |
|
inlinenoexcept |
True if IndexTypeNDs are identical.
|
inlinenoexcept |
Return an integer representing the IndexTypeND in direction dir.
|
inlinenoexcept |
Returns a new IndexTypeND of size new_dim by either shrinking or expanding this IndexTypeND.
|
inlinenoexcept |
Set IndexTypeND to be NODE based in direction dir.
|
inlineconstexprnoexcept |
Set NODE based in all directions.
|
inlinenoexcept |
Set IndexTypeND to CellIndex type t in direction dir.
|
inlinenoexcept |
Returns a new IndexTypeND of size new_dim and assigns the first new_dim values of this IndexTypeND to it.
|
inlinestaticconstexprnoexcept |
Return the size of this IndexTypeND.
|
inlinenoexcept |
True if IndexTypeND is NODE based in direction dir.
|
inlinestaticconstexprnoexcept |
This static member function returns an IndexTypeND object of value IndexTypeND::CELL. It is provided as a convenience to our users when defining a Box all of whose faces should be of type IndexTypeND::CELL.
|
inlinestaticconstexprnoexcept |
This static member function returns an IndexTypeND object of value IndexTypeND::NODE. It is provided as a convenience to our users when defining a Box all of whose faces should be of type IndexTypeND::NODE.
|
inlinenoexcept |
Fill an IntVectND of size dim with IndexTypeNDs.
|
inlinenoexcept |
Set IndexTypeND to be CELL based in direction dir.
|
private |
An integer holding the CellIndex in bits 0 - dim-1.