76 fprintf(stderr,
"ERROR! %s:%d> Orientation vector all zeros!\n",
86 while (a==ret || b==ret)
116 if (at[dir_z]!=
span.
start[dir_z])
return NULL;
124 if (
patches[i]->srcSpan.contains(at))
132 vector<externalBCpatch> &extBCs_,
int dir_x_,
int dir_y_,
134 :source(source_), extBCs(extBCs_), dir_x(dir_x_), dir_y(dir_y_),
152 fprintf(stderr,
"WARNING: multiply shared node %p: (%d,%d,%d) for block %d:",
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;
205 if (b[
x+bx*
y].isPatched()) {
206 fprintf(stderr,
"FATAL ERROR patching block %d> external boundary conditions overlap!\n",
220 if (dest==NULL)
return true;
231 for (
int y=0;
y<
ny;
y++)
232 for (
int x=0;
x<
nx;
x++) {
235 fprintf(stderr,
"ERROR! Face/node location disagreement!\n");
240 if (
nodes==NULL)
return;
251 b[x+bx*
y]=
facet(nbor,
this);
259 for (
unsigned int ep=0;ep<
patches.size();ep++) {
264 for (
unsigned int ec=0;ec<
extBCs.size();ec++) {
274 while (nPatched<nFacets) {
275 int startX=-1, startY=-1;
277 for (y=0;y<by && startY==-1;y++)
278 for (x=0;x<bx && startX==-1;x++)
279 if (!b[x+bx*y].isPatched()) {
284 const facet &destFacet=b[startX+bx*startY];
293 while (x<bx && b[x+bx*y].matches(destFacet) &&
300 fprintf(stderr,
"ERROR! Face of block %d is non-conformal at node (%d,%d,%d) of (%d,%d,%d)\n",1+
source->
getOriginalNumber(),badLoc[0],badLoc[1],badLoc[2],sz[0],sz[1],sz[2]);
305 for (y=startY;y<
by;y++) {
307 for (x=startX;x<endX;x++)
308 if (!(b[x+bx*y].matches(destFacet) &&
314 for (x=startX;x<endX;x++)
316 nPatched+=endX-startX;
327 #if 1 //Make sure new patch is disjoint from all old patches
328 for (
unsigned int otherP=0;otherP<
patches.size();otherP++)
330 fprintf(stderr,
"ERROR! Patches not disjoint!\n");
340 printf(
"Makeflo WARNING: Missing boundary condition (using zero) for original block %d,\n"
341 " split block %d, %s face, cells (%d,%d,%d) - (%d,%d,%d)\n",
345 srcSpan.
end[0],srcSpan.
end[1],srcSpan.
end[2]);
366 destSpan.
orient(srcSpan,dest2src);
378 fprintf(stderr,
"ERROR! Runaway patching loop (%s:%d)!\n",
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed by
bool isDisjoint(const blockSpan &a, const blockSpan &b)
int getOriginalNumber(void) const
face(block *source_, nodeMatcher &map, vector< externalBCpatch > &extBCs_, int dir_x_, int dir_y_, const blockSpan &span_)
void int int REAL REAL * y
void addFace(face *b, const blockLoc &l)
static void matchOrientations(orient_t &orient, const blockLoc &sX, const blockLoc &sY, const blockLoc &dX, const blockLoc &dY)
block * getBlock(void) const
static int firstSet(const blockLoc &l)
node * nodeForCoord(const blockLoc &at)
node * loc2node(const vector3d &loc)
face * getFace(void) const
int markPatched(facet *b, const blockSpan &span)
int getFaceNo(const face *f)
blockLoc getSourceLoc(int x, int y) const
orient_t inverse(void) const
patch * patchForCoord(const blockLoc &at)
#define BLOCKSPAN_FOR(i, span)
blockLoc getDestLoc(int x, int y) const
static const char * face2name[nFaces]
bool nodesMatch(int x, int y, const face *dest, const facetOrientation &o) const
static int findOther(int a, int b)
const blockDim & getDim(void) const
void fillNeighbors(int x, int y, const node **nbor) const
bool hasLoc(const face *test, const blockLoc &l) const
facet(const node **nbor, const face *source)
vector< externalBCpatch > extBCs
int getLength(void) const
const vector3d & getLoc(const blockLoc &l) const
static face * intersect(const node **nodes, const face *notHim=NULL, blockLoc *loc=NULL, blockLoc *oX=NULL, blockLoc *oY=NULL)
vector< patch * > patches
bool isPatched(void) const
bool matches(const facet &o) const
int getBlockNumber(void) const
int loc2node(const blockLoc &l) const