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