Go to the documentation of this file.
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 geometry"
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]
231 Info<<
"Creating boundary patches" <<
endl;
static SLList< string > validArgs
A list of valid (mandatory) arguments.
const cellShapeList & cellShapes
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
A class for handling words, derived from string.
static void addOption(const word &opt, const string ¶m="", const string &usage="")
Add to an option to validOptions with usage information.
static word defaultRegion
Return the default region name.
#define forAll(list, i)
Loop across all elements in list.
faceListList boundary(nPatches)
static void addBoolOption(const word &opt, const string &usage="")
Add to a bool option to validOptions with usage information.
virtual bool write() const
Write using setting from DB.
Extract command arguments and options from the supplied argc and argv parameters.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Mesh consisting of general polyhedral cells.
wordList patchTypes(nPatches)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
static const cellModel * lookup(const word &)
Look up a model by name and return a pointer to the model or NULL.
polyMesh pShapeMesh(IOobject(polyMesh::defaultRegion, runTime.constant(), runTime), xferMove(points), cellShapes, boundary, patchNames, patchDicts, defaultFacesName, defaultFacesType)
int main(int argc, char *argv[])
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
wordList patchNames(nPatches)
T optionLookupOrDefault(const word &opt, const T &deflt) const
Read a value from the named option if present.
An analytical geometric cellShape.
void exit(const int errNo=1)
Exit : can be called for any error to exit program.
IOstream & hex(IOstream &io)
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
Xfer< T > xferMove(T &)
Construct by transferring the contents of the arg.
static unsigned int defaultPrecision()
Return the default precision.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
bool optionFound(const word &opt) const
Return true if the named option is found.
Maps a geometry to a set of cell primitives, which enables geometric cell data to be calculated witho...
void size(const label)
Override size to be inconsistent with allocated storage.
Hex block definition used in the cfx converter.
static void noParallel()
Remove the parallel options.
Foam::argList args(argc, argv)
bool optionReadIfPresent(const word &opt, T &) const
Read a value from the named option if present.
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.
bool check(bool checkArgs=true, bool checkOpts=true) const
Check argument list.