ENH: autoLayerDriver: better layering information message
[OpenFOAM-2.0.x.git] / src / postProcessing / functionObjects / field / readFields / readFields.H
blob56232ec51ddafaa6148f84220cfad737cebf41c9
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
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.
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.
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/>.
24 Class
25     Foam::readFields
27 Description
28     Reads fields from the time folders and adds them to the mesh database
29     for further post-processing.
31 SourceFiles
32     readFields.C
33     IOreadFields.H
35 \*---------------------------------------------------------------------------*/
37 #ifndef readFields_H
38 #define readFields_H
40 #include "OFstream.H"
41 #include "pointFieldFwd.H"
42 #include "volFields.H"
43 #include "surfaceFields.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 namespace Foam
50 // Forward declaration of classes
51 class objectRegistry;
52 class dictionary;
53 class mapPolyMesh;
55 /*---------------------------------------------------------------------------*\
56                          Class readFields Declaration
57 \*---------------------------------------------------------------------------*/
59 class readFields
61 protected:
63     // Protected data
65         //- Name of this set of readFields object
66         word name_;
68         const objectRegistry& obr_;
70         //- on/off switch
71         bool active_;
73         //- Fields to load
74         wordList fieldSet_;
76         //- Loaded fields
77         PtrList<volScalarField> vsf_;
78         PtrList<volVectorField> vvf_;
79         PtrList<volSphericalTensorField> vSpheretf_;
80         PtrList<volSymmTensorField> vSymmtf_;
81         PtrList<volTensorField> vtf_;
83         PtrList<surfaceScalarField> ssf_;
84         PtrList<surfaceVectorField> svf_;
85         PtrList<surfaceSphericalTensorField> sSpheretf_;
86         PtrList<surfaceSymmTensorField> sSymmtf_;
87         PtrList<surfaceTensorField> stf_;
90     // Protected Member Functions
92         //- Disallow default bitwise copy construct
93         readFields(const readFields&);
95         //- Disallow default bitwise assignment
96         void operator=(const readFields&);
98         template<class Type>
99         void loadField
100         (
101             const word&,
102             PtrList<GeometricField<Type, fvPatchField, volMesh> >&,
103             PtrList<GeometricField<Type, fvsPatchField, surfaceMesh> >&
104         ) const;
107 public:
109     //- Runtime type information
110     TypeName("readFields");
113     // Constructors
115         //- Construct for given objectRegistry and dictionary.
116         //  Allow the possibility to load fields from files
117         readFields
118         (
119             const word& name,
120             const objectRegistry&,
121             const dictionary&,
122             const bool loadFromFiles = false
123         );
126     //- Destructor
127     virtual ~readFields();
130     // Member Functions
132         //- Return name of the readFields object
133         virtual const word& name() const
134         {
135             return name_;
136         }
138         //- Read the field min/max data
139         virtual void read(const dictionary&);
141         //- Execute, currently does nothing
142         virtual void execute();
144         //- Execute at the final time-loop, currently does nothing
145         virtual void end();
147         //- Write
148         virtual void write();
150         //- Update for changes of mesh
151         virtual void updateMesh(const mapPolyMesh&)
152         {}
154         //- Update for changes of mesh
155         virtual void movePoints(const pointField&)
156         {}
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 } // End namespace Foam
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 #ifdef NoRepository
167 #   include "readFieldsTemplates.C"
168 #endif
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 #endif
174 // ************************************************************************* //