readFields.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::readFields
26 
27 Group
28  grpFieldFunctionObjects
29 
30 Description
31  This function object reads fields from the time directories and adds them to
32  the mesh database for further post-processing.
33 
34  Example of function object specification:
35  \verbatim
36  readFields1
37  {
38  type readFields;
39  functionObjectLibs ("libfieldFunctionObjects.so");
40  ...
41  fields
42  (
43  U
44  p
45  );
46  }
47  \endverbatim
48 
49  \heading Function object usage
50  \table
51  Property | Description | Required | Default value
52  type | type name: readFields | yes |
53  fields | list of fields to read | no |
54  \endtable
55 
56 SeeAlso
57  Foam::functionObject
58  Foam::OutputFilterFunctionObject
59 
60 SourceFiles
61  readFields.C
62  IOreadFields.H
63 
64 \*---------------------------------------------------------------------------*/
65 
66 #ifndef readFields_H
67 #define readFields_H
68 
69 #include "OFstream.H"
70 #include "pointFieldFwd.H"
71 #include "volFields.H"
72 #include "surfaceFields.H"
73 
74 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
75 
76 namespace Foam
77 {
78 
79 // Forward declaration of classes
80 class objectRegistry;
81 class dictionary;
82 class mapPolyMesh;
83 
84 /*---------------------------------------------------------------------------*\
85  Class readFields Declaration
86 \*---------------------------------------------------------------------------*/
87 
88 class readFields
89 {
90 protected:
91 
92  // Protected data
93 
94  //- Name of this set of readFields object
95  word name_;
96 
97  const objectRegistry& obr_;
98 
99  //- on/off switch
100  bool active_;
101 
102  //- Fields to load
104 
105  //- Loaded fields
118 
119  // Protected Member Functions
121  //- Disallow default bitwise copy construct
124  //- Disallow default bitwise assignment
125  void operator=(const readFields&);
127  template<class Type>
129  (
130  const word&,
133  ) const;
134 
135 
136 public:
137 
138  //- Runtime type information
139  TypeName("readFields");
140 
141 
142  // Constructors
143 
144  //- Construct for given objectRegistry and dictionary.
145  // Allow the possibility to load fields from files
146  readFields
147  (
148  const word& name,
149  const objectRegistry&,
150  const dictionary&,
151  const bool loadFromFiles = false
152  );
153 
154 
155  //- Destructor
156  virtual ~readFields();
157 
158 
159  // Member Functions
160 
161  //- Return name of the readFields object
162  virtual const word& name() const
163  {
164  return name_;
165  }
166 
167  //- Read the field min/max data
168  virtual void read(const dictionary&);
169 
170  //- Execute, currently does nothing
171  virtual void execute();
172 
173  //- Execute at the final time-loop, currently does nothing
174  virtual void end();
175 
176  //- Called when time was set at the end of the Time::operator++
177  virtual void timeSet();
178 
179  //- Write
180  virtual void write();
181 
182  //- Update for changes of mesh
183  virtual void updateMesh(const mapPolyMesh&)
184  {}
185 
186  //- Update for changes of mesh
187  virtual void movePoints(const polyMesh&)
188  {}
189 };
190 
191 
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 
194 } // End namespace Foam
195 
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 #ifdef NoRepository
199 # include "readFieldsTemplates.C"
200 #endif
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 
204 #endif
205 
206 // ************************************************************************* //
virtual void timeSet()
Called when time was set at the end of the Time::operator++.
Definition: readFields.C:133
Foam::surfaceFields.
virtual void write()
Write.
Definition: readFields.C:139
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
PtrList< surfaceTensorField > stf_
Definition: readFields.H:130
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
TypeName("readFields")
Runtime type information.
PtrList< surfaceSphericalTensorField > sSpheretf_
Definition: readFields.H:128
PtrList< surfaceVectorField > svf_
Definition: readFields.H:127
A class for handling words, derived from string.
Definition: word.H:59
virtual ~readFields()
Destructor.
Definition: readFields.C:77
PtrList< volSphericalTensorField > vSpheretf_
Definition: readFields.H:122
virtual void end()
Execute at the final time-loop, currently does nothing.
Definition: readFields.C:124
virtual void movePoints(const polyMesh &)
Update for changes of mesh.
Definition: readFields.H:201
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
virtual const word & name() const
Return name of the readFields object.
Definition: readFields.H:176
PtrList< volScalarField > vsf_
Loaded fields.
Definition: readFields.H:120
Namespace for OpenFOAM.
virtual void read(const dictionary &)
Read the field min/max data.
Definition: readFields.C:83
const objectRegistry & obr_
Definition: readFields.H:111
PtrList< surfaceSymmTensorField > sSymmtf_
Definition: readFields.H:129
readFields(const readFields &)
Disallow default bitwise copy construct.
void readFields(const Mesh &mesh, const IOobjectList &objects, PtrList< GeoField > &fields)
PtrList< volTensorField > vtf_
Definition: readFields.H:124
bool active_
on/off switch
Definition: readFields.H:114
void loadField(const word &, PtrList< GeometricField< Type, fvPatchField, volMesh > > &, PtrList< GeometricField< Type, fvsPatchField, surfaceMesh > > &) const
PtrList< volVectorField > vvf_
Definition: readFields.H:121
PtrList< surfaceScalarField > ssf_
Definition: readFields.H:126
Generic GeometricField class.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
virtual void execute()
Execute, currently does nothing.
Definition: readFields.C:92
void operator=(const readFields &)
Disallow default bitwise assignment.
Registry of regIOobjects.
word name_
Name of this set of readFields object.
Definition: readFields.H:109
This function object reads fields from the time directories and adds them to the mesh database for fu...
Definition: readFields.H:102
wordList fieldSet_
Fields to load.
Definition: readFields.H:117
PtrList< volSymmTensorField > vSymmtf_
Definition: readFields.H:123
virtual void updateMesh(const mapPolyMesh &)
Update for changes of mesh.
Definition: readFields.H:197