createMesh.H
Go to the documentation of this file.
3 
4 if (args.found("dry-run") || args.found("dry-run-write"))
5 {
7  << "Operating in 'dry-run' mode: case will run for 1 time step. "
8  << "All checks assumed OK on a clean exit" << Foam::endl;
9 
10  // Allow region in combination with dry-run
11  args.readIfPresent("region", regionName);
12 
14 
15  // Create a simplified 1D mesh and attempt to re-create boundary conditions
17  (
19  );
20 
21  // Stop after 1 iteration of the simplified mesh
22 
23  if (args.found("dry-run-write"))
24  {
25  // Using saWriteNow triggers function objects execute(), write()
27 
28  // Make sure mesh gets output to the current time (since instance
29  // no longer constant)
30  meshPtr().setInstance(runTime.timeName());
31  }
32  else
33  {
34  // Using saNoWriteNow triggers function objects execute(),
35  // but not write()
37  }
38 
39  Foam::functionObject::outputPrefix = "postProcessing-dry-run";
40 }
41 else
42 {
43  if (args.readIfPresent("region", regionName))
44  {
46  << "Create mesh " << regionName << " for time = "
47  << runTime.timeName() << Foam::nl << Foam::endl;
48  }
49  else
50  {
52  << "Create mesh for time = "
53  << runTime.timeName() << Foam::nl << Foam::endl;
54  }
55 
57  (
58  new Foam::fvMesh
59  (
61  (
62  regionName,
63  runTime.timeName(),
64  runTime,
66  ),
67  false
68  )
69  );
70  meshPtr().init(true); // initialise all (lower levels and current)
71 }
72 
runTime
engineTime & runTime
Definition: createEngineTime.H:13
Foam::autoPtr::reset
void reset(T *p=nullptr) noexcept
Delete managed object and set to new given pointer.
Definition: autoPtrI.H:109
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:104
meshPtr
Foam::autoPtr< Foam::fvMesh > meshPtr(nullptr)
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::polyMesh::defaultRegion
static word defaultRegion
Return the default region name.
Definition: polyMesh.H:318
Foam::FieldBase::allowConstructFromLargerSize
static bool allowConstructFromLargerSize
Definition: FieldBase.H:61
regionName
Foam::word regionName
Definition: createMesh.H:2
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:350
Foam::argList::readIfPresent
bool readIfPresent(const word &optName, T &val) const
Read a value from the named option if present.
Definition: argListI.H:296
Foam::Info
messageStream Info
Information stream (uses stdout - output is on the master only)
Foam::Time::saNoWriteNow
Adjust endTime to stop immediately w/o writing.
Definition: Time.H:100
Foam::functionObject::outputPrefix
static word outputPrefix
Directory prefix.
Definition: functionObject.H:352
mesh
Foam::fvMesh & mesh
Definition: createMesh.H:73
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:83
Foam::autoPtr< Foam::fvMesh >
Foam::Time::saWriteNow
adjust endTime to stop immediately w/ writing
Definition: Time.H:101
Foam::nl
constexpr char nl
Definition: Ostream.H:385
Foam::simplifiedMeshes::columnFvMesh
Generates a 1D column representation of a mesh based on an existing mesh and/or fields.
Definition: columnFvMesh.H:136
args
Foam::argList args(argc, argv)
Foam::argList::found
bool found(const word &optName) const
Return true if the named option is found.
Definition: argListI.H:151
Foam::IOobject::MUST_READ
Definition: IOobject.H:120