106 if (argc<5)
printUsage(
"Not enough command-line arguments");
108 while (argv[curArg][0]==
'-')
110 const char *flag=argv[curArg++];
111 if (0==strcmp(flag,
"-h") ||
112 0==strcmp(flag,
"-?") ||
113 0==strcmp(flag,
"--help"))
115 else if (0==strcmp(flag,
"-splitaxis")) {
117 printUsage(
"Must pass 0,1, or 2 to -splitaxis");
119 else if (0==strcmp(flag,
"-splitrcb")) {
122 else if (0==strcmp(flag,
"-splithalf")) {
125 else if (0==strcmp(flag,
"-multilevel")) {
127 if ((1!=sscanf(argv[curArg++],
"%d",&level))||(level<=0))
128 printUsage(
"Must pass a positive integer to -multilevel");
133 if (curArg+4!=argc)
printUsage(
"Too many arguments");
134 const char *inMesh=argv[curArg+0];
136 int nPieces=atoi(argv[curArg+1]);
137 const char *floFile=argv[curArg+2];
138 const char *outMesh=argv[curArg+3];
141 const char *bcExt=
"?";
146 else if (
endsWith(floFile,
".top")) {
151 printf(
"UNRECOGNIZED TOPOLOGY NAME: '%s'\n",floFile);
162 printf(
"Mesh file read successfully.\n");
166 for (
unsigned int i=0;
i<blocks.size();
i++)
171 printf(
"Boundary conditions read successfully.\n");
175 nPieces = blocks.size()*2;
176 printf(
"Split every block in half for %d pieces.\n", nPieces);
181 printf(
"Split blocks for %d PEs (%d blocks generated).\n",
182 nPieces,(
int)blocks.size());
186 printf(
"Nodes matched successfully.\n");
191 printf(
".flo file written successfully\n");
194 printf(
".top file written successfully\n");
199 printf(
"Program finished successfully\n");
const char * writeBlocks(vector< block * > &blocks, const char *outMesh)
void printUsage(const char *why)
bool endsWith(const char *a, const char *suffix)
string replaceExtention(const string &a, const string &newSuffix)
const char * writeTop(vector< block * > &blocks, const char *inBcs, const char *out)
void checkQuality(const block &b)
void checkError(const char *errCode)
const char * splitBlocks(vector< block * > &blocks, int nPieces)
bool blocks
Input data is block-structured grid.
const char * readBoundaries(vector< block * > &blocks, const char *inMesh)
const char * writeFlo(vector< block * > &blocks, int nPEs, const char *inBcs, const char *out)
void buildFaces(vector< block * > &blocks, bool buildTypeTwo)