createNamedMesh.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011 OpenFOAM Foundation
9  Copyright (C) 2021 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
13 
14 Description
15  Create a fvMesh for a specified region, or the defaultRegion
16 
17 Required Variables
18  - args [argList]
19  - runTime [Time]
20 
21 Provided Variables
22  - regionName [word]
23  - mesh [fvMesh]
24 
25 \*---------------------------------------------------------------------------*/
26 
28 
29 {
30  if (args.readIfPresent("region", regionName))
31  {
32  Foam::Info << "Create mesh " << regionName;
33  }
34  else
35  {
36  Foam::Info << "Create mesh";
37  }
38  Foam::Info << " for time = " << runTime.timeName() << Foam::nl;
39 }
40 
41 
43 (
45  (
46  regionName,
47  runTime.timeName(),
48  runTime,
50  ),
51  false
52 );
53 
54 mesh.init(true); // Initialise all (lower levels and current)
55 
57 
58 
59 // ************************************************************************* //
runTime
engineTime & runTime
Definition: createEngineTime.H:13
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:169
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::polyMesh::defaultRegion
static word defaultRegion
Return the default region name.
Definition: polyMesh.H:318
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:369
Foam::argList::readIfPresent
bool readIfPresent(const word &optName, T &val) const
Read a value from the named option if present.
Definition: argListI.H:323
regionName
Foam::word regionName(Foam::polyMesh::defaultRegion)
Foam::Info
messageStream Info
Information stream (stdout output on master, null elsewhere)
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam::fvMesh::init
virtual bool init(const bool doInit)
Initialise all non-demand-driven data.
Definition: fvMesh.C:276
Foam::nl
constexpr char nl
Definition: Ostream.H:404
args
Foam::argList args(argc, argv)
mesh
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.timeName(), runTime, Foam::IOobject::MUST_READ), false)
Foam::IOobject::MUST_READ
Definition: IOobject.H:185