Block-Structured AMR Software Framework
AMReX_RealVect.H
Go to the documentation of this file.
1 #ifndef AMREX_REALVECT_H_
2 #define AMREX_REALVECT_H_
3 #include <AMReX_Config.H>
4 
5 #include <AMReX_Box.H>
6 #include <AMReX_REAL.H>
7 #include <AMReX_SPACE.H>
8 #include <AMReX_IntVect.H>
9 #include <AMReX_Utility.H>
10 #include <AMReX_Math.H>
11 
12 #include <cmath>
13 #include <cstddef>
14 #include <cstdlib>
15 #include <cstring>
16 #include <iosfwd>
17 #include <vector>
18 
19 namespace amrex
20 {
21 
31 class RealVect
32 {
33 public:
34 
39 
41 
44  constexpr RealVect () noexcept {} // NOLINT
45 
46  explicit RealVect (const std::vector<Real>& vr) noexcept : vect{AMREX_D_DECL(vr[0],vr[1],vr[2])} {
47  BL_ASSERT(vr.size() == AMREX_SPACEDIM);
48  }
49 
51 
56 #if (AMREX_SPACEDIM > 1)
58  constexpr RealVect (AMREX_D_DECL(Real i, Real j, Real k)) noexcept : vect{AMREX_D_DECL(i,j,k)} {}
59 #endif
60 
62  explicit constexpr RealVect (Real i) noexcept : vect{AMREX_D_DECL(i,i,i)} {}
63 
65 
70  explicit RealVect (const Real* a) noexcept : vect{AMREX_D_DECL(a[0],a[1],a[2])} {}
71 
73 
78  RealVect (const IntVect & iv) noexcept : vect{AMREX_D_DECL((Real)iv[0],(Real)iv[1],(Real)iv[2])} {}
79 
81 
85  Real& operator[] (int i) && = delete;
86 
88 
93  inline
94  Real& operator[] (int i) & noexcept
95  { AMREX_ASSERT(i>=0 && i < SpaceDim); return vect[i]; }
96 
98 
102  inline
103  const Real& operator[] (int i) const& noexcept
104  { AMREX_ASSERT(i>=0 && i < SpaceDim); return vect[i]; }
105 
112 
114 
117  [[nodiscard]] AMREX_GPU_HOST_DEVICE
118  inline
119  Real* begin () noexcept { return vect; }
120 
122 
125  [[nodiscard]] AMREX_GPU_HOST_DEVICE
126  inline
127  const Real* begin () const noexcept { return vect; }
128 
130 
133  [[nodiscard]] AMREX_GPU_HOST_DEVICE
134  inline
135  Real* end () noexcept { return vect + AMREX_SPACEDIM; }
136 
138 
141  [[nodiscard]] AMREX_GPU_HOST_DEVICE
142  inline
143  const Real* end () const noexcept { return vect + AMREX_SPACEDIM; }
144 
151 
153 
158  bool operator== (const RealVect& p) const noexcept {
159  return AMREX_D_TERM(vect[0] == p[0], && vect[1] == p[1], && vect[2] == p[2]);
160  }
161 
163 
168  bool operator!= (const RealVect& p) const noexcept {
169  return AMREX_D_TERM(vect[0] != p[0], || vect[1] != p[1], || vect[2] != p[2]);
170  }
171 
173 
180  AMREX_GPU_HOST_DEVICE inline
181  bool operator< (const RealVect& p) const noexcept;
182 
184 
191  AMREX_GPU_HOST_DEVICE inline
192  bool operator<= (const RealVect& p) const noexcept;
193 
195 
202  AMREX_GPU_HOST_DEVICE inline
203  bool operator> (const RealVect& p) const noexcept;
204 
206 
214  AMREX_GPU_HOST_DEVICE inline
215  bool operator>= (const RealVect& p) const noexcept;
216 
223 
225 
228  AMREX_GPU_HOST_DEVICE inline
229  RealVect& operator+= (Real s) noexcept;
230 
232 
236  AMREX_GPU_HOST_DEVICE inline
237  RealVect operator+ (Real s) const noexcept;
238 
240 
243  AMREX_GPU_HOST_DEVICE inline
244  RealVect& operator+= (const RealVect& p) noexcept;
245 
247 
251  AMREX_GPU_HOST_DEVICE inline
252  RealVect& operator-= (Real s) noexcept;
253 
255 
258  AMREX_GPU_HOST_DEVICE inline
259  RealVect& operator-= (const RealVect& p) noexcept;
260 
262 
266  AMREX_GPU_HOST_DEVICE inline
267  RealVect operator- (Real s) const noexcept;
268 
270 
273  AMREX_GPU_HOST_DEVICE inline
274  RealVect& operator*= (Real s) noexcept;
275 
277 
280  [[nodiscard]] AMREX_GPU_HOST_DEVICE inline
281  Real dotProduct(const RealVect& a_rhs) const noexcept;
282 
283 #if (AMREX_SPACEDIM == 3)
285 
288  [[nodiscard]] AMREX_GPU_HOST_DEVICE inline
289  RealVect crossProduct(const RealVect& a_rhs) const noexcept;
290 #endif
291 
293 
296  AMREX_GPU_HOST_DEVICE inline
297  RealVect& operator*= (const RealVect& p) noexcept;
298 
299 //XXX ///
300 //XXX /**
301 //XXX Returns component-wise product of this RealVect and argument.
302 //XXX */
303 //XXX RealVect operator* (const RealVect& p) const;
304 
306 
310  AMREX_GPU_HOST_DEVICE inline
311  RealVect operator* (Real s) const noexcept;
312 
314 
317  AMREX_GPU_HOST_DEVICE inline
318  RealVect& operator/= (Real s) noexcept;
319 
321 
324  AMREX_GPU_HOST_DEVICE inline
325  RealVect& operator/= (const RealVect& p) noexcept;
326 
327 //XXX ///
328 //XXX /**
329 //XXX Returns component-wise quotient of this RealVect by argument.
330 //XXX */
331 //XXX RealVect operator/ (const RealVect& p) const;
332 
334 
338  AMREX_GPU_HOST_DEVICE inline
339  RealVect operator/ (Real s) const noexcept;
340 
342 
345  AMREX_GPU_HOST_DEVICE inline
346  RealVect& scale (Real s) noexcept;
347 
349 
353  [[nodiscard]] AMREX_GPU_HOST_DEVICE inline
354  IntVect floor () const noexcept;
355 
357 
361  [[nodiscard]] AMREX_GPU_HOST_DEVICE inline
362  IntVect ceil () const noexcept;
363 
365 
369  [[nodiscard]] AMREX_GPU_HOST_DEVICE inline
370  IntVect round () const noexcept;
371 
378 
380 
384  AMREX_GPU_HOST_DEVICE inline
385  RealVect& min (const RealVect& p) noexcept;
386 
388 
392  friend AMREX_GPU_HOST_DEVICE inline
393  RealVect min (const RealVect& p1, const RealVect& p2) noexcept;
394 
396 
400  AMREX_GPU_HOST_DEVICE inline
401  RealVect& max (const RealVect& p) noexcept;
402 
404 
408  friend AMREX_GPU_HOST_DEVICE inline
409  RealVect max (const RealVect& p1, const RealVect& p2) noexcept;
410 
417 
419 
422  AMREX_GPU_HOST_DEVICE inline
423  RealVect operator+ () const noexcept;
424 
426 
429  AMREX_GPU_HOST_DEVICE inline
430  RealVect operator- () const noexcept;
431 
433 
436  [[nodiscard]] AMREX_GPU_HOST_DEVICE inline
437  Real sum () const noexcept;
438 
440 
443  [[nodiscard]] AMREX_GPU_HOST_DEVICE inline
444  Real vectorLength() const noexcept;
445 
447 
450  [[nodiscard]] AMREX_GPU_HOST_DEVICE inline
451  Real radSquared() const noexcept;
452 
454 
457  [[nodiscard]] AMREX_GPU_HOST_DEVICE inline
458  Real product () const noexcept;
459 
461 
465  [[nodiscard]] AMREX_GPU_HOST_DEVICE inline
466  int minDir(const bool& a_doAbs) const noexcept;
467 
469 
473  [[nodiscard]] AMREX_GPU_HOST_DEVICE inline
474  int maxDir(const bool& a_doAbs) const noexcept;
475 
482 
484 
487  [[nodiscard]] AMREX_GPU_HOST_DEVICE
488  const Real* dataPtr() const noexcept { return vect; }
489 
491 
495  Real* dataPtr() noexcept { return vect; }
496 
503 
505 
516  friend AMREX_GPU_HOST_DEVICE
517  RealVect BASISREALV(int dir) noexcept;
518 
520 
523  static AMREX_EXPORT const RealVect Zero;
524 
526 
529  static AMREX_EXPORT const RealVect Unit;
530 
537 
539 
543  static constexpr RealVect TheZeroVector () noexcept {
544  return RealVect(0.);
545  }
546 
551  static constexpr RealVect TheUnitVector () noexcept {
552  return RealVect(1.);
553  }
554 
561 
563 
567  friend AMREX_GPU_HOST_DEVICE
568  RealVect operator+ (Real s, const RealVect& p) noexcept;
569 
571 
574  friend AMREX_GPU_HOST_DEVICE
575  RealVect operator- (Real s, const RealVect& p) noexcept;
576 
578 
582  friend AMREX_GPU_HOST_DEVICE
583  RealVect operator* (Real s, const RealVect& p) noexcept;
585 
589  friend AMREX_GPU_HOST_DEVICE
590  RealVect operator/ (Real s, const RealVect& p) noexcept;
591 
593 
596  friend AMREX_GPU_HOST_DEVICE
597  RealVect operator+ (const RealVect& s, const RealVect& p) noexcept;
598 
600 
603  friend AMREX_GPU_HOST_DEVICE
604  RealVect operator- (const RealVect& s, const RealVect& p) noexcept;
605 
607 
610  friend AMREX_GPU_HOST_DEVICE
611  RealVect operator* (const RealVect& s, const RealVect& p) noexcept;
613 
616  friend AMREX_GPU_HOST_DEVICE
617  RealVect operator/ (const RealVect& s, const RealVect& p) noexcept;
618 
620 
624  friend inline AMREX_GPU_HOST_DEVICE
625  RealVect scale (const RealVect& p, Real s) noexcept;
626 
630 
633  friend std::ostream& operator<< (std::ostream& ostr, const RealVect& p);
634 
635  friend std::istream& operator>> (std::istream& is, RealVect& iv);
636 
637 protected:
638 
642  Real vect[SpaceDim] = {AMREX_D_DECL(Real(0.),Real(0.),Real(0.))};
643 
644 };
645 
647 inline
648 RealVect&
649 RealVect::operator-= (Real s) noexcept
650 {
651  AMREX_D_EXPR(vect[0] -= s, vect[1] -= s, vect[2] -= s);
652  return *this;
653 }
654 
656 inline
657 RealVect&
658 RealVect::operator*= (Real s) noexcept
659 {
660  AMREX_D_EXPR(vect[0] *= s, vect[1] *= s, vect[2] *= s);
661  return *this;
662 }
663 
665 inline
666 RealVect&
667 RealVect::operator-= (const RealVect& p) noexcept
668 {
669  AMREX_D_EXPR(vect[0] -= p[0], vect[1] -= p[1], vect[2] -= p[2]);
670 
671  return *this;
672 }
673 
675 inline
676 RealVect
677 RealVect::operator+ () const noexcept
678 {
679  return RealVect(*this);
680 }
681 
683 inline
684 RealVect
685 RealVect::operator- () const noexcept
686 {
687  return RealVect(AMREX_D_DECL(-vect[0], -vect[1], -vect[2]));
688 }
689 
691 inline
692 RealVect&
693 RealVect::scale (Real s) noexcept
694 {
695  AMREX_D_EXPR(vect[0] *= s, vect[1] *= s, vect[2] *= s);
696  return *this;
697 }
698 
700 inline
701 IntVect
702 RealVect::floor () const noexcept
703 {
704  return IntVect(AMREX_D_DECL(static_cast<int>(std::floor(vect[0])),
705  static_cast<int>(std::floor(vect[1])),
706  static_cast<int>(std::floor(vect[2]))));
707 }
708 
710 inline
711 IntVect
712 RealVect::ceil () const noexcept
713 {
714  return IntVect(AMREX_D_DECL(static_cast<int>(std::ceil(vect[0])),
715  static_cast<int>(std::ceil(vect[1])),
716  static_cast<int>(std::ceil(vect[2]))));
717 }
718 
720 inline
721 IntVect
722 RealVect::round () const noexcept
723 {
724  return IntVect(AMREX_D_DECL(static_cast<int>(std::round(vect[0])),
725  static_cast<int>(std::round(vect[1])),
726  static_cast<int>(std::round(vect[2]))));
727 }
728 
730 inline
731 Real
732 RealVect::sum () const noexcept
733 {
734  return AMREX_D_TERM(vect[0], + vect[1], + vect[2]);
735 }
736 
738 inline
739 Real
740 RealVect::vectorLength () const noexcept
741 {
742  Real len = this->radSquared();
743  len = std::sqrt(len);
744  return len;
745 }
746 
748 inline
749 Real
750 RealVect::radSquared() const noexcept
751 {
752  return AMREX_D_TERM(vect[0]*vect[0],
753  + vect[1]*vect[1],
754  + vect[2]*vect[2]);
755 }
756 
758 inline
759 Real
760 RealVect::product () const noexcept
761 {
762  return AMREX_D_TERM(vect[0], * vect[1], * vect[2]);
763 }
764 
766 inline
767 RealVect
768 scale (const RealVect& p,
769  Real s) noexcept
770 {
771  return RealVect(AMREX_D_DECL(s * p[0], s * p[1], s * p[2]));
772 }
773 
775 inline
776 bool
777 RealVect::operator< (const RealVect& p) const noexcept
778 {
779  return AMREX_D_TERM(vect[0] < p[0], && vect[1] < p[1], && vect[2] < p[2]);
780 }
781 
783 inline
784 bool
785 RealVect::operator<= (const RealVect& p) const noexcept
786 {
787  return AMREX_D_TERM(vect[0] <= p[0], && vect[1] <= p[1], && vect[2] <= p[2]);
788 }
789 
791 inline
792 bool
793 RealVect::operator> (const RealVect& p) const noexcept
794 {
795  return AMREX_D_TERM(vect[0] > p[0], && vect[1] > p[1], && vect[2] > p[2]);
796 }
797 
799 inline
800 bool
801 RealVect::operator>= (const RealVect& p) const noexcept
802 {
803  return AMREX_D_TERM(vect[0] >= p[0], && vect[1] >= p[1], && vect[2] >= p[2]);
804 }
805 
807 inline
808 RealVect&
809 RealVect::min (const RealVect& p) noexcept
810 {
811  AMREX_D_EXPR(vect[0] = amrex::min(vect[0], p.vect[0]),
812  vect[1] = amrex::min(vect[1], p.vect[1]),
813  vect[2] = amrex::min(vect[2], p.vect[2]));
814  return *this;
815 }
816 
818 inline
819 RealVect&
820 RealVect::max (const RealVect& p) noexcept
821 {
822  AMREX_D_EXPR(vect[0] = amrex::max(vect[0], p.vect[0]),
823  vect[1] = amrex::max(vect[1], p.vect[1]),
824  vect[2] = amrex::max(vect[2], p.vect[2]));
825  return *this;
826 }
827 
829 inline
830 RealVect
831 min (const RealVect& p1,
832  const RealVect& p2) noexcept
833 {
834  RealVect p(p1);
835  return p.min(p2);
836 }
837 
839 inline
840 RealVect
841 max (const RealVect& p1,
842  const RealVect& p2) noexcept
843 {
844  RealVect p(p1);
845  return p.max(p2);
846 }
847 
849 Real RealVect::dotProduct(const RealVect& a_rhs) const noexcept
850 {
851  return AMREX_D_TERM(vect[0]*a_rhs.vect[0], +
852  vect[1]*a_rhs.vect[1], +
853  vect[2]*a_rhs.vect[2]);
854 }
855 
856 #if (AMREX_SPACEDIM == 3)
858  RealVect RealVect::crossProduct(const RealVect& a_rhs) const noexcept
859  {
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]);
863  return tmp;
864  }
865 #endif
866 
868 RealVect&
869 RealVect::operator+= (Real s) noexcept
870 {
871  AMREX_D_EXPR(vect[0] += s, vect[1] += s, vect[2] += s);
872  return *this;
873 }
874 
876 RealVect&
877 RealVect::operator+= (const RealVect& p) noexcept
878 {
879  AMREX_D_EXPR(vect[0] += p[0], vect[1] += p[1], vect[2] += p[2]);
880  return *this;
881 }
882 
884 RealVect&
885 RealVect::operator*= (const RealVect &p) noexcept
886 {
887  AMREX_D_EXPR(vect[0] *= p[0], vect[1] *= p[1], vect[2] *= p[2]);
888  return *this;
889 }
890 
892 RealVect
893 RealVect::operator* (Real s) const noexcept
894 {
895  RealVect v(AMREX_D_DECL(vect[0]*s, vect[1]*s, vect[2]*s));
896  return v;
897 }
898 
900 RealVect
901 RealVect::operator- (Real s) const noexcept
902 {
903  RealVect v(AMREX_D_DECL(vect[0]-s, vect[1]-s, vect[2]-s));
904  return v;
905 }
906 
908 RealVect
909 RealVect::operator+ (Real s) const noexcept
910 {
911  RealVect v(AMREX_D_DECL(vect[0]+s, vect[1]+s, vect[2]+s));
912  return v;
913 }
914 
916 RealVect&
917 RealVect::operator/= (Real s) noexcept
918 {
919  AMREX_D_EXPR(vect[0] /= s, vect[1] /= s, vect[2] /= s);
920  return *this;
921 }
922 
924 RealVect&
925 RealVect::operator/= (const RealVect& p) noexcept
926 {
927  AMREX_D_EXPR(vect[0] /= p[0], vect[1] /= p[1], vect[2] /= p[2]);
928  return *this;
929 }
930 
932 RealVect
933 RealVect::operator/ (Real s) const noexcept
934 {
935  RealVect result( AMREX_D_DECL( vect[0] / s, vect[1] / s, vect[2] / s));
936  return result ;
937 }
938 
940 int
941 RealVect::minDir(const bool& a_doAbs) const noexcept
942 {
943  int mDir = 0;
944  for (int idir=0; idir<SpaceDim; idir++)
945  {
946  if (a_doAbs)
947  {
948  if (std::abs(vect[idir]) < std::abs(vect[mDir]))
949  {
950  mDir = idir;
951  }
952  }
953  else
954  {
955  if (vect[idir] < vect[mDir])
956  {
957  mDir = idir;
958  }
959  }
960  }
961  return mDir;
962 }
963 
965 int
966 RealVect::maxDir(const bool& a_doAbs) const noexcept
967 {
968  int mDir = 0;
969  for (int idir=0; idir<SpaceDim; idir++)
970  {
971  if (a_doAbs)
972  {
973  if (std::abs(vect[idir]) > std::abs(vect[mDir]))
974  {
975  mDir = idir;
976  }
977  }
978  else
979  {
980  if (vect[idir] > vect[mDir])
981  {
982  mDir = idir;
983  }
984  }
985  }
986  return mDir;
987 }
988 
990 RealVect
991 BASISREALV (int dir) noexcept
992 {
993  AMREX_ASSERT(dir >= 0 && dir < SpaceDim);
994  RealVect tmp(AMREX_D_DECL(0.,0.,0.));
995  tmp.vect[dir] = 1;
996  return tmp;
997 }
998 
1000 RealVect
1001 operator/ (Real s,
1002  const RealVect& p) noexcept
1003 {
1004  return RealVect(AMREX_D_DECL(s/p[0], s/p[1], s/p[2]));
1005 }
1006 
1007 AMREX_GPU_HOST_DEVICE inline
1008 RealVect
1009 operator+ (Real s,
1010  const RealVect& p) noexcept
1011 {
1012  return RealVect(AMREX_D_DECL(p[0] + s, p[1] + s, p[2] + s));
1013 }
1014 
1015 AMREX_GPU_HOST_DEVICE inline
1016 RealVect
1017 operator- (Real s,
1018  const RealVect& p) noexcept
1019 {
1020  return RealVect(AMREX_D_DECL(s - p[0], s - p[1], s - p[2]));
1021 }
1022 
1023 AMREX_GPU_HOST_DEVICE inline
1024 RealVect
1025 operator* (Real s,
1026  const RealVect& p) noexcept
1027 {
1028  return RealVect(AMREX_D_DECL(s * p[0], s * p[1], s * p[2]));
1029 }
1030 
1031 AMREX_GPU_HOST_DEVICE inline
1032 RealVect
1034  const RealVect& p) noexcept
1035 {
1036  return RealVect(AMREX_D_DECL(s[0] / p[0], s[1] /p[1], s[2] / p[2]));
1037 }
1038 
1039 AMREX_GPU_HOST_DEVICE inline
1040 RealVect
1042  const RealVect& p) noexcept
1043 {
1044  return RealVect(AMREX_D_DECL(p[0] + s[0], p[1] +s[1], p[2] + s[2]));
1045 }
1046 
1047 AMREX_GPU_HOST_DEVICE inline
1048 RealVect
1050  const RealVect& p) noexcept
1051 {
1052  return RealVect(AMREX_D_DECL(s[0] - p[0], s[1] - p[1], s[2] - p[2]));
1053 }
1054 
1055 AMREX_GPU_HOST_DEVICE inline
1056 RealVect
1058  const RealVect& p) noexcept
1059 {
1060  return RealVect(AMREX_D_DECL(p[0] * s[0], p[1] *s[1], p[2] * s[2]));
1061 }
1062 
1063 }
1064 
1065 #endif
#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