63 if (errCode==NULL)
return;
64 fprintf(stderr,
"FATAL ERROR! %s\n",errCode);
70 printf(
"Usage: makemblock \n"
71 " <.grd, or .msh mesh; and .inp and .bc file> \n"
72 " <# output chunks> <output file prefix>\n"
73 " Makemblock reads a mesh (first parameter) and boundary condition\n"
74 "(.inp) list, partitions the mesh into the requested number of\n"
75 "chunks, and writes out mblock input files.\n"
76 " The mesh formats supported are:\n"
77 "<*.grd> A Gridgen ASCII double-precision mesh description\n"
78 "<*.msh> A double-precision binary Rocflo mesh file\n"
79 "<*.hdf> A double-precision 3D HDF mesh file\n"
80 "<*.mblk> A double-precision 3D Mblock mesh file\n"
81 " When the mesh consists of multiple files, give only the name of\n"
82 "the first file (e.g., 'tstflo_001.hdf'). The number of blocks and\n"
83 "numeric format will be automatically determined.\n"
87 printf(
"Exiting> %s\n",why);
93 int main(
int argc,
char *argv[])
96 if (argc<4)
printUsage(
"Not enough command-line arguments");
99 while (argv[curArg][0]==
'-') {
100 if (0==strcmp(argv[curArg],
"-2D")) {
104 else if (0==strcmp(argv[curArg],
"-top")) {
112 if (curArg+3!=argc)
printUsage(
"Too many arguments");
113 const char *inMesh=argv[curArg+0];
115 int nPieces=atoi(argv[curArg+1]);
116 const char *outMesh=argv[curArg+2];
124 printf(
"Mesh file read successfully.\n");
129 printf(
"Boundary conditions read successfully.\n");
133 printf(
"Split blocks for %d PEs (%d blocks generated).\n",nPieces,blocks.size());
137 printf(
"Nodes matched successfully.\n");
141 printf(
"Block files written successfully\n");
const char * writeMblock(vector< block * > &blocks, const char *outMblock)
void printUsage(const char *why)
string replaceExtention(const string &a, const string &newSuffix)
void checkError(const char *errCode)
const char * splitBlocks(vector< block * > &blocks, int nPieces)
bool blocks
Input data is block-structured grid.
int main(int argc, char *argv[])
const char * read(const char *gridFile)
const char * readBoundaries(vector< block * > &blocks, const char *inMesh)
void buildFaces(vector< block * > &blocks, bool buildTypeTwo)