Zonal_DimensionedFvPatchFieldFunction.H
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 Class
25  Foam::DimensionedFieldFunctions::Zonal
26 
27 Description
28 
29 SourceFiles
30  Zonal_DimensionedFieldFunction.C
31 
32 \*---------------------------------------------------------------------------*/
33 
34 #ifndef Zonal_DimensionedFvPatchFieldFunction_H
35 #define Zonal_DimensionedFvPatchFieldFunction_H
36 
38 
39 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
40 
41 namespace Foam
42 {
43 namespace DimensionedFieldFunctions
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class Zonal Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 template<class DimensionedFieldType>
51 class Zonal
52 :
53  public DimensionedFieldFunction<DimensionedFieldType>
54 {
55  typedef typename DimensionedFieldType::Type_ Type;
56  typedef typename DimensionedFieldType::GeoMesh_::Zone Zone;
57 
58  Type value_;
59  dictionary zonesDict_;
60 
61 
62 public:
63 
64  //- Runtime type information
65  TypeName("zonal");
66 
67 
68  // Constructors
69 
70  //- Construct with dictionary to initialise given field
71  Zonal
72  (
73  const dictionary& dict,
74  DimensionedFieldType& field
75  );
76 
77  //- Construct a copy for the given field
78  Zonal
79  (
80  const Zonal& dff,
81  DimensionedFieldType& field
82  );
83 
84  //- Construct and return a clone for the specified field
86  clone(DimensionedFieldType& field) const;
87 
88 
89  //- Destructor
90  virtual ~Zonal()
91  {}
92 
93 
94  // Member Functions
95 
96  //- Evaluate the function and set the field
97  virtual void evaluate();
98 
99  //- Write data to dictionary stream
100  virtual void write(Ostream& os) const;
101 };
102 
103 
104 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
105 
106 } // End namespace DimensionedFieldFunctions
107 } // End namespace Foam
108 
109 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
110 
111 #ifdef NoRepository
113 #endif
114 
115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116 
117 #endif
118 
119 // ************************************************************************* //
virtual autoPtr< DimensionedFieldFunction< DimensionedFieldType > > clone() const
Construct and return a clone for the specified field.
Zonal internal and patch field initialisation function.
Zonal(const dictionary &dict, DimensionedFieldType &field)
Construct with dictionary to initialise given field.
virtual void evaluate()
Evaluate the function and set the field.
virtual void write(Ostream &os) const
Write data to dictionary stream.
TypeName("zonal")
Runtime type information.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Namespace for OpenFOAM.
dictionary dict