Loading...
Searching...
No Matches
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-2023 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
28\*---------------------------------------------------------------------------*/
29
31
32{
33 forAll(regionNames, regioni)
34 {
35 const auto& 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// ************************************************************************* //
@ MUST_READ
Reading required.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition IOobject.H:191
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition PtrList.H:67
Mesh consisting of general polyhedral cells.
Definition polyMesh.H:79
static const word & regionName(const word &region)
The mesh region name or word::null if polyMesh::defaultRegion.
Definition polyMesh.C:796
engineTime & runTime
Foam::word regionName(args.getOrDefault< word >("region", Foam::polyMesh::defaultRegion))
Foam::PtrList< Foam::fvMesh > meshes(regionNames.size())
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:519
constexpr char nl
The newline '\n' character (0x0a).
Definition Ostream.H:50
#define forAll(list, i)
Loop across all elements in list.
Definition stdFoam.H:299