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 pInterp)(U UInterp));
46  }
47  \endverbatim
48 
49 Usage
50  \table
51  Property | Description | Required | Default value
52  type | type name: surfaceInterpolate | yes |
53  fields | list of fields with corresponding output field names | yes |
54  \endtable
55 
56 See also
57  Foam::functionObjects::fvMeshFunctionObject
58  Foam::functionObjects::timeControl
59 
60 SourceFiles
61  surfaceInterpolate.C
62 
63 \*---------------------------------------------------------------------------*/
64 
65 #ifndef functionObjects_surfaceInterpolate_H
66 #define functionObjects_surfaceInterpolate_H
67 
68 #include "fvMeshFunctionObject.H"
69 #include "surfaceFieldsFwd.H"
70 #include "Tuple2.H"
71 
72 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
73 
74 namespace Foam
75 {
76 
77 // Forward declaration of classes
78 class objectRegistry;
79 class dictionary;
80 class mapPolyMesh;
81 
82 namespace functionObjects
83 {
84 
85 /*---------------------------------------------------------------------------*\
86  Class surfaceInterpolate Declaration
87 \*---------------------------------------------------------------------------*/
88 
89 class surfaceInterpolate
90 :
91  public fvMeshFunctionObject
92 {
93 protected:
94 
95  // Protected data
96 
97  //- Fields to process
98  List<Tuple2<word, word>> fieldSet_;
99 
100  //- Locally constructed fields
101  PtrList<surfaceScalarField> ssf_;
102  PtrList<surfaceVectorField> svf_;
106 
107 
108  // Protected Member Functions
109 
110  template<class Type>
111  void interpolateFields
112  (
114  ) const;
117 public:
119  //- Runtime type information
120  TypeName("surfaceInterpolate");
121 
122 
123  // Constructors
124 
125  //- Construct for given objectRegistry and dictionary.
126  // Allow the possibility to load fields from files
128  (
129  const word& name,
130  const Time& runTime,
131  const dictionary& dict
132  );
133 
134  //- Disallow default bitwise copy construction
135  surfaceInterpolate(const surfaceInterpolate&) = delete;
136 
137 
138  //- Destructor
139  virtual ~surfaceInterpolate();
140 
141 
142  // Member Functions
143 
144  //- Read the controls
145  virtual bool read(const dictionary&);
146 
147  //- Calculate the interpolated fields
148  virtual bool execute();
149 
150  //- Write the interpolated fields
151  virtual bool write();
152 
153 
154  // Member Operators
155 
156  //- Disallow default bitwise assignment
157  void operator=(const surfaceInterpolate&) = delete;
158 };
159 
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 } // End namespace functionObjects
164 } // End namespace Foam
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 #ifdef NoRepository
170 #endif
171 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 
174 #endif
175 
176 // ************************************************************************* //
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.