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