203 using namespace Foam;
218 if (patchOption.size() == 2)
225 <<
"Argument to option '-" <<
name
227 <<
"It should be of the form \"<name> <type>\""
236 int main(
int argc,
char *argv[])
243 "Writes blockMeshDict, snappyHexMeshDict, surfaceFeaturesDict "
244 "and meshQualityDict files.\n"
245 "Requires surface geometry files as inputs.\n"
246 "For more information, see 'Description' in snappyHexMeshConfig.C "
247 "or run\n\n foamInfo snappyHexMeshConfig"
256 "delete mesh configuration files"
263 "single surface geometry file for meshing"
270 "number of cells in each direction, e.g. '(10 20 30)'"
277 "number of cells in the shortest direction, e.g. 10"
284 "bounding box of the mesh, e.g. '(-10 -5 0) (10 5 10)'"
289 "cylindricalBackground",
290 "generate a cylindrical background mesh aligned with the z-axis"
296 "do not write a blockMeshDict file"
303 "integer multiplier for the number of cells (>= 1)"
310 "refinement level used by snappyHexMesh, default 2"
317 "refinement level at specified surfaces, e.g. '(pipe 2) (baffles 1)'"
324 "refinement regions specified by '(<surface> <level>) (...)'"
331 "refinement boxes specified by '(<min> <max> <level>) (...)'"
338 "refinement distance specified by "
339 "'(<surface> <dist> <level>) (...)'"
346 "name and type of default patch, '<name> <type>'"
359 +
" direction, format '<name> <type>'"
366 "do not set default patch entries, i.e. xMin, xMax, etc"
372 "use explicit feature capturing"
379 "number of layers on specified surfaces, e.g. '(car 3) (ground 4)'"
384 "firstLayerThickness",
386 "specify the thickness of the near wall cells for layer addition"
391 "layerExpansionRatio",
393 "specify the expansion ratio between layers, default 1.2"
400 "surfaces that form cellZones, e.g. 'porousZone heatSource'"
407 "surfaces that form rotatingZones, e.g. 'rotatingZone'"
414 "surfaces that form baffles, e.g. 'helical'"
421 "point location inside the region of geometry to be meshed"
428 "point locations inside the geometry, e.g. '(0 1 0) (1 1 1)'"
433 "nCellsBetweenLevels",
435 "number of cells at successive refinement levels, default 3"
442 "inlet regions on an external surface, e.g. 'inletA inletB'"
449 "outlet regions on an external surface, e.g. 'outletA outletB'"
455 "domain does not contain inlets or outlets"
462 word dir(runTime.system());
481 "surfaceFeaturesDict"
484 Info<<
"Deleting mesh configuration files in '"
485 << dir <<
"'" <<
endl;
490 if (
rm(dir/dicts[i]))
499 Info<<
"+ No files to delete" <<
endl;
507 Info<<
"Writing mesh configuration files to '"
508 << dir <<
"'" <<
nl <<
endl;
534 surfaceNames.
append(surfDir/files[i]);
538 if (surfaceNames.
empty())
541 <<
"No surface geometry files found in "
543 <<
"or provided using the '-surface' option"
571 if (bounds.size() != 2)
574 <<
"Argument to '-bounds'"
575 <<
" should be of the form '(<min> <max>)'" <<
nl
576 <<
"with the <min> and <max> bounds of a bounding box"
577 <<
"\n\nFound instead the argument: "
582 bb =
boundBox(bounds[0], bounds[1]);
583 Info<<
"Bounding box specified by '-bounds' option: "
619 const label minDimCells
624 const label refineFactor
633 readPatchOption(
args, patchOpts,
patches[i] +
"Patch");
655 blockMeshConfig.write();
673 blockMeshConfig.write();
678 const label refinementLevel
733 const scalar firstLayerThickness
738 const scalar layerExpansionRatio
746 <<
"Options '-insidePoint' and '-insidePoints' "
747 <<
"cannot both be selected"
752 bool insidePointsOpt(
false);
761 insidePointsOpt =
true;
771 const label nCellsBetweenLevels
776 if (explicitFeatures)
780 "surfaceFeaturesDict",
786 surfaceFeaturesConfig.write();
809 snappyConfig.write();
818 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.
const string & option(const word &opt) const
Return the argument string associated with the named option.
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.
bool optionReadIfPresent(const word &opt, T &) const
Read a value from the named option if present.
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.
bool rm(const fileName &)
Remove a file, returning true if successful otherwise false.
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const word & regionName(const solver ®ion)
bool isDir(const fileName &, const bool followLink=true)
Does the name exist as a directory in the file system?
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
label count(const ListType &l, typename ListType::const_reference x)
Count the number of occurrences of a value in a list.
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)