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-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
13
14Description
15 Create a dynamicFvMesh for a specified region, or the defaultRegion
16
17Required Variables
18 - runTime [Time]
19
20Provided 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 {
34 }
35 Foam::Info << " for time = " << runTime.timeName() << Foam::nl;
36
37 meshPtr = dynamicFvMesh::New
38 (
39 IOobject
40 (
42 runTime.timeName(),
43 runTime,
44 IOobject::MUST_READ
45 )
46 );
47}
48
49
50dynamicFvMesh& mesh = meshPtr();
51
53
54
55// ************************************************************************* //
bool readIfPresent(const word &optName, T &val) const
Read a value from the named option if present.
Definition: argListI.H:323
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
static word defaultRegion
Return the default region name.
Definition: polyMesh.H:321
A class for handling words, derived from Foam::string.
Definition: word.H:68
dynamicFvMesh & mesh
engineTime & runTime
Foam::autoPtr< Foam::dynamicFvMesh > meshPtr
Foam::word regionName(Foam::polyMesh::defaultRegion)
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:372
constexpr char nl
The newline '\n' character (0x0a)
Definition: Ostream.H:53
Foam::argList args(argc, argv)