createFluidMeshes.H
Go to the documentation of this file.
1 const wordList fluidNames(rp["fluid"]);
2
3 PtrList<fvMesh> fluidRegions(fluidNames.size());
4
6 {
7 if (args.dryRun() || args.found("dry-run-write"))
8 {
9 Info
10 << "Operating in 'dry-run' mode:"
11 << " case will run for 1 time step. "
12 << "All checks assumed OK on a clean exit" << endl;
13
14 FieldBase::allowConstructFromLargerSize = true;
15
16 // Create a simplified 1D mesh and attempt to re-create boundary
17 // conditions
18 fluidRegions.set
19 (
20 i,
21 new simplifiedMeshes::columnFvMesh(runTime, fluidNames[i])
22 );
23
24 // Stop after 1 iteration of the simplified mesh
25
26 if (args.found("dry-run-write"))
27 {
28 // Using saWriteNow triggers function objects execute(), write()
29 runTime.stopAt(Time::saWriteNow);
30
31 // Make sure mesh gets output to the current time (since
32 // instance no longer constant)
33 fluidRegions[i].setInstance(runTime.timeName());
34 }
35 else
36 {
37 // Using saNoWriteNow triggers function objects execute(),
38 // but not write()
39 runTime.stopAt(Time::saNoWriteNow);
40 }
41
42 functionObject::outputPrefix = "postProcessing-dry-run";
43 }
44 else
45 {
46 Info<< "Create fluid mesh for region " << fluidNames[i]
47 << " for time = " << runTime.timeName() << nl << endl;
48
49 fluidRegions.set
50 (
51 i,
52 new fvMesh
53 (
54 IOobject
55 (
56 fluidNames[i],
57 runTime.timeName(),
58 runTime,
59 IOobject::MUST_READ
60 )
61 )
62 );
63 }
64 }
PtrList< fvMesh > fluidRegions(fluidNames.size())
const wordList fluidNames(rp["fluid"])
int dryRun() const noexcept
Return the dry-run flag.
Definition: argListI.H:116
bool found(const word &optName) const
Return true if the named option is found.
Definition: argListI.H:178
engineTime & runTime
regionProperties rp(runTime)
Foam::argList args(argc, argv)
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:333