Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
blockSpan Class Reference

#include <gridutil.h>

Collaboration diagram for blockSpan:

Public Member Functions

 blockSpan ()
 
 blockSpan (const blockLoc &s, const blockLoc &e)
 
blockDim getDim (void) const
 
void orient (void)
 
void orient (blockSpan &dest, const orient_t &src2dest)
 
int getFlatAxis (void) const
 
int getFace (void) const
 
bool contains (const blockLoc &l) const
 
bool hasArea (void) const
 
blockSpan operator+ (const blockLoc &l) const
 
blockSpan operator- (const blockLoc &l) const
 
bool operator== (const blockSpan &o) const
 
bool operator!= (const blockSpan &o) const
 

Public Attributes

blockLoc start
 
blockLoc end
 

Static Private Member Functions

static void swapSpan (int &start, int &end)
 

Detailed Description

Definition at line 145 of file gridutil.h.

Constructor & Destructor Documentation

blockSpan ( )
inline

Definition at line 158 of file gridutil.h.

Referenced by operator+(), and operator-().

158 { }

Here is the caller graph for this function:

blockSpan ( const blockLoc s,
const blockLoc e 
)
inline

Definition at line 159 of file gridutil.h.

160  :start(s), end(e) { }
blockLoc start
Definition: gridutil.h:155
blockLoc end
Definition: gridutil.h:156

Member Function Documentation

bool contains ( const blockLoc l) const
inline

Definition at line 199 of file gridutil.h.

References end, and start.

200  {
201  for (int axis=0;axis<3;axis++)
202  if (!(start[axis]<=l[axis] && l[axis]<end[axis]))
203  return false;
204  return true;
205  }
blockLoc start
Definition: gridutil.h:155
blockLoc end
Definition: gridutil.h:156
blockDim getDim ( void  ) const
inline

Definition at line 162 of file gridutil.h.

References end, and start.

Referenced by block::subBlock().

162 { return end-start; }
blockLoc start
Definition: gridutil.h:155
blockLoc end
Definition: gridutil.h:156

Here is the caller graph for this function:

int getFace ( void  ) const
inline

Definition at line 191 of file gridutil.h.

References getFlatAxis(), and start.

Referenced by block::addBC(), writeSpan(), and internalBCpatch::writeTop().

191  {
192  int axis=getFlatAxis();
193  if (axis==-1) return -1;
194  if (start[axis]==0) return axis;
195  else return axis+3;
196  }
blockLoc start
Definition: gridutil.h:155
int getFlatAxis(void) const
Definition: gridutil.h:184

Here is the call graph for this function:

Here is the caller graph for this function:

int getFlatAxis ( void  ) const
inline

Definition at line 184 of file gridutil.h.

References end, and start.

Referenced by getFace().

184  {
185  for (int axis=0;axis<3;axis++)
186  if (start[axis]+1==end[axis])
187  return axis;
188  return -1;
189  }
blockLoc start
Definition: gridutil.h:155
blockLoc end
Definition: gridutil.h:156

Here is the caller graph for this function:

bool hasArea ( void  ) const
inline

Definition at line 208 of file gridutil.h.

References end, and start.

208  {
209  int nThick=0;
210  for (int axis=0;axis<3;axis++) {
211  if (start[axis]>=end[axis])
212  return false; //A completely empty block
213  if (start[axis]<end[axis]-1)
214  nThick++; //Some nonzero thickness on this axis
215  }
216  return 2==nThick;
217  }
blockLoc start
Definition: gridutil.h:155
blockLoc end
Definition: gridutil.h:156
bool operator!= ( const blockSpan o) const
inline

Definition at line 226 of file gridutil.h.

References end, and start.

227  {return start!=o.start || end!=o.end;}
blockLoc start
Definition: gridutil.h:155
blockLoc end
Definition: gridutil.h:156
blockSpan operator+ ( const blockLoc l) const
inline

Definition at line 219 of file gridutil.h.

References blockSpan(), end, and start.

220  {return blockSpan(start+l,end+l);}
blockLoc start
Definition: gridutil.h:155
blockLoc end
Definition: gridutil.h:156
blockSpan()
Definition: gridutil.h:158

Here is the call graph for this function:

blockSpan operator- ( const blockLoc l) const
inline

Definition at line 221 of file gridutil.h.

References blockSpan(), end, and start.

222  {return blockSpan(start-l,end-l);}
blockLoc start
Definition: gridutil.h:155
blockLoc end
Definition: gridutil.h:156
blockSpan()
Definition: gridutil.h:158

Here is the call graph for this function:

bool operator== ( const blockSpan o) const
inline

Definition at line 224 of file gridutil.h.

References end, and start.

225  {return start==o.start && end==o.end;}
blockLoc start
Definition: gridutil.h:155
blockLoc end
Definition: gridutil.h:156
void orient ( void  )
inline

Definition at line 165 of file gridutil.h.

References end, start, and swapSpan().

Referenced by findPartner().

165  {
166  for (int axis=0;axis<3;axis++) {
167  if (start[axis]>=end[axis]) {
168  swapSpan(start[axis],end[axis]);
169  }
170  }
171  }
blockLoc start
Definition: gridutil.h:155
blockLoc end
Definition: gridutil.h:156
static void swapSpan(int &start, int &end)
Definition: gridutil.h:147

Here is the call graph for this function:

Here is the caller graph for this function:

void orient ( blockSpan dest,
const orient_t src2dest 
)
inline

Definition at line 173 of file gridutil.h.

References end, start, and swapSpan().

173  {
174  for (int axis=0;axis<3;axis++) {
175  if (start[axis]>=end[axis]) {
176  swapSpan(start[axis],end[axis]);
177  int dAxis=src2dest[axis];
178  swapSpan(dest.start[dAxis],dest.end[dAxis]);
179  }
180  }
181  }
blockLoc start
Definition: gridutil.h:155
blockLoc end
Definition: gridutil.h:156
static void swapSpan(int &start, int &end)
Definition: gridutil.h:147

Here is the call graph for this function:

static void swapSpan ( int &  start,
int &  end 
)
inlinestaticprivate

Definition at line 147 of file gridutil.h.

References end, and start.

Referenced by orient().

147  {
148  end--;
149  int tmp=start;
150  start=end;
151  end=tmp;
152  end++;
153  }
blockLoc start
Definition: gridutil.h:155
blockLoc end
Definition: gridutil.h:156

Here is the caller graph for this function:

Member Data Documentation


The documentation for this class was generated from the following file: