readFields.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2019 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 Description
28  Reads fields from the time directories and adds them to the mesh database
29  for further post-processing.
30 
31  Example of function object specification:
32  \verbatim
33  readFields1
34  {
35  type readFields;
36  libs ("libfieldFunctionObjects.so");
37  ...
38  fields
39  (
40  U
41  p
42  );
43  }
44  \endverbatim
45 
46 Usage
47  \table
48  Property | Description | Required | Default value
49  type | type name: readFields | yes |
50  fields | list of fields to read | no |
51  \endtable
52 
53 See also
54  Foam::functionObjects::fvMeshFunctionObject
55 
56 SourceFiles
57  readFields.C
58 
59 \*---------------------------------------------------------------------------*/
60 
61 #ifndef functionObjects_readFields_H
62 #define functionObjects_readFields_H
63 
64 #include "fvMeshFunctionObject.H"
65 #include "volFieldsFwd.H"
66 #include "surfaceFieldsFwd.H"
67 
68 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
69 
70 namespace Foam
71 {
72 namespace functionObjects
73 {
74 
75 /*---------------------------------------------------------------------------*\
76  Class readFields Declaration
77 \*---------------------------------------------------------------------------*/
78 
79 class readFields
80 :
81  public fvMeshFunctionObject
82 {
83 protected:
84 
85  // Protected data
86 
87  //- Fields to load
89 
90  //- Loaded fields
91  PtrList<volScalarField> vsf_;
92  PtrList<volVectorField> vvf_;
96 
103 
104  // Protected Member Functions
106  template<class Type>
108  (
109  const word&,
112  ) const;
115 public:
116 
117  //- Runtime type information
118  TypeName("readFields");
119 
120 
121  // Constructors
122 
123  //- Construct for given objectRegistry and dictionary.
124  // Allow the possibility to load fields from files
125  readFields
126  (
127  const word& name,
128  const Time& runTime,
129  const dictionary& dict
130  );
131 
132  //- Disallow default bitwise copy construction
133  readFields(const readFields&) = delete;
134 
135 
136  //- Destructor
137  virtual ~readFields();
138 
139 
140  // Member Functions
141 
142  //- Read the set of fields from dictionary
143  virtual bool read(const dictionary&);
144 
145  //- Read the fields
146  virtual bool execute();
147 
148  //- Do nothing
149  virtual bool write();
150 
151 
152  // Member Operators
153 
154  //- Disallow default bitwise assignment
155  void operator=(const readFields&) = delete;
156 };
157 
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 } // End namespace functionObjects
162 } // End namespace Foam
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 #ifdef NoRepository
167  #include "readFieldsTemplates.C"
168 #endif
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 #endif
173 
174 // ************************************************************************* //
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:158
PtrList< volSphericalTensorField > vSpheretf_
Definition: readFields.H:107
PtrList< surfaceSphericalTensorField > sSpheretf_
Definition: readFields.H:113
PtrList< surfaceVectorField > svf_
Definition: readFields.H:112
PtrList< surfaceTensorField > stf_
Definition: readFields.H:115
engineTime & runTime
void loadField(const word &, PtrList< GeometricField< Type, fvPatchField, volMesh >> &, PtrList< GeometricField< Type, fvsPatchField, surfaceMesh >> &) const
wordList fieldSet_
Fields to load.
Definition: readFields.H:102
Generic GeometricField class.
PtrList< volSymmTensorField > vSymmtf_
Definition: readFields.H:108
PtrList< surfaceSymmTensorField > sSymmtf_
Definition: readFields.H:114
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:68
PtrList< volVectorField > vvf_
Definition: readFields.H:106
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
readFields(const word &name, const Time &runTime, const dictionary &dict)
Construct for given objectRegistry and dictionary.
Definition: readFields.C:46
A class for handling words, derived from string.
Definition: word.H:59
void operator=(const readFields &)=delete
Disallow default bitwise assignment.
PtrList< volTensorField > vtf_
Definition: readFields.H:109
virtual bool write()
Do nothing.
Definition: readFields.C:108
PtrList< surfaceScalarField > ssf_
Definition: readFields.H:111
Reads fields from the time directories and adds them to the mesh database for further post-processing...
Definition: readFields.H:93
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:70
TypeName("readFields")
Runtime type information.
PtrList< volScalarField > vsf_
Loaded fields.
Definition: readFields.H:105
Namespace for OpenFOAM.