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

Go to the source code of this file.

Classes

class  mblockData
 
class  mblockData::blockPatches
 

Functions

const char * writeMblock (vector< block * > &blocks, const char *outMblock)
 
internalBCpatchcreateSendPatch (internalBCpatch *recv, int faceNo)
 
static void printSpan (FILE *out, const blockSpan &sp)
 

Function Documentation

internalBCpatch* createSendPatch ( internalBCpatch recv,
int  faceNo 
)

Definition at line 161 of file writemblock.cpp.

References internalBCpatch::dest, internalBCpatch::destSpan, internalBCpatch::orient, patch::src, and patch::srcSpan.

162 {
163  internalBCpatch *send=new internalBCpatch(NULL,recv->src,recv->dest,
164  recv->srcSpan,recv->destSpan,recv->orient);
165  return send;
166 }
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
static void printSpan ( FILE *  out,
const blockSpan sp 
)
static

Definition at line 186 of file writemblock.cpp.

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

Referenced by externalBCpatch::writeMblock(), and internalBCpatch::writeMblock().

187 {
188  const blockLoc &s(sp.start), &e(sp.end);
189  fprintf(out," %d %d %d %d %d %d \n",
190  s[0],e[0],s[1],e[1],s[2],e[2]);
191 }
double s
Definition: blastest.C:80
blockLoc start
Definition: gridutil.h:155
blockLoc end
Definition: gridutil.h:156

Here is the caller graph for this function:

const char* writeMblock ( vector< block * > &  blocks,
const char *  outMblock 
)

Definition at line 134 of file writemblock.cpp.

References d, cimg_library::cimg::fclose(), fName, cimg_library::cimg::fopen(), cimg_library::cimg::fwrite(), parameters, makefloParam::topologyOnly, and mblockData::write().

Referenced by main(), and mblockData::blockPatches::write().

136 {
137  mblockData d(blocks);
138  for (unsigned int b=0;b<blocks.size();b++) {
139  char fName[1024];
140 
141  //Write the boundary descriptions
142  sprintf(fName,"%s%05d.bblk",outMblock,b);
143  FILE *fb=fopen(fName,"w");
144  if (fb==NULL) return "Couldn't create .bblk file";
145  d.write(blocks[b],fb);
146  fclose(fb);
147 
148  //Write the mesh locations themselves
149  if (!parameters.topologyOnly) {
150  sprintf(fName,"%s%05d.mblk",outMblock,b);
151  FILE *fm=fopen(fName,"wb");
152  if (fm==NULL) return "Couldn't create .bblk file";
153  fwrite(&blocks[b]->getLoc(blockLoc(0,0,0)),sizeof(vector3d),
154  blocks[b]->getDim().getSize(),fm);
155  fclose(fm);
156  }
157  }
158  return NULL;
159 }
const NT & d
int topologyOnly
Definition: makeflo.h:93
int fclose(std::FILE *file)
Close a file, and check for possible errors.
Definition: CImg.h:5507
void int int int REAL REAL REAL const char * fName
Definition: write.cpp:76
int fwrite(const T *ptr, const unsigned int nmemb, std::FILE *stream)
Write data to a file, and check for possible errors.
Definition: CImg.h:5587
makefloParam parameters
Definition: makeflo.cpp:101
std::FILE * fopen(const char *const path, const char *const mode)
Open a file, and check for possible errors.
Definition: CImg.h:5494

Here is the call graph for this function:

Here is the caller graph for this function: