186 using namespace Foam;
206 int main(
int argc,
char *argv[])
213 "Writes blockMeshDict, surfaceFeaturesDict and snappyHexMeshDict "
214 "files from surface geometry files.\n"
215 "For more information, see 'Description' in snappyHexMeshConfig.C "
216 "or run\n\n foamInfo snappyHexMeshConfig"
225 "single surface geometry file for meshing"
232 "number of cells in each direction, e.g. '(10 20 30)'"
239 "bounding box of the mesh, e.g. '((-10 -5 0) (10 5 10))'"
244 "cylindricalBackground",
245 "generate a cylindrical background mesh aligned with the z-axis"
252 "integer multiplier for the number of cells (>= 1)"
259 "refinement level used by snappyHexMesh, default 2"
266 "refinement level at specified surfaces, e.g. '((pipe 2) (baffles 1))'"
273 "refinement regions specified by '( (<surface> <level>) (...) )'"
280 "refinement boxes specified by '( (<min> <max> <level>) (...) )'"
287 "refinement distance specified by "
288 "'( (<surface> <dist> <level>) (...) )'"
295 "name and type of default patch, '(<name> <type>)'"
308 +
" direction, format '(<name> <type>)'"
315 "do not set default patch entries, i.e. xMin, xMax, etc"
321 "use explicit feature capturing"
328 "number of layers on specified surfaces, e.g. '((car 3) (ground 4))'"
333 "firstLayerThickness",
335 "specify the thickness of the near wall cells for layer addition"
340 "layerExpansionRatio",
342 "specify the expansion ratio between layers, default 1.2"
349 "surfaces that form cellZones, e.g. '(porousZone heatSource)'"
356 "surfaces that form rotatingZones, e.g. '(rotatingZone)'"
363 "surfaces that form baffles, e.g. '(helical)'"
370 "point location inside the region of geometry to be meshed"
375 "nCellsBetweenLevels",
377 "number of cells at successive refinement levels, default 3"
384 "inlet regions on an external surface, e.g. '(inletA inletB)'"
391 "outlet regions on an external surface, e.g. '(outletA outletB)'"
421 surfaceNames.
append(surfDir/files[i]);
425 if (surfaceNames.
empty())
428 <<
"No surface geometry files found in "
430 <<
"or provided using the '-surface' option"
458 if (bounds.size() != 2)
461 <<
"Argument to '-bounds'"
462 <<
" should be of the form '(<min> <max>)'" <<
nl
463 <<
"with the <min> and <max> bounds of a bounding box"
464 <<
"\n\nFound instead the argument: "
469 bb =
boundBox(bounds[0], bounds[1]);
470 Info<<
"Bounding box specified by '-bounds' option: "
502 const label refineFactor
511 readPatchOption(
args, patchOpts,
patches[i] +
"Patch");
530 blockMeshConfig.write();
547 blockMeshConfig.write();
551 const label refinementLevel
606 const scalar firstLayerThickness
611 const scalar layerExpansionRatio
616 const point insidePoint
621 const label nCellsBetweenLevels
626 if (explicitFeatures)
630 "surfaceFeaturesDict",
636 surfaceFeaturesConfig.write();
658 snappyConfig.write();
667 meshQualityConfig.write();
#define forAll(list, i)
Loop across all elements in list.
An STL-conforming hash table.
void append(const T &)
Append an element at the end of the list.
void append(T *)
Append an element at the end of the list.
A 2-tuple for storing two objects of different types.
A 3-tuple for storing three objects of different types.
bool empty() const
Return true if the UList is empty (ie, size() is zero)
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 addNote(const string &)
Add extra notes for the usage information.
T optionRead(const word &opt) const
Read a value from the named option.
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.
static string::size_type usageMin
Min offset for displaying usage (default: 20)
List< T > optionReadList(const word &opt) const
Read a List of values from the named option.
static string::size_type usageMax
Max screen width for displaying usage (default: 80)
T optionLookupOrDefault(const word &opt, const T &deflt) const
Read a value from the named option if present.
From a set of input surface geometry files and a set of configuration parameters, writes out a blockM...
static const List< word > patches
Default patch names for the background mesh.
From a set of input surface geometry files and a set of configuration parameters, writes out a blockM...
A bounding box defined in terms of the points at its extremities.
A class for handling file names.
Writes a meshQualityDict file which is included from the snappyHexMeshDict file.
List of meshingSurfaces which stores the overall bounding box of all the meshingSurfaces.
static bool isSurfaceExt(const fileName &file)
Encapsulates queries for volume refinement ('refine all cells within shell').
static const word & geometryDir()
Return the geometry directory name.
From a set of input surface geometry files and some configuration parameters, writes out a snappyHexM...
From a set of input surface geometry files and some configuration parameters, writes out a surfacesFe...
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
int main(int argc, char *argv[])
const fvPatchList & patches
errorManipArg< error, int > exit(error &err, const int errNo=1)
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.
word name(const bool)
Return a word representation of a bool.
fileNameList readDir(const fileName &, const fileType=fileType::file, const bool filterVariants=true, const bool followLink=true)
Read a directory and return the entries as a string list.
Foam::argList args(argc, argv)