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