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-2018 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 private:
120  // Private member functions
121 
122  //- Disallow default bitwise copy construct
124 
125  //- Disallow default bitwise assignment
126  void operator=(const surfaceInterpolate&);
127 
128 
129 public:
130 
131  //- Runtime type information
132  TypeName("surfaceInterpolate");
133 
134 
135  // Constructors
136 
137  //- Construct for given objectRegistry and dictionary.
138  // Allow the possibility to load fields from files
140  (
141  const word& name,
142  const Time& runTime,
143  const dictionary& dict
144  );
145 
146 
147  //- Destructor
148  virtual ~surfaceInterpolate();
149 
150 
151  // Member Functions
152 
153  //- Read the controls
154  virtual bool read(const dictionary&);
155 
156  //- Calculate the interpolated fields
157  virtual bool execute();
158 
159  //- Write the interpolated fields
160  virtual bool write();
161 };
162 
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 } // End namespace functionObjects
167 } // End namespace Foam
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 #ifdef NoRepository
173 #endif
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 #endif
178 
179 // ************************************************************************* //
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:137
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.
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:63
virtual bool read(const dictionary &)
Read the controls.
PtrList< surfaceScalarField > ssf_
Locally constructed fields.
virtual bool execute()
Calculate the interpolated fields.
Namespace for OpenFOAM.