Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
face.cpp File Reference
#include <stdio.h>
#include "makeflo.h"
#include "face.h"
Include dependency graph for face.cpp:

Go to the source code of this file.

Classes

class  facet
 

Functions

static int firstSet (const blockLoc &l)
 
static int findOther (int a, int b)
 
static void matchOrientations (orient_t &orient, const blockLoc &sX, const blockLoc &sY, const blockLoc &dX, const blockLoc &dY)
 
bool isDisjoint (const blockSpan &a, const blockSpan &b)
 

Function Documentation

static int findOther ( int  a,
int  b 
)
static

Definition at line 83 of file face.cpp.

Referenced by face::face(), matchOrientations(), and face::nodeForCoord().

84 {
85  int ret=0;
86  while (a==ret || b==ret)
87  ret++; //Keep looking
88  return ret; //Found it!
89 }

Here is the caller graph for this function:

static int firstSet ( const blockLoc l)
static

Definition at line 70 of file face.cpp.

References i.

Referenced by matchOrientations().

71 {
72  for (int i=0;i<3;i++)
73  if (l[i]!=0)
74  return i;
75  //If we get here, all coordinates are zero-- very bad
76  fprintf(stderr,"ERROR! %s:%d> Orientation vector all zeros!\n",
77  __FILE__,__LINE__);
78  abort();
79  return -1;
80 }
blockLoc i
Definition: read.cpp:79

Here is the caller graph for this function:

bool isDisjoint ( const blockSpan a,
const blockSpan b 
)

Definition at line 167 of file face.cpp.

References blockSpan::end, and blockSpan::start.

Referenced by face::buildPatches().

167  {
168  for (int axis=0;axis<2;axis++) {
169  if (a.start[axis]>=b.end[axis]-1) return true;
170  if (b.start[axis]>=a.end[axis]-1) return true;
171  }
172  return false;//No separating axis-- must have a shared point
173 }
blockLoc start
Definition: gridutil.h:155
blockLoc end
Definition: gridutil.h:156

Here is the caller graph for this function:

static void matchOrientations ( orient_t orient,
const blockLoc sX,
const blockLoc sY,
const blockLoc dX,
const blockLoc dY 
)
static

Definition at line 95 of file face.cpp.

References findOther(), and firstSet().

Referenced by face::buildPatches().

98 {
99  //Compute the block orientations in the face X and Y axes
100  int sOX=firstSet(sX),sOY=firstSet(sY);
101  int dOX=firstSet(dX),dOY=firstSet(dY);
102 
103  //Match up the orientations along the face
104  orient[sOX]=dOX;
105  orient[sOY]=dOY;
106 
107  //The remaining orientation is found by the
108  // process of elimination
109  orient[findOther(sOX,sOY)]=findOther(dOX,dOY);
110 }
static int firstSet(const blockLoc &l)
Definition: face.cpp:70
static int findOther(int a, int b)
Definition: face.cpp:83

Here is the call graph for this function:

Here is the caller graph for this function: