FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

readFields.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 2010-2010 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software: you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::readFields
00026 
00027 Description
00028     Reads fields from the time folders and adds them to the mesh database
00029     for further post-processing.
00030 
00031 SourceFiles
00032     readFields.C
00033     IOreadFields.H
00034 
00035 \*---------------------------------------------------------------------------*/
00036 
00037 #ifndef readFields_H
00038 #define readFields_H
00039 
00040 #include <OpenFOAM/OFstream.H>
00041 #include <OpenFOAM/pointFieldFwd.H>
00042 #include <finiteVolume/volFields.H>
00043 #include <finiteVolume/surfaceFields.H>
00044 
00045 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00046 
00047 namespace Foam
00048 {
00049 
00050 // Forward declaration of classes
00051 class objectRegistry;
00052 class dictionary;
00053 class mapPolyMesh;
00054 
00055 /*---------------------------------------------------------------------------*\
00056                          Class readFields Declaration
00057 \*---------------------------------------------------------------------------*/
00058 
00059 class readFields
00060 {
00061 protected:
00062 
00063     // Protected data
00064 
00065         //- Name of this set of readFields object
00066         word name_;
00067 
00068         const objectRegistry& obr_;
00069 
00070         //- on/off switch
00071         bool active_;
00072 
00073         //- Fields to load
00074         wordList fieldSet_;
00075 
00076         //- Loaded fields
00077         PtrList<volScalarField> vsf_;
00078         PtrList<volVectorField> vvf_;
00079         PtrList<volSphericalTensorField> vSpheretf_;
00080         PtrList<volSymmTensorField> vSymmtf_;
00081         PtrList<volTensorField> vtf_;
00082 
00083         PtrList<surfaceScalarField> ssf_;
00084         PtrList<surfaceVectorField> svf_;
00085         PtrList<surfaceSphericalTensorField> sSpheretf_;
00086         PtrList<surfaceSymmTensorField> sSymmtf_;
00087         PtrList<surfaceTensorField> stf_;
00088 
00089 
00090     // Protected Member Functions
00091 
00092         //- Disallow default bitwise copy construct
00093         readFields(const readFields&);
00094 
00095         //- Disallow default bitwise assignment
00096         void operator=(const readFields&);
00097 
00098         template<class Type>
00099         void loadField
00100         (
00101             const word&,
00102             PtrList<GeometricField<Type, fvPatchField, volMesh> >&,
00103             PtrList<GeometricField<Type, fvsPatchField, surfaceMesh> >&
00104         ) const;
00105 
00106 
00107 public:
00108 
00109     //- Runtime type information
00110     TypeName("readFields");
00111 
00112 
00113     // Constructors
00114 
00115         //- Construct for given objectRegistry and dictionary.
00116         //  Allow the possibility to load fields from files
00117         readFields
00118         (
00119             const word& name,
00120             const objectRegistry&,
00121             const dictionary&,
00122             const bool loadFromFiles = false
00123         );
00124 
00125 
00126     //- Destructor
00127     virtual ~readFields();
00128 
00129 
00130     // Member Functions
00131 
00132         //- Return name of the readFields object
00133         virtual const word& name() const
00134         {
00135             return name_;
00136         }
00137 
00138         //- Read the field min/max data
00139         virtual void read(const dictionary&);
00140 
00141         //- Execute, currently does nothing
00142         virtual void execute();
00143 
00144         //- Execute at the final time-loop, currently does nothing
00145         virtual void end();
00146 
00147         //- Write
00148         virtual void write();
00149 
00150         //- Update for changes of mesh
00151         virtual void updateMesh(const mapPolyMesh&)
00152         {}
00153 
00154         //- Update for changes of mesh
00155         virtual void movePoints(const pointField&)
00156         {}
00157 };
00158 
00159 
00160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00161 
00162 } // End namespace Foam
00163 
00164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00165 
00166 #ifdef NoRepository
00167 #   include "readFieldsTemplates.C"
00168 #endif
00169 
00170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00171 
00172 #endif
00173 
00174 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines