OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

IOOutputFilter.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) 1991-2009 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 the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     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, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     Foam::IOOutputFilter
00027 
00028 Description
00029     IOdictionary wrapper around OutputFilter to allow them to read from
00030     their associated dictionaries.
00031 
00032 SourceFiles
00033     IOOutputFilter.C
00034 
00035 \*---------------------------------------------------------------------------*/
00036 
00037 #ifndef IOOutputFilter_H
00038 #define IOOutputFilter_H
00039 
00040 #include "IOdictionary.H"
00041 #include "pointFieldFwd.H"
00042 
00043 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00044 
00045 namespace Foam
00046 {
00047 
00048 // Forward declaration of classes
00049 class mapPolyMesh;
00050 
00051 /*---------------------------------------------------------------------------*\
00052                        Class IOOutputFilter Declaration
00053 \*---------------------------------------------------------------------------*/
00054 
00055 template<class OutputFilter>
00056 class IOOutputFilter
00057 :
00058     public IOdictionary,
00059     public OutputFilter
00060 {
00061     // Private Member Functions
00062 
00063         // Disallow default bitwise copy construct and assignment
00064         IOOutputFilter(const IOOutputFilter&);
00065         void operator=(const IOOutputFilter&);
00066 
00067 
00068 public:
00069 
00070     // Constructors
00071 
00072         //- Construct for given objectRegistry and dictionary
00073         //  Allow dictionary to be optional
00074         //  Allow the possibility to load fields from files
00075         IOOutputFilter
00076         (
00077             const word& outputFilterName,
00078             const objectRegistry&,
00079             const fileName& dictName = OutputFilter::typeName() + "Dict",
00080             const IOobject::readOption rOpt = IOobject::MUST_READ,
00081             const bool loadFromFile = false
00082         );
00083 
00084 
00085     //- Destructor
00086     virtual ~IOOutputFilter();
00087 
00088 
00089     // Member Functions
00090 
00091         //- Return name
00092         virtual const word& name() const
00093         {
00094             return IOdictionary::name();
00095         }
00096 
00097         //- Read the probes
00098         virtual bool read();
00099 
00100         //- Sample and write
00101         virtual void write();
00102 
00103         //- Update for changes of mesh
00104         virtual void updateMesh(const mapPolyMesh& mpm)
00105         {
00106             read();
00107             OutputFilter::updateMesh(mpm);
00108         }
00109 
00110         //- Update for changes of mesh
00111         virtual void movePoints(const pointField& points)
00112         {
00113             read();
00114             OutputFilter::movePoints(points);
00115         }
00116 };
00117 
00118 
00119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00120 
00121 } // End namespace Foam
00122 
00123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00124 
00125 #ifdef NoRepository
00126 #   include "IOOutputFilter.C"
00127 #endif
00128 
00129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00130 
00131 #endif
00132 
00133 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd