createSolidMeshes.H
Go to the documentation of this file.
1 const wordList solidNames(rp["solid"]);
2
3 PtrList<fvMesh> solidRegions(solidNames.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 solidRegions.set
19 (
20 i,
21 new simplifiedMeshes::columnFvMesh(runTime, solidNames[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 solidRegions[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 solid mesh for region " << solidNames[i]
47 << " for time = " << runTime.timeName() << nl << endl;
48
49 solidRegions.set
50 (
51 i,
52 new fvMesh
53 (
54 IOobject
55 (
56 solidNames[i],
57 runTime.timeName(),
58 runTime,
59 IOobject::MUST_READ
60 )
61 )
62 );
63
64 // Force calculation of geometric properties to prevent it being
65 // done
66 // later in e.g. some boundary evaluation
67 //(void)solidRegions[i].weights();
68 //(void)solidRegions[i].deltaCoeffs();
69 }
70 }
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)
const wordList solidNames(rp["solid"])
PtrList< fvMesh > solidRegions(solidNames.size())
Foam::argList args(argc, argv)
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:333