1 #ifndef AMREX_REALVECT_H_
2 #define AMREX_REALVECT_H_
3 #include <AMReX_Config.H>
56 #if (AMREX_SPACEDIM > 1)
135 Real*
end () noexcept {
return vect + AMREX_SPACEDIM; }
143 const Real*
end () const noexcept {
return vect + AMREX_SPACEDIM; }
283 #if (AMREX_SPACEDIM == 3)
423 RealVect operator+ () const noexcept;
430 RealVect operator- () const noexcept;
437 Real
sum () const noexcept;
458 Real
product () const noexcept;
466 int minDir(const
bool& a_doAbs) const noexcept;
474 int maxDir(const
bool& a_doAbs) const noexcept;
669 AMREX_D_EXPR(vect[0] -= p[0], vect[1] -= p[1], vect[2] -= p[2]);
705 static_cast<int>(std::floor(
vect[1])),
706 static_cast<int>(std::floor(
vect[2]))));
715 static_cast<int>(std::ceil(
vect[1])),
716 static_cast<int>(std::ceil(
vect[2]))));
725 static_cast<int>(std::round(
vect[1])),
726 static_cast<int>(std::round(
vect[2]))));
779 return AMREX_D_TERM(vect[0] < p[0], && vect[1] < p[1], && vect[2] < p[2]);
787 return AMREX_D_TERM(vect[0] <= p[0], && vect[1] <= p[1], && vect[2] <= p[2]);
795 return AMREX_D_TERM(vect[0] > p[0], && vect[1] > p[1], && vect[2] > p[2]);
803 return AMREX_D_TERM(vect[0] >= p[0], && vect[1] >= p[1], && vect[2] >= p[2]);
852 vect[1]*a_rhs.vect[1], +
853 vect[2]*a_rhs.vect[2]);
856 #if (AMREX_SPACEDIM == 3)
860 RealVect tmp(vect[1]*a_rhs[2] - vect[2]*a_rhs[1],
861 vect[2]*a_rhs[0] - vect[0]*a_rhs[2],
862 vect[0]*a_rhs[1] - vect[1]*a_rhs[0]);
879 AMREX_D_EXPR(vect[0] += p[0], vect[1] += p[1], vect[2] += p[2]);
887 AMREX_D_EXPR(vect[0] *= p[0], vect[1] *= p[1], vect[2] *= p[2]);
927 AMREX_D_EXPR(vect[0] /= p[0], vect[1] /= p[1], vect[2] /= p[2]);
955 if (vect[
idir] < vect[mDir])
980 if (vect[
idir] > vect[mDir])
#define BL_ASSERT(EX)
Definition: AMReX_BLassert.H:39
#define AMREX_ASSERT(EX)
Definition: AMReX_BLassert.H:38
#define AMREX_FORCE_INLINE
Definition: AMReX_Extension.H:119
#define AMREX_EXPORT
Definition: AMReX_Extension.H:191
#define AMREX_GPU_HOST_DEVICE
Definition: AMReX_GpuQualifiers.H:20
int idir
Definition: AMReX_HypreMLABecLap.cpp:1093
#define AMREX_D_EXPR(a, b, c)
Definition: AMReX_SPACE.H:81
#define AMREX_D_TERM(a, b, c)
Definition: AMReX_SPACE.H:129
#define AMREX_D_DECL(a, b, c)
Definition: AMReX_SPACE.H:104
A Real vector in SpaceDim-dimensional space.
Definition: AMReX_RealVect.H:32
AMREX_GPU_HOST_DEVICE const Real * end() const noexcept
Definition: AMReX_RealVect.H:143
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE RealVect TheUnitVector() noexcept
Definition: AMReX_RealVect.H:551
Real vect[SpaceDim]
Definition: AMReX_RealVect.H:642
AMREX_GPU_HOST_DEVICE bool operator!=(const RealVect &p) const noexcept
Definition: AMReX_RealVect.H:168
friend std::istream & operator>>(std::istream &is, RealVect &iv)
Definition: AMReX_RealVect.cpp:18
AMREX_GPU_HOST_DEVICE Real product() const noexcept
Definition: AMReX_RealVect.H:760
AMREX_GPU_HOST_DEVICE int maxDir(const bool &a_doAbs) const noexcept
Definition: AMReX_RealVect.H:966
AMREX_GPU_HOST_DEVICE RealVect & max(const RealVect &p) noexcept
Definition: AMReX_RealVect.H:820
AMREX_GPU_HOST_DEVICE Real * begin() noexcept
Definition: AMReX_RealVect.H:119
AMREX_GPU_HOST_DEVICE RealVect & operator/=(Real s) noexcept
Definition: AMReX_RealVect.H:917
RealVect(const std::vector< Real > &vr) noexcept
Definition: AMReX_RealVect.H:46
constexpr AMREX_GPU_HOST_DEVICE RealVect(Real i) noexcept
Definition: AMReX_RealVect.H:62
AMREX_GPU_HOST_DEVICE Real * dataPtr() noexcept
Definition: AMReX_RealVect.H:495
AMREX_GPU_HOST_DEVICE IntVect round() const noexcept
Definition: AMReX_RealVect.H:722
friend AMREX_GPU_HOST_DEVICE RealVect BASISREALV(int dir) noexcept
Definition: AMReX_RealVect.H:991
AMREX_GPU_HOST_DEVICE RealVect & operator-=(Real s) noexcept
Definition: AMReX_RealVect.H:649
AMREX_GPU_HOST_DEVICE Real vectorLength() const noexcept
Definition: AMReX_RealVect.H:740
AMREX_GPU_HOST_DEVICE bool operator<(const RealVect &p) const noexcept
Definition: AMReX_RealVect.H:777
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE RealVect TheZeroVector() noexcept
Definition: AMReX_RealVect.H:543
AMREX_GPU_HOST_DEVICE Real dotProduct(const RealVect &a_rhs) const noexcept
Definition: AMReX_RealVect.H:849
static AMREX_EXPORT const RealVect Unit
Definition: AMReX_RealVect.H:529
AMREX_GPU_HOST_DEVICE RealVect operator+() const noexcept
Definition: AMReX_RealVect.H:677
AMREX_GPU_HOST_DEVICE bool operator<=(const RealVect &p) const noexcept
Definition: AMReX_RealVect.H:785
AMREX_GPU_HOST_DEVICE Real sum() const noexcept
Definition: AMReX_RealVect.H:732
AMREX_GPU_HOST_DEVICE bool operator==(const RealVect &p) const noexcept
Definition: AMReX_RealVect.H:158
AMREX_GPU_HOST_DEVICE IntVect ceil() const noexcept
Definition: AMReX_RealVect.H:712
AMREX_GPU_HOST_DEVICE RealVect & min(const RealVect &p) noexcept
Definition: AMReX_RealVect.H:809
friend std::ostream & operator<<(std::ostream &ostr, const RealVect &p)
Definition: AMReX_RealVect.cpp:11
AMREX_GPU_HOST_DEVICE Real * end() noexcept
Definition: AMReX_RealVect.H:135
AMREX_GPU_HOST_DEVICE RealVect operator*(Real s) const noexcept
Definition: AMReX_RealVect.H:893
AMREX_GPU_HOST_DEVICE RealVect & operator+=(Real s) noexcept
Definition: AMReX_RealVect.H:869
AMREX_GPU_HOST_DEVICE RealVect(const Real *a) noexcept
Definition: AMReX_RealVect.H:70
AMREX_GPU_HOST_DEVICE RealVect & operator*=(Real s) noexcept
Definition: AMReX_RealVect.H:658
AMREX_GPU_HOST_DEVICE RealVect operator/(Real s) const noexcept
Definition: AMReX_RealVect.H:933
static AMREX_EXPORT const RealVect Zero
Definition: AMReX_RealVect.H:523
AMREX_GPU_HOST_DEVICE Real radSquared() const noexcept
Definition: AMReX_RealVect.H:750
Real & operator[](int i) &&=delete
AMREX_GPU_HOST_DEVICE RealVect operator-() const noexcept
Definition: AMReX_RealVect.H:685
constexpr RealVect() noexcept
Definition: AMReX_RealVect.H:44
AMREX_GPU_HOST_DEVICE int minDir(const bool &a_doAbs) const noexcept
Definition: AMReX_RealVect.H:941
AMREX_GPU_HOST_DEVICE IntVect floor() const noexcept
Definition: AMReX_RealVect.H:702
AMREX_GPU_HOST_DEVICE RealVect & scale(Real s) noexcept
Definition: AMReX_RealVect.H:693
AMREX_GPU_HOST_DEVICE const Real * dataPtr() const noexcept
Definition: AMReX_RealVect.H:488
AMREX_GPU_HOST_DEVICE RealVect(const IntVect &iv) noexcept
Definition: AMReX_RealVect.H:78
AMREX_GPU_HOST_DEVICE bool operator>=(const RealVect &p) const noexcept
Definition: AMReX_RealVect.H:801
AMREX_GPU_HOST_DEVICE bool operator>(const RealVect &p) const noexcept
Definition: AMReX_RealVect.H:793
AMREX_GPU_HOST_DEVICE const Real * begin() const noexcept
Definition: AMReX_RealVect.H:127
Definition: AMReX_Amr.cpp:49
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuComplex< T > operator/(const GpuComplex< T > &a_x, const GpuComplex< T > &a_y) noexcept
Divide a complex number by another one.
Definition: AMReX_GpuComplex.H:288
AMREX_GPU_HOST_DEVICE RealVect BASISREALV(int dir) noexcept
Definition: AMReX_RealVect.H:991
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE const T & max(const T &a, const T &b) noexcept
Definition: AMReX_Algorithm.H:35
AMREX_GPU_HOST_DEVICE constexpr AMREX_FORCE_INLINE const T & min(const T &a, const T &b) noexcept
Definition: AMReX_Algorithm.H:21
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T abs(const GpuComplex< T > &a_z) noexcept
Return the absolute value of a complex number.
Definition: AMReX_GpuComplex.H:356
IntVectND< AMREX_SPACEDIM > IntVect
Definition: AMReX_BaseFwd.H:30
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > scale(const IntVectND< dim > &p, int s) noexcept
Returns a IntVectND obtained by multiplying each of the components of this IntVectND by s.
Definition: AMReX_IntVect.H:1006
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuComplex< T > operator-(const GpuComplex< T > &a_x)
Negate a complex number.
Definition: AMReX_GpuComplex.H:173
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuComplex< T > operator+(const GpuComplex< T > &a_x)
Identity operation on a complex number.
Definition: AMReX_GpuComplex.H:166
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuComplex< T > operator*(const GpuComplex< T > &a_x, const GpuComplex< T > &a_y) noexcept
Multiply two complex numbers.
Definition: AMReX_GpuComplex.H:252
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE GpuComplex< T > sqrt(const GpuComplex< T > &a_z) noexcept
Return the square root of a complex number.
Definition: AMReX_GpuComplex.H:373