createNamedDynamicFvMesh.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) 2012 OpenFOAM Foundation
9  Copyright (C) 2022 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 dynamicFvMesh for a specified region, or the defaultRegion
16 
17 Required Variables
18  - runTime [Time]
19 
20 Provided Variables
21  - regionName [word]
22  - mesh [dynamicFvMesh], meshPtr
23 
24 \*---------------------------------------------------------------------------*/
25 
28 
29 {
30  Foam::Info << "Create dynamic mesh";
31  if (args.readIfPresent("region", regionName))
32  {
33  Foam::Info << ' ' << regionName;
34  }
35  Foam::Info << " for time = " << runTime.timeName() << Foam::nl;
36 
38  (
39  IOobject
40  (
41  regionName,
42  runTime.timeName(),
43  runTime,
44  IOobject::MUST_READ
45  )
46  );
47 }
48 
49 
50 dynamicFvMesh& mesh = meshPtr();
51 
53 
54 
55 // ************************************************************************* //
constexpr char nl
The newline &#39;\n&#39; character (0x0a)
Definition: Ostream.H:49
engineTime & runTime
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:487
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
Foam::word regionName(Foam::polyMesh::defaultRegion)
dynamicFvMesh & mesh
Foam::autoPtr< Foam::dynamicFvMesh > meshPtr
A class for handling words, derived from Foam::string.
Definition: word.H:63
static word defaultRegion
Return the default region name.
Definition: polyMesh.H:397
messageStream Info
Information stream (stdout output on master, null elsewhere)
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
bool readIfPresent(const word &optName, T &val) const
Read a value from the named option if present.
Definition: argListI.H:316
Foam::argList args(argc, argv)