57 int main(
int argc,
char *argv[])
65 "geometry scaling factor - default is 1" 75 "input is a single block" 81 "use when converting a 2-D mesh (applied before scale)" 95 scalar twoDThickness = -1;
98 Info<<
"Reading 2D case by extruding points by " << twoDThickness
99 <<
" in z direction." << nl <<
endl;
118 plot3dFile >> nblock;
121 Info<<
"Reading " << nblock <<
" blocks" <<
endl;
130 if (twoDThickness > 0)
133 plot3dFile >> nx >> ny;
138 plot3dFile >> nx >> ny >> nz;
141 Info<<
"block " << blockI <<
" nx:" << nx
142 <<
" ny:" << ny <<
" nz:" << nz <<
endl;
144 blocks.set(blockI,
new hexBlock(nx, ny, nz));
148 Info<<
"Reading block points" <<
endl;
154 Info<<
"block " << blockI <<
":" <<
nl;
155 blocks[blockI].readPoints(readBlank, twoDThickness, plot3dFile);
156 sumPoints += blocks[blockI].nBlockPoints();
157 nMeshCells += blocks[blockI].nBlockCells();
166 const pointField& blockPoints = blocks[blockI].points();
167 blockOffsets[blockI] = sumPoints;
170 points[sumPoints++] = blockPoints[i];
188 Info<<
"Merged points within " << small <<
" distance. Merged from " 189 << oldToNew.
size() <<
" down to " << newPoints.
size()
190 <<
" points." <<
endl;
193 if (scaleFactor > 1.0 + small || scaleFactor < 1.0 - small)
195 newPoints *= scaleFactor;
204 label nCreatedCells = 0;
210 forAll(curBlockCells, blockCelli)
212 labelList cellPoints(curBlockCells[blockCelli].size());
214 forAll(cellPoints, pointi)
219 curBlockCells[blockCelli][pointi]
220 + blockOffsets[blockI]
225 cellShapes[nCreatedCells] =
cellShape(hex, cellPoints,
true);
231 Info<<
"Creating boundary patches" <<
endl;
236 word defaultFacesName =
"defaultFaces";
237 word defaultFacesType = wallPolyPatch::typeName;
#define forAll(list, i)
Loop across all elements in list.
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
static const cellModel * lookup(const word &)
Look up a model by name and return a pointer to the model or nullptr.
An analytical geometric cellShape.
static unsigned int defaultPrecision()
Return the default precision.
void size(const label)
Override size to be inconsistent with allocated storage.
wordList patchTypes(nPatches)
static word defaultRegion
Return the default region name.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool optionFound(const word &opt) const
Return true if the named option is found.
static void noParallel()
Remove the parallel options.
static SLList< string > validArgs
A list of valid (mandatory) arguments.
bool optionReadIfPresent(const word &opt, T &) const
Read a value from the named option if present.
void exit(const int errNo=1)
Exit : can be called for any error to exit program.
polyMesh pShapeMesh(IOobject(polyMesh::defaultRegion, runTime.constant(), runTime), move(points), cellShapes, boundary, patchNames, patchDicts, defaultFacesName, defaultFacesType)
T optionLookupOrDefault(const word &opt, const T &deflt) const
Read a value from the named option if present.
A class for handling words, derived from string.
const cellShapeList & cellShapes
Extract command arguments and options from the supplied argc and argv parameters. ...
wordList patchNames(nPatches)
static void addOption(const word &opt, const string ¶m="", const string &usage="")
Add to an option to validOptions with usage information.
faceListList boundary(nPatches)
Hex block definition used in the cfx converter.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
label mergePoints(const UList< Type > &points, const scalar mergeTol, const bool verbose, labelList &pointMap, const Type &origin=Type::zero)
Sorts and merges points. All points closer than/equal mergeTol get merged.
Maps a geometry to a set of cell primitives, which enables geometric cell data to be calculated witho...
bool check(bool checkArgs=true, bool checkOpts=true) const
Check argument list.
Mesh consisting of general polyhedral cells.
static void addBoolOption(const word &opt, const string &usage="")
Add to a bool option to validOptions with usage information.
virtual bool write(const bool write=true) const
Write using setting from DB.
Foam::argList args(argc, argv)
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...