createNamedPolyMeshes.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) 2022 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
12
13Description
14 Create single or multiple polyMesh regions based on the
15 wordList 'regionNames'
16
17Required Variables
18 - runTime [Time]
19 - regionNames [wordList]
20
21Provided Variables
22 - meshes [PtrList<polyMesh>]
23
24See Also
25 addAllRegionOptions.H
26 getAllRegionOptions.H
27
28\*---------------------------------------------------------------------------*/
29
31
32{
34 {
35 const Foam::word& regionName = regionNames[regioni];
36
37 Foam::Info<< "Create polyMesh";
38 if
39 (
40 regionNames.size() > 1
42 )
43 {
44 Foam::Info<< ' ' << regionName;
45 }
46 Foam::Info<< " for time = " << runTime.timeName() << Foam::nl;
47
48 meshes.set
49 (
50 regioni,
52 (
54 (
56 runTime.timeName(),
57 runTime,
59 )
60 )
61 );
62 }
63
65}
66
67
68// ************************************************************************* //
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:170
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: PtrList.H:73
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
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
engineTime & runTime
Foam::word regionName(Foam::polyMesh::defaultRegion)
Foam::PtrList< Foam::polyMesh > meshes(regionNames.size())
wordList regionNames
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
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:333