58 #ifndef __CSAR_GRIDUTIL_H
59 #define __CSAR_GRIDUTIL_H
98 :
i(i_),
j(j_),
k(k_) { }
102 {
i+=b.
i;
j+=b.
j;
k+=b.
k;
return *
this; }
110 {
return i==o.
i &&
j==o.
j &&
k==o.
k; }
112 {
return i!=o.
i ||
j!=o.
j ||
k!=o.
k; }
130 {
return xi+
i*(xj+
j*xk); }
134 {
return c_index(l[0],l[1],l[2]); }
166 for (
int axis=0;axis<3;axis++) {
174 for (
int axis=0;axis<3;axis++) {
177 int dAxis=src2dest[axis];
185 for (
int axis=0;axis<3;axis++)
193 if (axis==-1)
return -1;
194 if (
start[axis]==0)
return axis;
201 for (
int axis=0;axis<3;axis++)
202 if (!(
start[axis]<=l[axis] && l[axis]<
end[axis]))
210 for (
int axis=0;axis<3;axis++) {
230 #define BLOCKSPAN_FOR(i,span) \
231 blockSpan loop_iter=span; \
232 for (i[2]=loop_iter.start[2];i[2]<loop_iter.end[2];i[2]++) \
233 for (i[1]=loop_iter.start[1];i[1]<loop_iter.end[1];i[1]++) \
234 for (i[0]=loop_iter.start[0];i[0]<loop_iter.end[0];i[0]++)
245 const char *
read(
const char *gridFile);
bool operator!=(const blockSpan &o) const
int operator[](int d) const
blockSpan operator-(const blockLoc &l) const
friend blockLoc operator*(int k, const blockLoc &a)
blockLoc & operator+=(const blockLoc &b)
bool operator==(const blockLoc &o) const
blockLoc operator+(const blockLoc &b) const
blockSpan(const blockLoc &s, const blockLoc &e)
blockDim getDim(void) const
blockLoc(int i_, int j_, int k_)
int operator[](int d) const
orient_t inverse(void) const
virtual vector3d * allocateBlock(blockDim &dim)
virtual void freeBlock(vector3d *blk)
blockDim operator-(const blockLoc &b) const
int c_index(int xi, int xj, int xk) const
static void swapSpan(int &start, int &end)
int getFlatAxis(void) const
const int & operator[](int i) const
const char * read(const char *gridFile)
void orient(blockSpan &dest, const orient_t &src2dest)
int operator[](const blockLoc &l) const
virtual const char * consume(const blockDim &dim, vector3d *locs)=0
bool operator!=(const blockLoc &o) const
bool operator==(const blockSpan &o) const
bool contains(const blockLoc &l) const
friend blockLoc operator*(const blockLoc &a, int k)
blockSpan operator+(const blockLoc &l) const
blockDim(int i_, int j_, int k_)