snappyHexMeshConfig.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2023-2025 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Application
25  snappyHexMeshConfig
26 
27 Description
28  Preconfigures blockMeshDict, surfaceFeaturesDict and snappyHexMeshDict
29  files based on the case surface geometry files.
30 
31  Starting from a standard OpenFOAM case, this utility locates surface
32  geometry files, e.g. OBJ, STL format, in the constant/geometry directory.
33  It writes out the configuration files for mesh generation with
34  snappyHexMesh based on assumptions which can be overridden by options on
35  the command line.
36 
37  The utility processes the surface geometry files, attempting to anticipate
38  their intended purpose, trying in particular to recognise whether the
39  domain represents an external or internal flow. If there is a surface
40  which is closed, and is either single or surrounds all other surfaces,
41  then it is assumed that it forms the external boundary of an internal
42  flow. This assumption is overridden if the bounds of the background mesh
43  are specified using the '-bounds' option and they are more than 50% larger
44  than the surface bounds.
45 
46  Surfaces which form boundaries of the domain may contain named regions
47  that are intended to become patches in the final mesh. Any surface region
48  whose name begins with 'inlet' or 'outlet' will become a patch of the same
49  name in the final mesh. On an external surface (for an internal flow),
50  regions can be identified as inlets and outlets using the '-inletRegions'
51  and '-outletRegions' options, respectively. When either option specifies a
52  single region, the resulting patch name will be specifically 'inlet' or
53  'outlet', respectively. Surfaces which are contained within the domain,
54  which do not surround or intersect other surfaces, are assumed by default
55  to be wall patches. Any closed surface which surrounds another (but not an
56  external surface) is used to form a cellZone within the mesh. Any surface
57  can be specifically identified as a cellZone with the '-cellZones' option,
58  with the additional '-baffles' and '-rotatingZones' options available to
59  assign a surface to a more specific use.
60 
61  The background mesh for snappyHexMesh is a single block generated by
62  blockMesh, configured using a blockMeshDict file. The block bounds are
63  automatically calculated, but can be overridden by the '-bounds'
64  option. The number of cells is calculated to produce a fairly small
65  prototype mesh. The cell density can be overridden by the '-nCells' option
66  or can be scaled up by an integer factor using the '-refineBackground'
67  option. When the background mesh is required to form patches in the final
68  mesh, e.g. for an external flow, the user can specify the names and types
69  of the patches corresponding to the six block faces using options such as
70  '-xMinPatch', '-xMaxPatch', etc. The name and type of the default patch,
71  formed from block faces which are not configured, can also be specified
72  with the '-defaultPatch' option. The utility provides placeholder entries
73  for all block faces unless the '-clearBoundary' option is used. A special
74  '-cylindricalBackground' option generates a cylindrical background mesh,
75  oriented along the z-axis along x = y = 0.
76 
77  The snappyHexMesh configuration is generated automatically, applying a set
78  of defaults to the main configuration parameters. By default, implicit
79  feature capturing is configured. Explicit feature capturing can
80  alternatively be selected with the '-explicitFeatures' option, when an
81  additional surfaceFeaturesDict file is written for the user to generate the
82  features files with the surfaceFeatures utility. Refinement levels can be
83  controlled with a range of options including: '-refinementLevel' for the
84  baseline refinement level; '-refinementSurfaces' for levels on specific
85  surfaces; '-refinementRegions' for levels inside specific surfaces;
86  '-refinementBoxes' for quick, box-shaped refinement regions specified by min
87  and max bounds; '-refinementDists' for distance-based refinement; and
88  '-nCellsBetweenLevels' to control the transition between refinement
89  levels. A '-layers' option controls additional layers of cells at specified
90  surfaces. The insidePoint parameter is set to '(0 0 0)' by default but can
91  be overridden using the '-insidePoint' option. There is an alternative
92  '-insidePoints' option to specify multiple insidePoints to mesh multiple
93  disconnected mesh regions.
94 
95 Usage
96  \b snappyHexMeshConfig [OPTIONS]
97 
98  Options:
99 
100  - \par -baffles <list>
101  Surfaces that form baffles, e.g. 'helical'
102 
103  - \par -bounds <box>
104  Bounding box of the mesh, e.g. '(-10 -5 0) (10 5 10)'
105 
106  - \par -cellZones <list>
107  Surfaces that form cellZones, e.g. 'porousZone heatSource'
108 
109  - \par -clearBoundary,
110  Do not set default patch entries, i.e. xMin, xMax, yMin, etc...
111 
112  - \par -closedDomain
113  Domain does not contain inlets or outlets
114 
115  - \par -cylindricalBackground
116  Generate a cylindrical background mesh aligned with the z-axis
117 
118  - \par -defaultPatch <entry>
119  Name and type of default patch, '(<name> <type>)'
120 
121  - \par -explicitFeatures,
122  Use explicit feature capturing, default is implicit
123 
124  - \par -firstLayerThickness <value>
125  Specify the thickness of the near wall cells for layer addition
126 
127  - \par -inletRegions <list>
128  Inlet regions on an external surface, e.g. 'inletA inletB'
129 
130  - \par -insidePoint <point>
131  Point location inside the region of geometry to be meshed
132 
133  - \par -insidePoints <list>
134  Point locations inside geometry to be meshed, e.g. '(0 0 0) (0 1 0)'
135 
136  - \par -layerExpansionRatio <value>
137  Specify the expansion ratio between layers, default 1.2
138 
139  - \par -layers <entry>
140  Number of layers on specified surfaces, e.g. '(car 3) (ground 4)'
141 
142  - \par -minDimCells <cells>
143  Number of cells in the shortest direction, e.g. 10
144 
145  - \par -nCells <cells>
146  Number of cells in each direction, e.g. '(10 20 30)'
147 
148  - \par -nCellsBetweenLevels <int>
149  Number of cells at successive refinement levels, default 3
150 
151  - \par -noBackground
152  Do not write a blockMeshDict file
153 
154  - \par -outletRegions <list>
155  Outlet regions on an external surface, e.g. 'outletA outletB'
156 
157  - \par -refineBackground <int>
158  Integer multiplier for the number of cells (>= 1)
159 
160  - \par -refinementBoxes <entry>
161  Refinement boxes specified by '(<min> <max> <level>) (...) '
162 
163  - \par -refinementDists <entry>
164  Refinement distance specified by
165  '( (<surface> <dist> <level>) (...) )'
166 
167  - \par -refinementLevel <int>
168  Refinement level used by snappyHexMesh, default 2
169 
170  - \par -refinementRegions <entry>
171  Refinement regions specified by '(<surface> <level>) (...)'
172 
173  - \par -region <name>
174  Specify alternative mesh region
175 
176  - \par -rotatingZones <list>
177  Surfaces that form rotatingZones, e.g. 'rotatingZone'
178 
179  - \par -surface <file>
180  Single surface geometry file for meshing
181 
182  - \par -surfaceLevels <entry>
183  Refinement level at specified surfaces, e.g. '(pipe 2) (baffles 1)'
184 
185  - \par -xMinPatch (-xMaxPatch, -yMinPatch, etc...) <entry>
186  Name and type of the xMin (xMax, yMin, etc...) patch,
187  '(<name> <type>)'
188 
189 \*---------------------------------------------------------------------------*/
190 
191 #include "argList.H"
192 #include "Time.H"
193 #include "meshingSurface.H"
199 #include "boundBox.H"
200 #include "searchableSurface.H"
201 #include "Tuple3.H"
202 
203 using namespace Foam;
204 
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206 
207 void readPatchOption
208 (
209  const argList& args,
210  HashTable<Pair<word>>& opts,
211  const word& name
212 )
213 {
214  if (args.optionFound(name))
215  {
216  List<word> patchOption(args.optionReadList<word>(name));
217 
218  if (patchOption.size() == 2)
219  {
220  opts.insert(name, Pair<word>(patchOption[0], patchOption[1]));
221  }
222  else
223  {
225  << "Argument to option '-" << name
226  << "' is " << args.option(name) << nl
227  << "It should be of the form \"<name> <type>\""
228  << exit(FatalError);
229  }
230  }
231 }
232 
233 
234 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
235 
236 int main(int argc, char *argv[])
237 {
238  argList::usageMin = 32;
239  argList::usageMax = 105;
240 
242  (
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"
248  );
249 
250  #include "removeCaseOptions.H"
251  #include "addRegionOption.H"
252 
254  (
255  "rm",
256  "delete mesh configuration files"
257  );
258 
260  (
261  "surface",
262  "file",
263  "single surface geometry file for meshing"
264  );
265 
267  (
268  "nCells",
269  "cells",
270  "number of cells in each direction, e.g. '(10 20 30)'"
271  );
272 
274  (
275  "minDimCells",
276  "int",
277  "number of cells in the shortest direction, e.g. 10"
278  );
279 
281  (
282  "bounds",
283  "box",
284  "bounding box of the mesh, e.g. '(-10 -5 0) (10 5 10)'"
285  );
286 
288  (
289  "cylindricalBackground",
290  "generate a cylindrical background mesh aligned with the z-axis"
291  );
292 
294  (
295  "noBackground",
296  "do not write a blockMeshDict file"
297  );
298 
300  (
301  "refineBackground",
302  "int",
303  "integer multiplier for the number of cells (>= 1)"
304  );
305 
307  (
308  "refinementLevel",
309  "int",
310  "refinement level used by snappyHexMesh, default 2"
311  );
312 
314  (
315  "surfaceLevels",
316  "entry",
317  "refinement level at specified surfaces, e.g. '(pipe 2) (baffles 1)'"
318  );
319 
321  (
322  "refinementRegions",
323  "entry",
324  "refinement regions specified by '(<surface> <level>) (...)'"
325  );
326 
328  (
329  "refinementBoxes",
330  "entry",
331  "refinement boxes specified by '(<min> <max> <level>) (...)'"
332  );
333 
335  (
336  "refinementDists",
337  "entry",
338  "refinement distance specified by "
339  "'(<surface> <dist> <level>) (...)'"
340  );
341 
343  (
344  "defaultPatch",
345  "entry",
346  "name and type of default patch, '<name> <type>'"
347  );
348 
350 
351  forAll(patches, i)
352  {
354  (
355  patches[i] + "Patch",
356  "entry",
357  "patch in the "
358  + patches[i]
359  + " direction, format '<name> <type>'"
360  );
361  }
362 
364  (
365  "clearBoundary",
366  "do not set default patch entries, i.e. xMin, xMax, etc"
367  );
368 
370  (
371  "explicitFeatures",
372  "use explicit feature capturing"
373  );
374 
376  (
377  "layers",
378  "entry",
379  "number of layers on specified surfaces, e.g. '(car 3) (ground 4)'"
380  );
381 
383  (
384  "firstLayerThickness",
385  "value",
386  "specify the thickness of the near wall cells for layer addition"
387  );
388 
390  (
391  "layerExpansionRatio",
392  "value",
393  "specify the expansion ratio between layers, default 1.2"
394  );
395 
397  (
398  "cellZones",
399  "list",
400  "surfaces that form cellZones, e.g. 'porousZone heatSource'"
401  );
402 
404  (
405  "rotatingZones",
406  "list",
407  "surfaces that form rotatingZones, e.g. 'rotatingZone'"
408  );
409 
411  (
412  "baffles",
413  "list",
414  "surfaces that form baffles, e.g. 'helical'"
415  );
416 
418  (
419  "insidePoint",
420  "point",
421  "point location inside the region of geometry to be meshed"
422  );
423 
425  (
426  "insidePoints",
427  "list",
428  "point locations inside the geometry, e.g. '(0 1 0) (1 1 1)'"
429  );
430 
432  (
433  "nCellsBetweenLevels",
434  "int",
435  "number of cells at successive refinement levels, default 3"
436  );
437 
439  (
440  "inletRegions",
441  "list",
442  "inlet regions on an external surface, e.g. 'inletA inletB'"
443  );
444 
446  (
447  "outletRegions",
448  "list",
449  "outlet regions on an external surface, e.g. 'outletA outletB'"
450  );
451 
453  (
454  "closedDomain",
455  "domain does not contain inlets or outlets"
456  );
457 
458  #include "setRootCase.H"
459  #include "createTime.H"
460 
462  word dir(runTime.system());
463 
464  if (args.optionReadIfPresent("region", regionName))
465  {
466  dir = runTime.system()/regionName;
467 
468  if (!isDir(dir))
469  {
470  mkDir(dir);
471  }
472  }
473 
474  if (args.optionFound("rm"))
475  {
476  wordList dicts
477  {
478  "snappyHexMeshDict",
479  "blockMeshDict",
480  "meshQualityDict",
481  "surfaceFeaturesDict"
482  };
483 
484  Info<< "Deleting mesh configuration files in '"
485  << dir << "'" << endl;
486  label count = 0;
487 
488  forAll(dicts, i)
489  {
490  if (rm(dir/dicts[i]))
491  {
492  Info<< "+ " << dicts[i] << endl;
493  ++count;
494  }
495  }
496 
497  if (count == 0)
498  {
499  Info<< "+ No files to delete" << endl;
500  }
501 
502  Info<< "\nEnd\n" << endl;
503 
504  return 0;
505  }
506 
507  Info<< "Writing mesh configuration files to '"
508  << dir << "'" << nl << endl;
509 
510  fileNameList surfaceNames;
511 
512  if (args.optionFound("surface"))
513  {
514  surfaceNames.append(args.optionRead<fileName>("surface"));
515  }
516  else
517  {
518  const fileName surfDir
519  (
520  runTime.constant()/searchableSurface::geometryDir(runTime)
521  );
522 
523  // Reads files, removing "gz" extensions
524  fileNameList files(readDir(surfDir));
525 
526  // Check valid extensions and add the path to the names
527  forAll(files, i)
528  {
529  if (!meshingSurface::isSurfaceExt(files[i]))
530  {
531  continue;
532  }
533 
534  surfaceNames.append(surfDir/files[i]);
535  }
536 
537  // Need to exit if no surface geometry files found
538  if (surfaceNames.empty())
539  {
541  << "No surface geometry files found in "
542  << surfDir << nl
543  << "or provided using the '-surface' option"
544  << exit(FatalError);
545  }
546  }
547 
548  wordList cellZoneNames;
549  if (args.optionFound("cellZones"))
550  {
551  cellZoneNames.append(args.optionReadList<word>("cellZones"));
552  }
553 
554  wordList rotatingZoneNames;
555  if (args.optionFound("rotatingZones"))
556  {
557  rotatingZoneNames.append(args.optionReadList<word>("rotatingZones"));
558  }
559 
560  wordList baffleNames;
561  if (args.optionFound("baffles"))
562  {
563  baffleNames.append(args.optionReadList<word>("baffles"));
564  }
565 
566  boundBox bb;
567  if (args.optionFound("bounds"))
568  {
569  List<vector> bounds(args.optionReadList<vector>("bounds"));
570 
571  if (bounds.size() != 2)
572  {
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: "
578  << bounds
579  << exit(FatalError);
580  }
581 
582  bb = boundBox(bounds[0], bounds[1]);
583  Info<< "Bounding box specified by '-bounds' option: "
584  << bb << endl;
585  }
586 
587  wordList inletRegions;
588  if (args.optionFound("inletRegions"))
589  {
590  inletRegions.append(args.optionReadList<word>("inletRegions"));
591  }
592 
593  wordList outletRegions;
594  if (args.optionFound("outletRegions"))
595  {
596  outletRegions.append(args.optionReadList<word>("outletRegions"));
597  }
598 
599  const bool closedDomain(args.optionFound("closedDomain"));
600 
601  meshingSurfaceList surfaces
602  (
603  runTime,
604  surfaceNames,
605  cellZoneNames,
606  rotatingZoneNames,
607  baffleNames,
608  bb,
609  inletRegions,
610  outletRegions,
611  closedDomain
612  );
613 
614  const Vector<label> nCells
615  (
617  );
618 
619  const label minDimCells
620  (
621  args.optionLookupOrDefault("minDimCells", 0)
622  );
623 
624  const label refineFactor
625  (
626  args.optionLookupOrDefault("refineBackground", 1)
627  );
628 
629  HashTable<Pair<word>> patchOpts(7);
630  patches.append("default");
631  forAll(patches, i)
632  {
633  readPatchOption(args, patchOpts, patches[i] + "Patch");
634  }
635 
636  const bool clearBoundary(args.optionFound("clearBoundary"));
637 
638  if (!args.optionFound("noBackground"))
639  {
640  if (args.optionFound("cylindricalBackground"))
641  {
642  blockMeshCylindricalConfiguration blockMeshConfig
643  (
644  "blockMeshDict",
645  dir,
646  runTime,
647  surfaces,
648  args.optionFound("bounds"),
649  nCells,
650  refineFactor,
651  patchOpts,
652  clearBoundary
653  );
654 
655  blockMeshConfig.write();
656  }
657  else
658  {
659  blockMeshCartesianConfiguration blockMeshConfig
660  (
661  "blockMeshDict",
662  dir,
663  runTime,
664  surfaces,
665  args.optionFound("bounds"),
666  nCells,
667  minDimCells,
668  refineFactor,
669  patchOpts,
670  clearBoundary
671  );
672 
673  blockMeshConfig.write();
674  }
675  }
676 
677  // snappyHexMeshDict options
678  const label refinementLevel
679  (
680  args.optionLookupOrDefault<label>("refinementLevel", 2)
681  );
682 
683  List<Tuple2<word, label>> surfaceLevels;
684  if (args.optionFound("surfaceLevels"))
685  {
686  surfaceLevels.append
687  (
688  args.optionReadList<Tuple2<word, label>>("surfaceLevels")
689  );
690  }
691 
693  if (args.optionFound("refinementRegions"))
694  {
695  refinementRegions.append
696  (
697  args.optionReadList<Tuple2<word, label>>("refinementRegions")
698  );
699  }
700 
701  List<Tuple3<vector, vector, label>> refinementBoxes;
702  if (args.optionFound("refinementBoxes"))
703  {
704  refinementBoxes.append
705  (
707  (
708  "refinementBoxes"
709  )
710  );
711  }
712 
713  List<Tuple3<word, scalar, label>> refinementDists;
714  if (args.optionFound("refinementDists"))
715  {
716  refinementDists.append
717  (
719  );
720  }
721 
722  const bool explicitFeatures(args.optionFound("explicitFeatures"));
723 
724  List<Tuple2<word, label>> layers;
725  if (args.optionFound("layers"))
726  {
727  layers.append
728  (
730  );
731  }
732 
733  const scalar firstLayerThickness
734  (
735  args.optionLookupOrDefault<scalar>("firstLayerThickness", 0)
736  );
737 
738  const scalar layerExpansionRatio
739  (
740  args.optionLookupOrDefault<scalar>("layerExpansionRatio", 1.2)
741  );
742 
743  if (args.optionFound("insidePoint") && args.optionFound("insidePoints"))
744  {
746  << "Options '-insidePoint' and '-insidePoints' "
747  << "cannot both be selected"
748  << exit(FatalError);
749  }
750 
752  bool insidePointsOpt(false);
753 
754  if (args.optionFound("insidePoints"))
755  {
756  insidePoints.append
757  (
758  args.optionReadList<point>("insidePoints")
759  );
760 
761  insidePointsOpt = true;
762  }
763  else
764  {
765  insidePoints.append
766  (
768  );
769  }
770 
771  const label nCellsBetweenLevels
772  (
773  args.optionLookupOrDefault<label>("nCellsBetweenLevels", 3)
774  );
775 
776  if (explicitFeatures)
777  {
778  surfaceFeaturesConfiguration surfaceFeaturesConfig
779  (
780  "surfaceFeaturesDict",
781  dir,
782  runTime,
783  surfaces
784  );
785 
786  surfaceFeaturesConfig.write();
787  }
788 
789  snappyHexMeshConfiguration snappyConfig
790  (
791  "snappyHexMeshDict",
792  dir,
793  runTime,
794  surfaces,
795  refinementLevel,
796  surfaceLevels,
798  refinementBoxes,
799  refinementDists,
800  explicitFeatures,
801  layers,
802  firstLayerThickness,
803  layerExpansionRatio,
804  insidePointsOpt,
805  insidePoints,
806  nCellsBetweenLevels
807  );
808 
809  snappyConfig.write();
810 
811  meshQualityConfiguration meshQualityConfig
812  (
813  "meshQualityDict",
814  dir,
815  runTime
816  );
817 
818  meshQualityConfig.write();
819 
820  Info<< "\nEnd\n" << endl;
821 
822  return 0;
823 }
824 
825 
826 // ************************************************************************* //
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:433
An STL-conforming hash table.
Definition: HashTable.H:127
void append(const T &)
Append an element at the end of the list.
Definition: ListI.H:178
void append(T *)
Append an element at the end of the list.
Definition: PtrListI.H:39
A 2-tuple for storing two objects of different types.
Definition: Tuple2.H:66
A 3-tuple for storing three objects of different types.
Definition: Tuple3.H:60
bool empty() const
Return true if the UList is empty (ie, size() is zero)
Definition: UListI.H:325
static const Form zero
Definition: VectorSpace.H:118
Extract command arguments and options from the supplied argc and argv parameters.
Definition: argList.H:103
static void addOption(const word &opt, const string &param="", const string &usage="")
Add to an option to validOptions with usage information.
Definition: argList.C:128
static void addNote(const string &)
Add extra notes for the usage information.
Definition: argList.C:159
T optionRead(const word &opt) const
Read a value from the named option.
Definition: argListI.H:244
static void addBoolOption(const word &opt, const string &usage="")
Add to a bool option to validOptions with usage information.
Definition: argList.C:118
bool optionFound(const word &opt) const
Return true if the named option is found.
Definition: argListI.H:114
const string & option(const word &opt) const
Return the argument string associated with the named option.
Definition: argListI.H:108
static string::size_type usageMin
Min offset for displaying usage (default: 20)
Definition: argList.H:168
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.
Definition: argListI.H:255
static string::size_type usageMax
Max screen width for displaying usage (default: 80)
Definition: argList.H:171
T optionLookupOrDefault(const word &opt, const T &deflt) const
Read a value from the named option if present.
Definition: argListI.H:294
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.
Definition: boundBox.H:59
A class for handling file names.
Definition: fileName.H:82
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.
Definition: word.H:62
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:334
int main(int argc, char *argv[])
Definition: financialFoam.C:44
const fvPatchList & patches
Namespace for OpenFOAM.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
bool rm(const fileName &)
Remove a file, returning true if successful otherwise false.
Definition: POSIX.C:1017
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
Definition: POSIX.C:290
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:258
const word & regionName(const solver &region)
Definition: solver.H:218
messageStream Info
bool isDir(const fileName &, const bool followLink=true)
Does the name exist as a directory in the file system?
Definition: POSIX.C:539
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
error FatalError
label count(const ListType &l, typename ListType::const_reference x)
Count the number of occurrences of a value in a list.
static const char nl
Definition: Ostream.H:267
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.
Definition: POSIX.C:662
insidePoints((1 2 3))
Foam::argList args(argc, argv)