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-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::functionObjects::readFields
26 
27 Group
28  grpFieldFunctionObjects
29 
30 Description
31  Reads fields from the time directories and adds them to the mesh database
32  for further post-processing.
33 
34  Example of function object specification:
35  \verbatim
36  readFields1
37  {
38  type readFields;
39  libs ("libfieldFunctionObjects.so");
40  ...
41  fields
42  (
43  U
44  p
45  );
46  }
47  \endverbatim
48 
49 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 See also
57  Foam::functionObjects::fvMeshFunctionObject
58 
59 SourceFiles
60  readFields.C
61 
62 \*---------------------------------------------------------------------------*/
63 
64 #ifndef functionObjects_readFields_H
65 #define functionObjects_readFields_H
66 
67 #include "fvMeshFunctionObject.H"
68 #include "volFieldsFwd.H"
69 #include "surfaceFieldsFwd.H"
70 
71 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
72 
73 namespace Foam
74 {
75 namespace functionObjects
76 {
77 
78 /*---------------------------------------------------------------------------*\
79  Class readFields Declaration
80 \*---------------------------------------------------------------------------*/
81 
82 class readFields
83 :
84  public fvMeshFunctionObject
85 {
86 protected:
87 
88  // Protected data
89 
90  //- Fields to load
92 
93  //- Loaded fields
94  PtrList<volScalarField> vsf_;
95  PtrList<volVectorField> vvf_;
99 
106 
107  // Protected Member Functions
109  template<class Type>
111  (
112  const word&,
115  ) const;
118 private:
119 
120  // Private member functions
121 
122  //- Disallow default bitwise copy construct
123  readFields(const readFields&);
124 
125  //- Disallow default bitwise assignment
126  void operator=(const readFields&);
127 
128 
129 public:
130 
131  //- Runtime type information
132  TypeName("readFields");
133 
134 
135  // Constructors
136 
137  //- Construct for given objectRegistry and dictionary.
138  // Allow the possibility to load fields from files
139  readFields
140  (
141  const word& name,
142  const Time& runTime,
143  const dictionary& dict
144  );
145 
146 
147  //- Destructor
148  virtual ~readFields();
149 
150 
151  // Member Functions
152 
153  //- Read the set of fields from dictionary
154  virtual bool read(const dictionary&);
155 
156  //- Read the fields
157  virtual bool execute();
158 
159  //- Do nothing
160  virtual bool write();
161 };
162 
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 } // End namespace functionObjects
167 } // End namespace Foam
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 #ifdef NoRepository
172  #include "readFieldsTemplates.C"
173 #endif
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 #endif
178 
179 // ************************************************************************* //
dictionary dict
const word & name() const
Return the name of this functionObject.
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const HashSet< word > &selectedFields, LIFOStack< regIOobject *> &storedObjects)
Read the selected GeometricFields of the specified type.
Definition: ReadFields.C:244
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
PtrList< volSphericalTensorField > vSpheretf_
Definition: readFields.H:110
PtrList< surfaceSphericalTensorField > sSpheretf_
Definition: readFields.H:116
PtrList< surfaceVectorField > svf_
Definition: readFields.H:115
PtrList< surfaceTensorField > stf_
Definition: readFields.H:118
void loadField(const word &, PtrList< GeometricField< Type, fvPatchField, volMesh >> &, PtrList< GeometricField< Type, fvsPatchField, surfaceMesh >> &) const
wordList fieldSet_
Fields to load.
Definition: readFields.H:105
Generic GeometricField class.
PtrList< volSymmTensorField > vSymmtf_
Definition: readFields.H:111
PtrList< surfaceSymmTensorField > sSymmtf_
Definition: readFields.H:117
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:68
PtrList< volVectorField > vvf_
Definition: readFields.H:109
virtual bool read(const dictionary &)
Read the set of fields from dictionary.
Definition: readFields.C:67
virtual bool execute()
Read the fields.
Definition: readFields.C:77
A class for handling words, derived from string.
Definition: word.H:59
PtrList< volTensorField > vtf_
Definition: readFields.H:112
virtual bool write()
Do nothing.
Definition: readFields.C:108
PtrList< surfaceScalarField > ssf_
Definition: readFields.H:114
Reads fields from the time directories and adds them to the mesh database for further post-processing...
Definition: readFields.H:96
virtual ~readFields()
Destructor.
Definition: readFields.C:61
List< word > wordList
A List of words.
Definition: fileName.H:54
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
TypeName("readFields")
Runtime type information.
PtrList< volScalarField > vsf_
Loaded fields.
Definition: readFields.H:108
Namespace for OpenFOAM.