surfaceInterpolate.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) 2011-2019 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::functionObjects::surfaceInterpolate
26 
27 Description
28  Linearly interpolates volume fields to generate surface fields.
29 
30  Fields are stored
31  - every time step the field is updated with new values
32  - at output it writes the fields
33 
34  This functionObject can either be used
35  - to calculate a new field as a post-processing step or
36  - since the fields are registered, used in another functionObject
37 
38  Example of function object specification:
39  \verbatim
40  surfaceInterpolate1
41  {
42  type surfaceInterpolate;
43  libs ("libfieldFunctionObjects.so");
44  ...
45  fields ((p pNear)(U UNear));
46  }
47  \endverbatim
48 
49 Usage
50  \table
51  Property | Description | Required | Default value
52  type | type name: nearWallFields | yes |
53  fields | list of fields with corresponding output field names | yes |
54  \endtable
55 
56 
57 See also
58  Foam::functionObjects::fvMeshFunctionObject
59  Foam::functionObjects::timeControl
60 
61 SourceFiles
62  surfaceInterpolate.C
63 
64 \*---------------------------------------------------------------------------*/
65 
66 #ifndef functionObjects_surfaceInterpolate_H
67 #define functionObjects_surfaceInterpolate_H
68 
69 #include "fvMeshFunctionObject.H"
70 #include "surfaceFieldsFwd.H"
71 #include "Tuple2.H"
72 
73 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
74 
75 namespace Foam
76 {
77 
78 // Forward declaration of classes
79 class objectRegistry;
80 class dictionary;
81 class mapPolyMesh;
82 
83 namespace functionObjects
84 {
85 
86 /*---------------------------------------------------------------------------*\
87  Class surfaceInterpolate Declaration
88 \*---------------------------------------------------------------------------*/
89 
90 class surfaceInterpolate
91 :
92  public fvMeshFunctionObject
93 {
94 protected:
95 
96  // Protected data
97 
98  //- Fields to process
99  List<Tuple2<word, word>> fieldSet_;
100 
101  //- Locally constructed fields
102  PtrList<surfaceScalarField> ssf_;
103  PtrList<surfaceVectorField> svf_;
107 
108 
109  // Protected Member Functions
110 
111  template<class Type>
112  void interpolateFields
113  (
115  ) const;
118 public:
120  //- Runtime type information
121  TypeName("surfaceInterpolate");
122 
123 
124  // Constructors
125 
126  //- Construct for given objectRegistry and dictionary.
127  // Allow the possibility to load fields from files
129  (
130  const word& name,
131  const Time& runTime,
132  const dictionary& dict
133  );
134 
135  //- Disallow default bitwise copy construction
136  surfaceInterpolate(const surfaceInterpolate&) = delete;
137 
138 
139  //- Destructor
140  virtual ~surfaceInterpolate();
141 
142 
143  // Member Functions
144 
145  //- Read the controls
146  virtual bool read(const dictionary&);
147 
148  //- Calculate the interpolated fields
149  virtual bool execute();
150 
151  //- Write the interpolated fields
152  virtual bool write();
153 
154 
155  // Member Operators
156 
157  //- Disallow default bitwise assignment
158  void operator=(const surfaceInterpolate&) = delete;
159 };
160 
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 } // End namespace functionObjects
165 } // End namespace Foam
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 #ifdef NoRepository
171 #endif
172 
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 
175 #endif
176 
177 // ************************************************************************* //
Linearly interpolates volume fields to generate surface fields.
dictionary dict
const word & name() const
Return the name of this functionObject.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
engineTime & runTime
Generic GeometricField class.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:68
PtrList< surfaceSymmTensorField > sSymmtf_
List< Tuple2< word, word > > fieldSet_
Fields to process.
void interpolateFields(PtrList< GeometricField< Type, fvsPatchField, surfaceMesh >> &) const
A class for handling words, derived from string.
Definition: word.H:59
virtual bool write()
Write the interpolated fields.
TypeName("surfaceInterpolate")
Runtime type information.
void operator=(const surfaceInterpolate &)=delete
Disallow default bitwise assignment.
PtrList< surfaceSphericalTensorField > sSpheretf_
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:70
surfaceInterpolate(const word &name, const Time &runTime, const dictionary &dict)
Construct for given objectRegistry and dictionary.
virtual bool read(const dictionary &)
Read the controls.
PtrList< surfaceScalarField > ssf_
Locally constructed fields.
virtual bool execute()
Calculate the interpolated fields.
Namespace for OpenFOAM.