surfaceInterpolateFields.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-2014 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::surfaceInterpolateFields
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  surfaceInterpolateFields1
44  {
45  type surfaceInterpolateFields;
46  functionObjectLibs ("libfieldFunctionObjects.so");
47  ...
48  fields ((p pNear)(U UNear));
49  }
50  \endverbatim
51 
52  \heading Function object 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  log | Log to standard output | no | yes
58  \endtable
59 
60 
61 SeeAlso
62  Foam::functionObject
63  Foam::OutputFilterFunctionObject
64 
65 SourceFiles
66  surfaceInterpolateFields.C
67  IOsurfaceInterpolateFields.H
68 
69 \*---------------------------------------------------------------------------*/
70 
71 #ifndef surfaceInterpolateFields_H
72 #define surfaceInterpolateFields_H
73 
74 #include "OFstream.H"
75 #include "surfaceFields.H"
76 #include "Tuple2.H"
77 
78 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
79 
80 namespace Foam
81 {
82 
83 // Forward declaration of classes
84 class objectRegistry;
85 class dictionary;
86 class mapPolyMesh;
87 
88 /*---------------------------------------------------------------------------*\
89  Class surfaceInterpolateFields Declaration
90 \*---------------------------------------------------------------------------*/
91 
92 class surfaceInterpolateFields
93 {
94 protected:
95 
96  // Protected data
97 
98  //- Name of this set of surfaceInterpolateFields object
99  word name_;
100 
101  const objectRegistry& obr_;
102 
103  //- on/off switch
104  bool active_;
105 
106  //- Fields to process
108 
109  //- Switch to send output to Info as well as to file
110  Switch log_;
111 
112  //- Locally constructed fields
118 
119 
120  // Protected Member Functions
121 
122  //- Disallow default bitwise copy construct
124 
125  //- Disallow default bitwise assignment
127 
128  template<class Type>
130  (
132  ) const;
133 
134 
135 public:
136 
137  //- Runtime type information
138  TypeName("surfaceInterpolateFields");
139 
140 
141  // Constructors
142 
143  //- Construct for given objectRegistry and dictionary.
144  // Allow the possibility to load fields from files
146  (
147  const word& name,
148  const objectRegistry&,
149  const dictionary&,
150  const bool loadFromFiles = false
151  );
152 
153 
154  //- Destructor
155  virtual ~surfaceInterpolateFields();
156 
157 
158  // Member Functions
159 
160  //- Return name of the surfaceInterpolateFields object
161  virtual const word& name() const
162  {
163  return name_;
164  }
165 
166  //- Read the field min/max data
167  virtual void read(const dictionary&);
168 
169  //- Execute, currently does nothing
170  virtual void execute();
171 
172  //- Execute at the final time-loop, currently does nothing
173  virtual void end();
174 
175  //- Called when time was set at the end of the Time::operator++
176  virtual void timeSet();
177 
178  //- Write
179  virtual void write();
180 
181  //- Update for changes of mesh
182  virtual void updateMesh(const mapPolyMesh&)
183  {}
184 
185  //- Update for changes of mesh
186  virtual void movePoints(const polyMesh&)
187  {}
188 };
189 
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 } // End namespace Foam
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 #ifdef NoRepository
199 #endif
200 
201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 
203 #endif
204 
205 // ************************************************************************* //
Foam::surfaceInterpolateFields::~surfaceInterpolateFields
virtual ~surfaceInterpolateFields()
Destructor.
Definition: surfaceInterpolateFields.C:69
Foam::surfaceInterpolateFields::svf_
PtrList< surfaceVectorField > svf_
Definition: surfaceInterpolateFields.H:133
Foam::Switch
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:60
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::surfaceInterpolateFields::updateMesh
virtual void updateMesh(const mapPolyMesh &)
Update for changes of mesh.
Definition: surfaceInterpolateFields.H:201
Foam::surfaceInterpolateFields::sSymmtf_
PtrList< surfaceSymmTensorField > sSymmtf_
Definition: surfaceInterpolateFields.H:135
Tuple2.H
Foam::surfaceInterpolateFields::name_
word name_
Name of this set of surfaceInterpolateFields object.
Definition: surfaceInterpolateFields.H:118
Foam::surfaceInterpolateFields::active_
bool active_
on/off switch
Definition: surfaceInterpolateFields.H:123
Foam::surfaceInterpolateFields::execute
virtual void execute()
Execute, currently does nothing.
Definition: surfaceInterpolateFields.C:85
Foam::surfaceInterpolateFields::sSpheretf_
PtrList< surfaceSphericalTensorField > sSpheretf_
Definition: surfaceInterpolateFields.H:134
surfaceFields.H
Foam::surfaceFields.
Foam::surfaceInterpolateFields::movePoints
virtual void movePoints(const polyMesh &)
Update for changes of mesh.
Definition: surfaceInterpolateFields.H:205
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
OFstream.H
Foam::surfaceInterpolateFields
This function object linearly interpolates volume fields to generate surface fields.
Definition: surfaceInterpolateFields.H:111
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:50
Foam::surfaceInterpolateFields::write
virtual void write()
Write.
Definition: surfaceInterpolateFields.C:121
Foam::surfaceInterpolateFields::interpolateFields
void interpolateFields(PtrList< GeometricField< Type, fvsPatchField, surfaceMesh > > &) const
Definition: surfaceInterpolateFieldsTemplates.C:34
Foam::surfaceInterpolateFields::timeSet
virtual void timeSet()
Called when time was set at the end of the Time::operator++.
Definition: surfaceInterpolateFields.C:115
Foam::PtrList
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:61
Foam::surfaceInterpolateFields::log_
Switch log_
Switch to send output to Info as well as to file.
Definition: surfaceInterpolateFields.H:129
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::surfaceInterpolateFields::read
virtual void read(const dictionary &)
Read the field min/max data.
Definition: surfaceInterpolateFields.C:75
Foam::surfaceInterpolateFields::TypeName
TypeName("surfaceInterpolateFields")
Runtime type information.
Foam::surfaceInterpolateFields::fieldSet_
List< Tuple2< word, word > > fieldSet_
Fields to process.
Definition: surfaceInterpolateFields.H:126
Foam::surfaceInterpolateFields::stf_
PtrList< surfaceTensorField > stf_
Definition: surfaceInterpolateFields.H:136
Foam::surfaceInterpolateFields::operator=
void operator=(const surfaceInterpolateFields &)
Disallow default bitwise assignment.
Foam::surfaceInterpolateFields::ssf_
PtrList< surfaceScalarField > ssf_
Locally constructed fields.
Definition: surfaceInterpolateFields.H:132
Foam::surfaceInterpolateFields::surfaceInterpolateFields
surfaceInterpolateFields(const surfaceInterpolateFields &)
Disallow default bitwise copy construct.
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::surfaceInterpolateFields::name
virtual const word & name() const
Return name of the surfaceInterpolateFields object.
Definition: surfaceInterpolateFields.H:180
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
surfaceInterpolateFieldsTemplates.C
List
Definition: Test.C:19
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52
Foam::surfaceInterpolateFields::end
virtual void end()
Execute at the final time-loop, currently does nothing.
Definition: surfaceInterpolateFields.C:109
Foam::surfaceInterpolateFields::obr_
const objectRegistry & obr_
Definition: surfaceInterpolateFields.H:120