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-2018 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 private:
116 
117  // Private member functions
118 
119  //- Disallow default bitwise copy construct
120  readFields(const readFields&);
121 
122  //- Disallow default bitwise assignment
123  void operator=(const readFields&);
124 
125 
126 public:
127 
128  //- Runtime type information
129  TypeName("readFields");
130 
131 
132  // Constructors
133 
134  //- Construct for given objectRegistry and dictionary.
135  // Allow the possibility to load fields from files
136  readFields
137  (
138  const word& name,
139  const Time& runTime,
140  const dictionary& dict
141  );
142 
143 
144  //- Destructor
145  virtual ~readFields();
146 
147 
148  // Member Functions
149 
150  //- Read the set of fields from dictionary
151  virtual bool read(const dictionary&);
152 
153  //- Read the fields
154  virtual bool execute();
155 
156  //- Do nothing
157  virtual bool write();
158 };
159 
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 } // End namespace functionObjects
164 } // End namespace Foam
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 #ifdef NoRepository
169  #include "readFieldsTemplates.C"
170 #endif
171 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 
174 #endif
175 
176 // ************************************************************************* //
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: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
A class for handling words, derived from string.
Definition: word.H:59
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:63
TypeName("readFields")
Runtime type information.
PtrList< volScalarField > vsf_
Loaded fields.
Definition: readFields.H:105
Namespace for OpenFOAM.