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 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
12 
13 Description
14  Create single or multiple polyMesh regions based on the
15  wordList 'regionNames'
16 
17 Required Variables
18  - runTime [Time]
19  - regionNames [wordList]
20 
21 Provided Variables
22  - meshes [PtrList<polyMesh>]
23 
24 See Also
25  addAllRegionOptions.H
26  getAllRegionOptions.H
27 
28 \*---------------------------------------------------------------------------*/
29 
31 
32 {
33  forAll(regionNames, regioni)
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,
51  new Foam::polyMesh
52  (
54  (
55  regionName,
56  runTime.timeName(),
57  runTime,
59  )
60  )
61  );
62  }
63 
65 }
66 
67 
68 // ************************************************************************* //
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
wordList regionNames
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:413
Foam::word regionName(Foam::polyMesh::defaultRegion)
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
Foam::PtrList< Foam::polyMesh > meshes(regionNames.size())
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
Definition: List.H:55
messageStream Info
Information stream (stdout output on master, null elsewhere)
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:73
Defines the attributes of an object for which implicit objectRegistry management is supported...
Definition: IOobject.H:166