coded_zoneGenerator.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2026 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "coded_zoneGenerator.H"
28 
29 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
30 
31 namespace Foam
32 {
33  namespace zoneGenerators
34  {
36 
38  (
40  coded,
42  );
43  }
44 }
45 
46 
47 const Foam::wordList Foam::zoneGenerators::coded::codeKeys
48 {
49  "code",
50  "codeInclude"
51 };
52 
53 const Foam::wordList Foam::zoneGenerators::coded::codeDictVars
54 {
55  word::null,
56  word::null
57 };
58 
59 const Foam::word Foam::zoneGenerators::coded::codeOptions
60 (
61  "codedZoneGeneratorOptions"
62 );
63 
64 const Foam::wordList Foam::zoneGenerators::coded::compileFiles
65 {
66  "codedZoneGeneratorTemplate.C"
67 };
68 
69 const Foam::wordList Foam::zoneGenerators::coded::copyFiles
70 {
71  "codedZoneGeneratorTemplate.H"
72 };
73 
74 
75 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
76 
78 (
79  const word& name,
80  const polyMesh& mesh,
81  const dictionary& dict
82 )
83 :
85  codedBase
86  (
87  name,
88  dict,
89  codeKeys,
90  codeDictVars,
91  codeOptions,
92  compileFiles,
93  copyFiles
94  )
95 {
96  // Set verbose if debugging
97  varSubstitutions().set("verbose", Foam::name(bool(debug)));
98 
100 }
101 
102 
103 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
104 
106 {}
107 
108 
109 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
110 
112 {
113  if (!redirectZoneGeneratorPtr_.valid())
114  {
115  dictionary redirectDict;
116  redirectDict.set("type", codeName());
117 
118  redirectZoneGeneratorPtr_ = zoneGenerator::New
119  (
120  codeName(),
121  mesh_,
122  redirectDict
123  );
124  }
125 
126  return redirectZoneGeneratorPtr_->generate();
127 }
128 
129 
130 // ************************************************************************* //
Macros for easy insertion into run-time selection tables.
Base class for coded functionObjects, fvModels, Function1, Function2.
Definition: codedBase.H:53
bool updateLibrary(const dictionary &dict) const
Update library from given updated dictionary as required.
Definition: codedBase.C:230
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
HashTable< string > & varSubstitutions()
Definition: dynamicCode.H:252
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:78
A class for handling words, derived from string.
Definition: word.H:63
Abstract base class for all zoneGenerators, providing runtime selection.
Definition: zoneGenerator.H:57
static autoPtr< zoneGenerator > New(const word &name, const polyMesh &mesh, const dictionary &dict)
Select constructed from name, mesh and dictionary.
Definition: zoneGenerator.C:66
virtual zoneSet generate() const
Generate and return the zoneSet.
coded(const word &name, const polyMesh &mesh, const dictionary &dict)
Construct from name, polyMesh and dictionary.
Zone container returned by zoneGenerator::generate.
Definition: zoneSet.H:94
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
defineTypeNameAndDebug(cylinderHeadPoints, 0)
addToRunTimeSelectionTable(zoneGenerator, cylinderHeadPoints, dictionary)
Namespace for OpenFOAM.
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
dictionary dict