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

#include <patch.h>

Inheritance diagram for internalBCpatch:
Collaboration diagram for internalBCpatch:

Public Member Functions

void setPartner (internalBCpatch *p)
 
void setType (int to)
 
virtual void writeFlo (FILE *out, const bcList &bc)
 
virtual void writeMblock (FILE *out, mblockData &d)
 
virtual void writeTop (FILE *out, const bcListTop &d)
 
 internalBCpatch (face *f_, block *src_, block *dest_, const blockSpan &srcSpan_, const blockSpan &destSpan_, const orient_t &orient_)
 
- Public Member Functions inherited from patch
void setFace (face *f_)
 
facegetFace (void) const
 
virtual bool isExternal (void) const
 
 patch ()
 
virtual ~patch ()
 

Public Attributes

blockdest
 
blockSpan destSpan
 
internalBCpatchpartner
 
int type
 
orient_t orient
 
- Public Attributes inherited from patch
blocksrc
 
blockSpan srcSpan
 

Additional Inherited Members

- Protected Member Functions inherited from patch
 patch (face *f_, block *src_, const blockSpan &srcSpan_)
 

Detailed Description

Definition at line 119 of file patch.h.

Constructor & Destructor Documentation

internalBCpatch ( face f_,
block src_,
block dest_,
const blockSpan srcSpan_,
const blockSpan destSpan_,
const orient_t orient_ 
)
inline

Definition at line 134 of file patch.h.

137  : patch(f_,src_,srcSpan_),
138  dest(dest_),destSpan(destSpan_),
139  partner(0),type(1),orient(orient_) { }
internalBCpatch * partner
Definition: patch.h:124
patch()
Definition: patch.h:89
orient_t orient
Definition: patch.h:128
block * dest
Definition: patch.h:122
blockSpan destSpan
Definition: patch.h:123

Member Function Documentation

void setPartner ( internalBCpatch p)
inline

Definition at line 125 of file patch.h.

References partner.

Referenced by findPartner().

125 {partner=p;}
internalBCpatch * partner
Definition: patch.h:124

Here is the caller graph for this function:

void setType ( int  to)
inline

Definition at line 127 of file patch.h.

References type.

127 {type=to;}
void writeFlo ( FILE *  out,
const bcList bc 
)
virtual

Implements patch.

Definition at line 178 of file writeflo.cpp.

References dest, destSpan, block::getBlockNumber(), getSpan(), orient, patch::src, patch::srcSpan, and type.

179 {
180  string srcS=getSpan(srcSpan);
181  string destS=getSpan(destSpan);
182  int destBlockNo=dest->getBlockNumber()+1;
183  const char *selfFlag="";
184  if (destBlockNo==src->getBlockNumber()+1) {
185  destBlockNo=0;//Self-connecting block
186  selfFlag="(self-connecting)";
187  }
188  fprintf(out,"%d %s ! Internal boundary %s%s\n",
189  type,srcS.c_str(),(type==2)?"(TYPE TWO)":"",selfFlag);
190  fprintf(out,"%-5d %s\n",
191  destBlockNo,destS.c_str());
192  fprintf(out,"%d %d %d ! Orientation\n",
193  1+orient[0],1+orient[1],1+orient[2]);
194 }
string getSpan(const blockSpan &s)
Definition: writeflo.cpp:159
blockSpan srcSpan
Definition: patch.h:79
block * src
Definition: patch.h:78
orient_t orient
Definition: patch.h:128
block * dest
Definition: patch.h:122
blockSpan destSpan
Definition: patch.h:123
int getBlockNumber(void) const
Definition: adj.h:219

Here is the call graph for this function:

void writeMblock ( FILE *  out,
mblockData d 
)
virtual

Implements patch.

Definition at line 200 of file writemblock.cpp.

References mblockData::getPatchNumber(), and printSpan().

201 {
202  fprintf(out,"-1 ");
203  printSpan(out,srcSpan);
204  fprintf(out," %d %d ",dest->getBlockNumber(),
206  //Figure out the orientation of each axis
207  for (int srcAxis=0;srcAxis<3;srcAxis++) {
208  int destAxis=orient[srcAxis];
209  int isFlipped=0; //Is this axis orientation-reversed?
210  if (destSpan.end[destAxis]<destSpan.start[destAxis])
211  isFlipped=1;
212  fprintf(out,"%c%d ",isFlipped?'-':'+',destAxis+1);
213  }
214  fprintf(out,"\n");
215 }
internalBCpatch * partner
Definition: patch.h:124
blockSpan srcSpan
Definition: patch.h:79
orient_t orient
Definition: patch.h:128
static void printSpan(FILE *out, const blockSpan &sp)
block * dest
Definition: patch.h:122
blockLoc start
Definition: gridutil.h:155
blockLoc end
Definition: gridutil.h:156
blockSpan destSpan
Definition: patch.h:123
int getBlockNumber(void) const
Definition: adj.h:219
int getPatchNumber(block *dest, patch *partner)

Here is the call graph for this function:

void writeTop ( FILE *  out,
const bcListTop d 
)
virtual

Implements patch.

Definition at line 204 of file writetop.cpp.

References dest, destSpan, block::getBlockNumber(), blockSpan::getFace(), orient, patch::srcSpan, writePatchEnd(), writePatchMiddle(), writePatchStart(), and writeSpan().

205 {
206  //Compute where the orientation-indicating minus signs should go:
207  int flatAxis=(srcSpan.getFace()%3);
208  int l1Axis=(flatAxis+1)%3;
209  blockLoc srcSign(1,1,1), destSign(1,1,1);
210  srcSign[flatAxis]=0; //Shouldn't ever print flat axis
211  destSign[orient[flatAxis]]=0;
212  srcSign[l1Axis]=-1; //Flip sign on l1 axis
213  destSign[orient[l1Axis]]=-1;
214 
215  const int internalBcType=30;
216  writePatchStart(out,internalBcType);
217  writeSpan(out,srcSpan,srcSign);
219  writeSpan(out,destSpan,destSign);
220  writePatchEnd(out,0); //Internal patches are never coupled
221 }
blockSpan srcSpan
Definition: patch.h:79
static void writePatchEnd(FILE *out, int coupled)
Definition: writetop.cpp:189
orient_t orient
Definition: patch.h:128
block * dest
Definition: patch.h:122
static void writePatchMiddle(FILE *out, int connBlock)
Definition: writetop.cpp:186
blockSpan destSpan
Definition: patch.h:123
static void writeSpan(FILE *out, const blockSpan &s, const blockLoc &sign)
Definition: writetop.cpp:160
int getBlockNumber(void) const
Definition: adj.h:219
int getFace(void) const
Definition: gridutil.h:191
static void writePatchStart(FILE *out, int patchType)
Definition: writetop.cpp:183

Here is the call graph for this function:

Member Data Documentation

block* dest

Definition at line 122 of file patch.h.

Referenced by createSendPatch(), findPartner(), writeFlo(), and writeTop().

blockSpan destSpan

Definition at line 123 of file patch.h.

Referenced by createSendPatch(), findPartner(), writeFlo(), and writeTop().

orient_t orient

Definition at line 128 of file patch.h.

Referenced by createSendPatch(), writeFlo(), and writeTop().

internalBCpatch* partner

Definition at line 124 of file patch.h.

Referenced by buildFaces(), and setPartner().

int type

Definition at line 126 of file patch.h.

Referenced by buildFaces(), setType(), and writeFlo().


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