35 #include "NamespaceHeader.H" 72 D_EXPR6(vect[0]=vi[0], vect[1]=vi[1], vect[2] = vi[2],
73 vect[3]=vi[3], vect[4]=vi[4], vect[5] = vi[5]);
90 int l,
int m,
int n));
97 explicit IntVect (
const int* a);
123 int& operator[] (
int i);
130 int operator[] (
int i)
const;
151 const int* getVect ()
const;
157 const int* dataPtr()
const;
177 bool operator== (
const IntVect& p)
const;
184 bool operator!= (
const IntVect& p)
const;
204 bool operator<= (
const IntVect& p)
const;
214 bool operator> (
const IntVect& p)
const;
225 bool operator>= (
const IntVect& p)
const;
241 bool lexLT (
const IntVect& s)
const;
257 bool lexGT (
const IntVect& s)
const;
288 int product ()
const;
477 int retval = vect[0];
478 for(
int idir = 1; idir <
SpaceDim; idir++)
480 retval =
Max(retval, vect[idir]);
488 int retval = vect[0];
489 for(
int idir = 1; idir <
SpaceDim; idir++)
491 retval =
Min(retval, vect[idir]);
609 void printOn (std::ostream& os)
const;
621 void dumpOn (std::ostream& os)
const;
627 friend std::ostream&
operator<< (std::ostream& os,
634 friend std::istream&
operator>> (std::istream& os,
668 static int InitStatics();
674 inline uint64_t hash(
const IntVect& origin,
const IntVect& blockingFactor)
const;
679 for (
int ii = 0; ii < DIM; ii++)
685 operator Proto::Point()
const 687 return Proto::Point(vect);
700 friend class BLfacade::IntVect;
711 static const uint32_t morton256_x[256];
712 static const uint32_t morton256_y[256];
713 static const uint32_t morton256_z[256];
716 #include "NamespaceFooter.H" 719 namespace std {
template <>
inline bool less<CH_XD::IntVect>::operator()(
const CH_XD::IntVect& a,
const CH_XD::IntVect& b)
const {
return a.lexLT(b);}
737 void linearIn(CH_XDIR::IntVect& a_iv,
const void* a_inBuf);
741 void linearOut(
void* a_outBuf,
const CH_XDIR::IntVect& a_iv);
761 #include "NamespaceHeader.H" 792 int l,
int m,
int n))
794 D_EXPR6(vect[0] = i, vect[1] = j, vect[2] = k, vect[3] = l, vect[4] = m, vect[5] = n);
800 D_EXPR6(vect[0] = a[0], vect[1] = a[1], vect[2] = a[2],
801 vect[3] = a[3], vect[4] = a[4], vect[5] = a[5]);
871 return D_TERM6(vect[0] == p[0], && vect[1] == p[1], && vect[2] == p[2],
872 && vect[3] == p[3], && vect[4] == p[4], && vect[5] == p[5]);
879 return D_TERM6(vect[0] != p[0], || vect[1] != p[1], || vect[2] != p[2],
880 || vect[3] != p[3], || vect[4] != p[4], || vect[5] != p[5]);
887 return D_TERM6(vect[0] < p[0], && vect[1] < p[1], && vect[2] < p[2],
888 && vect[3] < p[3], && vect[4] < p[4], && vect[5] < p[5]);
895 return D_TERM6(vect[0] <= p[0], && vect[1] <= p[1], && vect[2] <= p[2],
896 && vect[3] <= p[3], && vect[4] <= p[4], && vect[5] <= p[5]);
903 return D_TERM6(vect[0] > p[0], && vect[1] > p[1], && vect[2] > p[2],
904 && vect[3] > p[3], && vect[4] > p[4], && vect[5] > p[5]);
911 return D_TERM6(vect[0] >= p[0], && vect[1] >= p[1], && vect[2] >= p[2],
912 && vect[3] >= p[3], && vect[4] >= p[4], && vect[5] >= p[5]);
920 if (vect[0] < s[0])
return true;
922 if (vect[0] > s[0])
return false;
923 if (vect[1] < s[1])
return true;
926 if (vect[1] > s[1])
return false;
927 if (vect[2] < s[2])
return true;
930 if (vect[2] > s[2])
return false;
931 if (vect[3] < s[3])
return true;
934 if (vect[3] > s[3])
return false;
935 if (vect[4] < s[4])
return true;
938 if (vect[4] > s[4])
return false;
939 if (vect[5] < s[5])
return true;
949 if (vect[0] > s[0])
return true;
951 if (vect[0] < s[0])
return false;
952 if (vect[1] > s[1])
return true;
955 if (vect[1] < s[1])
return false;
956 if (vect[2] > s[2])
return true;
959 if (vect[2] < s[2])
return false;
960 if (vect[3] > s[3])
return true;
963 if (vect[3] < s[3])
return false;
964 if (vect[4] > s[4])
return true;
967 if (vect[4] < s[4])
return false;
968 if (vect[5] > s[5])
return true;
986 -vect[3], -vect[4], -vect[5] ));
993 return D_TERM6(vect[0], + vect[1], + vect[2],
994 + vect[3], + vect[4], + vect[5]);
1001 return D_TERM6(vect[0], * vect[1], * vect[2],
1002 * vect[3], * vect[4], * vect[5]);
1009 D_EXPR6(vect[0] += s, vect[1] += s, vect[2] += s,
1010 vect[3] += s, vect[4] += s, vect[5] += s);
1018 D_EXPR6(vect[0] += p[0], vect[1] += p[1], vect[2] += p[2],
1019 vect[3] += p[3], vect[4] += p[4], vect[5] += p[5]);
1027 D_EXPR6(vect[0] *= s, vect[1] *= s, vect[2] *= s,
1028 vect[3] *= s, vect[4] *= s, vect[5] *= s);
1036 D_EXPR6(vect[0] *= p[0], vect[1] *= p[1], vect[2] *= p[2],
1037 vect[3] *= p[3], vect[4] *= p[4], vect[5] *= p[5]);
1045 D_EXPR6(vect[0] /= s, vect[1] /= s, vect[2] /= s,
1046 vect[3] /= s, vect[4] /= s, vect[5] /= s);
1054 D_EXPR6(vect[0] /= p[0], vect[1] /= p[1], vect[2] /= p[2],
1055 vect[3] /= p[3], vect[4] /= p[4], vect[5] /= p[5]);
1063 D_EXPR6(vect[0] -= s, vect[1] -= s, vect[2] -= s,
1064 vect[3] -= s, vect[4] -= s, vect[5] -= s);
1072 D_EXPR6(vect[0] -= p[0], vect[1] -= p[1], vect[2] -= p[2],
1073 vect[3] -= p[3], vect[4] -= p[4], vect[5] -= p[5]);
1081 return IntVect(
D_DECL6(vect[0] + p[0], vect[1] + p[1], vect[2] + p[2],
1082 vect[3] + p[3], vect[4] + p[4], vect[5] + p[5]));
1090 vect[3] + s, vect[4] + s, vect[5] + s));
1097 return IntVect(
D_DECL6(vect[0] - p[0], vect[1] - p[1], vect[2] - p[2],
1098 vect[3] - p[3], vect[4] - p[4], vect[5] - p[5]));
1106 vect[3] - s, vect[4] - s, vect[5] - s));
1113 return IntVect(
D_DECL6(vect[0] * p[0], vect[1] * p[1], vect[2] * p[2],
1114 vect[3] * p[3], vect[4] * p[4], vect[5] * p[5]));
1122 vect[3] * s, vect[4] * s, vect[5] * s));
1129 return IntVect(
D_DECL6(vect[0] / p[0], vect[1] / p[1], vect[2] / p[2],
1130 vect[3] / p[3], vect[4] / p[4], vect[5] / p[5]));
1138 vect[3] / s, vect[4] / s, vect[5] / s));
1145 D_EXPR6(vect[0] =
Min(vect[0], p.
vect[0]),
1146 vect[1] =
Min(vect[1], p.
vect[1]),
1147 vect[2] =
Min(vect[2], p.
vect[2]),
1148 vect[3] =
Min(vect[3], p.
vect[3]),
1149 vect[4] =
Min(vect[4], p.
vect[4]),
1150 vect[5] =
Min(vect[5], p.
vect[5]));
1158 D_EXPR6(vect[0] =
Max(vect[0], p.
vect[0]),
1159 vect[1] =
Max(vect[1], p.
vect[1]),
1160 vect[2] =
Max(vect[2], p.
vect[2]),
1161 vect[3] =
Max(vect[3], p.
vect[3]),
1162 vect[4] =
Max(vect[4], p.
vect[4]),
1163 vect[5] =
Max(vect[5], p.
vect[5]));
1171 D_EXPR6(vect[0] *= s, vect[1] *= s, vect[2] *= s,
1172 vect[3] *= s, vect[4] *= s, vect[5] *= s);
1182 vect[idir] = -vect[idir] + 2*ref_ix;
1208 D_EXPR6(vect[0] += s, vect[1] += s, vect[2] += s,
1209 vect[3] += s, vect[4] += s, vect[5] += s);
1219 p[3] + s, p[4] + s, p[5] + s));
1228 s - p[3], s - p[4], s - p[5]));
1237 s * p[3], s * p[4], s * p[5]));
1246 s * p[3], s * p[4], s * p[5]));
1254 abs(p[3]), abs(p[4]), abs(p[5])));
1262 p[3] + s, p[4] + s, p[5] + s));
1301 b.
vect[idir] = -b.
vect[idir] + 2*ref_ix;
1317 (p.
vect[5]<0) ? -abs(p.
vect[5]+1)/s-1 : p.
vect[5]/s ));
1343 vect[i] = ((vect[i]<0) ? -abs(vect[i]+1)/s-1 : vect[i]/s);
1354 const int s = p.
vect[i];
1355 vect[i] = ((vect[i]<0) ? -abs(vect[i]+1)/s-1 : vect[i]/s);
1363 uint64_t answer = 0;
1364 #if CH_SPACEDIM >= 4 1369 for(
int jdir = 0; jdir < idir; jdir++)
1371 bfact *= blockingFactor[jdir];
1373 answer += origin[idir]*bfact;
1376 uint32_t z=0, y=0, x;
1378 z = (vect[2]-origin[2])/blockingFactor[2];
1381 y = (vect[1]-origin[1])/blockingFactor[1];
1383 x = (vect[0]-origin[0])/blockingFactor[0];
1384 answer = morton256_z[(z >> 16) & 0xFF ] |
1385 morton256_y[(y >> 16) & 0xFF ] |
1386 morton256_x[(x >> 16) & 0xFF ];
1387 answer = answer << 48 | morton256_z[(z >> 8) & 0xFF ] |
1388 morton256_y[(y >> 8) & 0xFF ] |
1389 morton256_x[(x >> 8) & 0xFF ];
1390 answer = answer << 24 |
1391 morton256_z[(z) & 0xFF ] |
1392 morton256_y[(y) & 0xFF ] |
1393 morton256_x[(x) & 0xFF ];
1399 #include "NamespaceFooter.H" IntVect min(const IntVect &p1, const IntVect &p2)
Definition: IntVect.H:1267
IntVect & operator*=(int s)
Definition: IntVect.H:1025
#define D_DECL6(a, b, c, d, e, f)
Definition: CHArray.H:39
IntVect & min(const IntVect &p)
Definition: IntVect.H:1143
const int * getVect() const
Definition: IntVect.H:862
#define D_TERM6(a, b, c, d, e, f)
Definition: CHArray.H:40
static const size_t IntVectSize
Definition: IntVect.H:710
#define CH_SPACEDIM
Definition: SPACE.H:51
#define CH_assert(cond)
Definition: CHArray.H:37
IntVect & scale(int s)
Definition: IntVect.H:1169
IntVect scale(const IntVect &p, int s)
Definition: IntVect.H:1242
IntVect operator*(const IntVect &p) const
Definition: IntVect.H:1111
static size_t io_offset
Definition: IntVect.H:672
Definition: FaceIndex.H:28
int max() const
return the maximum value in the intvect
Definition: IntVect.H:475
IntVect operator*(int s, const IntVect &p)
Definition: IntVect.H:1233
static int s_dummyForIntVectH
Definition: IntVect.H:773
IntVect & operator/=(int s)
Definition: IntVect.H:1043
Definition: IntVect.H:719
IntVect max(const IntVect &p1, const IntVect &p2)
Definition: IntVect.H:1276
IntVect BASISV(int dir)
Definition: IntVect.H:1285
IntVect & operator-=(int s)
Definition: IntVect.H:1061
int linearSize(const CH_XDIR::IntVect &a_iv)
functions for linearization
bool operator<(const IntVect &p) const
Definition: IntVect.H:885
IntVect diagShift(const IntVect &p, int s)
Definition: IntVect.H:1259
const int SpaceDim
Definition: SPACE.H:38
void setVal(int i, int val)
Definition: IntVect.H:838
IntVect coarsen(const IntVect &p, int s)
Definition: IntVect.H:1307
std::ostream & operator<<(std::ostream &a_os, const IndexTM< T, N > &a_iv)
IntVect & shift(int coord, int s)
Definition: IntVect.H:1188
static const IntVect Unit
Definition: IntVect.H:663
bool operator==(const IntVect &p) const
Definition: IntVect.H:869
int vect[CH_SPACEDIM]
Definition: IntVect.H:705
std::istream & operator>>(std::istream &a_os, IndexTM< T, N > &a_iv)
bool operator<(const FaceIndex &f1, const FaceIndex &f2)
Definition: FaceIndex.H:212
void linearOut(void *a_outBuf, const CH_XDIR::IntVect &a_iv)
functions for linearization
IntVect & reflect(int ref_ix, int idir)
Definition: IntVect.H:1178
IntVect & max(const IntVect &p)
Definition: IntVect.H:1156
void linearIn(CH_XDIR::IntVect &a_iv, const void *a_inBuf)
functions for linearization
IntVect operator/(const IntVect &p) const
Definition: IntVect.H:1127
bool operator!=(const IntVect &p) const
Definition: IntVect.H:877
IntVect & operator+=(int s)
Definition: IntVect.H:1007
int & operator[](const int i)
Definition: CHArray.H:56
IntVect(const Vector< int > &vi)
Definition: IntVect.H:70
IntVect operator+() const
Definition: IntVect.H:976
static const IntVect Zero
Definition: IntVect.H:658
C::self_type operator/(const C &, const C &)
Definition: GenericArithmeticI.H:132
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:469
IntVect & diagShift(int s)
Definition: IntVect.H:1206
IntVect reflect(const IntVect &a, int ref_ix, int idir)
Definition: IntVect.H:1295
int product() const
Definition: CHArray.H:64
const IntVect absolute(const IntVect &p)
Definition: IntVect.H:1251
bool operator<=(const IntVect &p) const
Definition: IntVect.H:893
bool operator>(const IntVect &p) const
Definition: IntVect.H:901
Handle to a particular group in an HDF file.
Definition: CH_HDF5.H:294
T Min(const T &a_a, const T &a_b)
Definition: Misc.H:26
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
IntVect operator-(int s, const IntVect &p)
Definition: IntVect.H:1224
int sum() const
Definition: IntVect.H:991
Volume of Fluid Index.
Definition: VolIndex.H:31
const int * dataPtr() const
Definition: IntVect.H:848
T Max(const T &a_a, const T &a_b)
Definition: Misc.H:39
int min() const
return the minimum value in the intvect
Definition: IntVect.H:486
IntVect & coarsen(const IntVect &p)
Definition: IntVect.H:1349
IntVect operator-() const
Definition: IntVect.H:983
bool lexGT(const IntVect &s) const
Definition: IntVect.H:947
IntVect operator+(int s, const IntVect &p)
Definition: IntVect.H:1215
IntVect copy() const
Definition: IntVect.H:107
uint64_t hash(const IntVect &origin, const IntVect &blockingFactor) const
Definition: IntVect.H:1360
bool lexLT(const IntVect &s) const
Definition: IntVect.H:917
IntVect()
Definition: IntVect.H:67
bool operator>=(const IntVect &p) const
Definition: IntVect.H:909