#include <AMReX_IntVect.H>
Classes | |
class | shift_hasher |
Public Types | |
using | hasher = shift_hasher |
Public Member Functions | |
constexpr | IntVect () noexcept |
Construct an IntVect whose components are all zero. More... | |
constexpr AMREX_GPU_HOST_DEVICE | IntVect (int i) noexcept |
Construct an IntVect given the specific values for its coordinates. AMREX_D_DECL is a macro that sets the constructor to take AMREX_SPACEDIM arguments. More... | |
AMREX_GPU_HOST_DEVICE | IntVect (const int *a) noexcept |
Construct an IntVect setting the coordinates to the corresponding values in the integer array a. More... | |
IntVect (const Vector< int > &a) noexcept | |
Construct an IntVect from an Vector<int>. It is an error if the Vector<int> doesn't have the same dimension as this IntVect. More... | |
IntVect (const Array< int, AMREX_SPACEDIM > &a) noexcept | |
Construct an IntVect from an Array<int,AMREX_SPACEDIM>. More... | |
constexpr | IntVect (Dim3 const &a) noexcept |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Dim3 | dim3 () const noexcept |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int | sum () const noexcept |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int | max () const noexcept |
maximum (no absolute values) value More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int | min () const noexcept |
minimum (no absolute values) value More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int | maxDir (bool a_doAbsValue) const noexcept |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int & | operator[] (int i) noexcept |
Returns a reference to the i'th coordinate of the IntVect. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const int & | operator[] (int i) const noexcept |
Returns the i'th coordinate of the IntVect. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int * | begin () noexcept |
Returns a pointer to the first element of the IntVect. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const int * | begin () const noexcept |
Returns a pointer to the first element of the IntVect. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int * | end () noexcept |
Returns a pointer to the (last+1) element of the IntVect. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const int * | end () const noexcept |
Returns a pointer to the (last+1) element of the IntVect. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVect & | setVal (int i, int val) noexcept |
Set i'th coordinate of IntVect to val. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const int * | getVect () const &noexcept |
Returns a const pointer to an array of coordinates of the IntVect. Useful for arguments to FORTRAN calls. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int * | getVect () &noexcept |
AMREX_GPU_HOST_DEVICE int * | getVect () &&=delete |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool | operator== (int val) const noexcept |
Returns true if all components are equal to the argument val. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool | operator!= (int val) const noexcept |
Returns true if any component is not equal to the argument val. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool | operator== (const IntVect &rhs) const noexcept |
Returns true if this is equivalent to rhs. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool | operator!= (const IntVect &rhs) const noexcept |
Returns true if this is different from rhs. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool | operator< (const IntVect &rhs) const noexcept |
Return true if this is lexicographically less than rhs. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool | operator<= (const IntVect &rhs) const noexcept |
Return true if this is lexicographically less than or equal to rhs. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool | operator> (const IntVect &rhs) const noexcept |
Return true if this is lexicographically greater than rhs. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool | operator>= (const IntVect &rhs) const noexcept |
Return true if this is lexicographically greater than or equal to rhs. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool | allLT (const IntVect &rhs) const noexcept |
Returns true if this is less than argument for all components. NOTE: This is NOT a strict weak ordering usable by STL sorting algorithms. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool | allLE (const IntVect &rhs) const noexcept |
Returns true if this is less than or equal to argument for all components. NOTE: This is NOT a strict weak ordering usable by STL sorting algorithms. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool | allGT (const IntVect &rhs) const noexcept |
Returns true if this is greater than argument for all components. NOTE: This is NOT a strict weak ordering usable by STL sorting algorithms. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool | allGE (const IntVect &rhs) const noexcept |
Returns true if this is greater than or equal to argument for all components. NOTE: This is NOT a strict weak ordering usable by STL sorting algorithms. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVect | operator+ () const noexcept |
Unary plus – for completeness. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVect | operator- () const noexcept |
Unary Minus – negates all components. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVect & | operator+= (int s) noexcept |
Modifies IntVect by addition of a scalar to each component. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVect & | operator+= (const IntVect &p) noexcept |
Modifies IntVect by component-wise addition with argument. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVect & | operator*= (int s) noexcept |
Modifies IntVect by multiplication of a scalar to each component. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVect & | operator*= (const IntVect &p) noexcept |
Modifies IntVect by component-wise multiplication with argument. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVect & | operator/= (int s) noexcept |
Modifies IntVect by division by a scalar to each component. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVect & | operator/= (const IntVect &p) noexcept |
Modifies IntVect by component-wise division with argument. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVect & | operator-= (int s) noexcept |
Modifies IntVect by subtraction of a scalar to each component. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVect & | operator-= (const IntVect &p) noexcept |
Modifies IntVect by component-wise subtraction with argument. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVect | operator+ (const IntVect &p) const noexcept |
Returns component-wise sum of IntVect and argument. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVect | operator+ (int s) const noexcept |
Return an IntVect that is this IntVect + s. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVect | operator- (const IntVect &p) const noexcept |
Returns component-wise difference of IntVect and argument. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVect | operator- (int s) const noexcept |
Return an IntVect that is this IntVect - s. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVect | operator* (const IntVect &p) const noexcept |
Returns component-wise product of IntVect and argument. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVect | operator* (int s) const noexcept |
Returns component-wise product of IntVect and s. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVect | operator/ (const IntVect &p) const noexcept |
Returns component-wise division of IntVect by argument. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVect | operator/ (int s) const noexcept |
Returns component-wise division of IntVect by s. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVect & | min (const IntVect &p) noexcept |
Modifies IntVect by taking component-wise min with argument. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVect & | max (const IntVect &p) noexcept |
Modifies IntVect by taking component-wise max with argument. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVect & | scale (int s) noexcept |
Modify IntVect by multiplying each coordinate by s. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVect & | reflect (int ref_ix, int idir) noexcept |
Modify IntVect by reflecting it in the plane defined by the index ref_ix and with normal in the direction of idir. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVect & | shift (int coord, int s) noexcept |
Modify IntVect by adding s to given coordinate. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVect & | shift (const IntVect &iv) noexcept |
Equivalent to shift(0,iv[0]).shift(1,iv[1]) ... More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVect & | diagShift (int s) noexcept |
Modify IntVect by adding s to each coordinate. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVect & | coarsen (const IntVect &p) noexcept |
Modify IntVect by component-wise integer projection. More... | |
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVect & | coarsen (int p) noexcept |
Modify IntVect by component-wise integer projection. More... | |
Static Public Member Functions | |
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE IntVect | TheZeroVector () noexcept |
This static member function returns a reference to a constant IntVect object, all of whose AMREX_SPACEDIM arguments are set to zero (0). Figuratively, it is the zero vector in AMREX_SPACEDIM-dimensional space. It is provided as a convenient way to specify the zero vector. More... | |
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE IntVect | TheUnitVector () noexcept |
This static member function returns a reference to a constant IntVect object, all of whose AMREX_SPACEDIM arguments are set to one (1). Figuratively, it is the unit vector in AMREX_SPACEDIM-dimensional space. It is provided as a convenient way to specify the unit vector. More... | |
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE IntVect | TheDimensionVector (int d) noexcept |
This static member function returns a reference to a constant IntVect object, all of whose AMREX_SPACEDIM arguments are set to zero except that the d-direction is set to one. More... | |
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE IntVect | TheNodeVector () noexcept |
This static member function returns a reference to a constant IntVect object, all of whose AMREX_SPACEDIM arguments are set to IndexType::NODE. It is provided as a convenience to our users when defining Boxes. More... | |
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE IntVect | TheCellVector () noexcept |
This static member function returns a reference to a constant IntVect object, all of whose AMREX_SPACEDIM arguments are set to IndexType::CELL. It is provided as a convenience to our users when defining Boxes. More... | |
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE IntVect | TheMaxVector () noexcept |
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE IntVect | TheMinVector () noexcept |
Static Public Attributes | |
static const IntVect | Zero = IntVect::TheZeroVector() |
static const IntVect | Unit = IntVect::TheUnitVector() |
Private Attributes | |
int | vect [AMREX_SPACEDIM] = {AMREX_D_DECL(0,0,0)} |
Friends | |
MPI_Datatype | ParallelDescriptor::Mpi_typemap () |
std::ostream & | operator<< (std::ostream &os, const IntVect &iv) |
std::istream & | operator>> (std::istream &is, IntVect &iv) |
An Integer Vector in SPACEDIM-Dimensional Space
The class IntVect is an implementation of an integer vector in a SPACEDIM-dimensional space. It represents a point in a discrete space. IntVect values are accessed using the operator[] function, as for a normal C++ array. In addition, the basic arithmetic operators have been overloaded to implement scaling and translation operations.
using amrex::IntVect::hasher = shift_hasher |
|
inlineconstexprnoexcept |
Construct an IntVect whose components are all zero.
|
inlineexplicitconstexprnoexcept |
Construct an IntVect given the specific values for its coordinates. AMREX_D_DECL is a macro that sets the constructor to take AMREX_SPACEDIM arguments.
|
inlineexplicitnoexcept |
Construct an IntVect setting the coordinates to the corresponding values in the integer array a.
Construct an IntVect from an Vector<int>. It is an error if the Vector<int> doesn't have the same dimension as this IntVect.
Construct an IntVect from an Array<int,AMREX_SPACEDIM>.
|
inlineexplicitconstexprnoexcept |
|
inlinenoexcept |
Returns true if this is greater than or equal to argument for all components. NOTE: This is NOT a strict weak ordering usable by STL sorting algorithms.
|
inlinenoexcept |
Returns true if this is greater than argument for all components. NOTE: This is NOT a strict weak ordering usable by STL sorting algorithms.
|
inlinenoexcept |
Returns true if this is less than or equal to argument for all components. NOTE: This is NOT a strict weak ordering usable by STL sorting algorithms.
|
inlinenoexcept |
Returns true if this is less than argument for all components. NOTE: This is NOT a strict weak ordering usable by STL sorting algorithms.
|
inlinenoexcept |
Returns a pointer to the first element of the IntVect.
|
inlinenoexcept |
Returns a pointer to the first element of the IntVect.
|
noexcept |
Modify IntVect by component-wise integer projection.
|
noexcept |
Modify IntVect by component-wise integer projection.
|
inlinenoexcept |
Modify IntVect by adding s to each coordinate.
|
inlinenoexcept |
|
inlinenoexcept |
Returns a pointer to the (last+1) element of the IntVect.
|
inlinenoexcept |
Returns a pointer to the (last+1) element of the IntVect.
|
delete |
|
inlinenoexcept |
|
inlinenoexcept |
Returns a const pointer to an array of coordinates of the IntVect. Useful for arguments to FORTRAN calls.
|
inlinenoexcept |
maximum (no absolute values) value
|
inlinenoexcept |
Modifies IntVect by taking component-wise max with argument.
|
noexcept |
|
inlinenoexcept |
minimum (no absolute values) value
|
inlinenoexcept |
Modifies IntVect by taking component-wise min with argument.
|
inlinenoexcept |
Returns true if this is different from rhs.
|
inlinenoexcept |
Returns true if any component is not equal to the argument val.
|
inlinenoexcept |
Returns component-wise product of IntVect and argument.
|
inlinenoexcept |
Returns component-wise product of IntVect and s.
|
inlinenoexcept |
Modifies IntVect by component-wise multiplication with argument.
|
inlinenoexcept |
Modifies IntVect by multiplication of a scalar to each component.
|
inlinenoexcept |
Unary plus – for completeness.
|
inlinenoexcept |
Returns component-wise sum of IntVect and argument.
|
inlinenoexcept |
|
inlinenoexcept |
Modifies IntVect by component-wise addition with argument.
|
inlinenoexcept |
Modifies IntVect by addition of a scalar to each component.
|
inlinenoexcept |
Unary Minus – negates all components.
|
inlinenoexcept |
Returns component-wise difference of IntVect and argument.
|
inlinenoexcept |
|
inlinenoexcept |
Modifies IntVect by component-wise subtraction with argument.
|
inlinenoexcept |
Modifies IntVect by subtraction of a scalar to each component.
|
inlinenoexcept |
Returns component-wise division of IntVect by argument.
|
inlinenoexcept |
Returns component-wise division of IntVect by s.
|
inlinenoexcept |
Modifies IntVect by component-wise division with argument.
|
inlinenoexcept |
Modifies IntVect by division by a scalar to each component.
|
inlinenoexcept |
Return true if this is lexicographically less than rhs.
|
inlinenoexcept |
Return true if this is lexicographically less than or equal to rhs.
|
inlinenoexcept |
Returns true if this is equivalent to rhs.
|
inlinenoexcept |
Returns true if all components are equal to the argument val.
|
inlinenoexcept |
Return true if this is lexicographically greater than rhs.
|
inlinenoexcept |
Return true if this is lexicographically greater than or equal to rhs.
|
inlinenoexcept |
Returns the i'th coordinate of the IntVect.
|
inlinenoexcept |
Returns a reference to the i'th coordinate of the IntVect.
|
inlinenoexcept |
Modify IntVect by reflecting it in the plane defined by the index ref_ix and with normal in the direction of idir.
|
inlinenoexcept |
Modify IntVect by multiplying each coordinate by s.
|
inlinenoexcept |
Set i'th coordinate of IntVect to val.
|
inlinenoexcept |
Equivalent to shift(0,iv[0]).shift(1,iv[1]) ...
|
inlinenoexcept |
Modify IntVect by adding s to given coordinate.
|
inlinenoexcept |
Sum of all components of this IntVect.
|
inlinestaticconstexprnoexcept |
This static member function returns a reference to a constant IntVect object, all of whose AMREX_SPACEDIM arguments are set to IndexType::CELL. It is provided as a convenience to our users when defining Boxes.
|
inlinestaticconstexprnoexcept |
This static member function returns a reference to a constant IntVect object, all of whose AMREX_SPACEDIM arguments are set to zero except that the d-direction is set to one.
|
inlinestaticconstexprnoexcept |
|
inlinestaticconstexprnoexcept |
|
inlinestaticconstexprnoexcept |
This static member function returns a reference to a constant IntVect object, all of whose AMREX_SPACEDIM arguments are set to IndexType::NODE. It is provided as a convenience to our users when defining Boxes.
|
inlinestaticconstexprnoexcept |
This static member function returns a reference to a constant IntVect object, all of whose AMREX_SPACEDIM arguments are set to one (1). Figuratively, it is the unit vector in AMREX_SPACEDIM-dimensional space. It is provided as a convenient way to specify the unit vector.
|
inlinestaticconstexprnoexcept |
This static member function returns a reference to a constant IntVect object, all of whose AMREX_SPACEDIM arguments are set to zero (0). Figuratively, it is the zero vector in AMREX_SPACEDIM-dimensional space. It is provided as a convenient way to specify the zero vector.
|
friend |
|
friend |
|
friend |
|
static |
This is an IntVect all of whose components are equal to one.
|
private |
|
static |
This is an IntVect all of whose components are equal to zero.