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

tableReader.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-2011 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::tableReader
00026 
00027 Description
00028     Base class to read table data for the interpolationTable
00029 
00030 SourceFiles
00031     tableReader.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef tableReader_H
00036 #define tableReader_H
00037 
00038 #include <OpenFOAM/fileName.H>
00039 #include <OpenFOAM/wordList.H>
00040 #include <OpenFOAM/vector.H>
00041 #include <OpenFOAM/tensor.H>
00042 #include <OpenFOAM/typeInfo.H>
00043 #include <OpenFOAM/runTimeSelectionTables.H>
00044 #include <OpenFOAM/autoPtr.H>
00045 #include <OpenFOAM/dictionary.H>
00046 #include <OpenFOAM/Tuple2.H>
00047 
00048 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00049 
00050 namespace Foam
00051 {
00052 
00053 /*---------------------------------------------------------------------------*\
00054                            Class tableReader Declaration
00055 \*---------------------------------------------------------------------------*/
00056 
00057 template<class Type>
00058 class tableReader
00059 {
00060 
00061 public:
00062 
00063     //- Runtime type information
00064     TypeName("tableReader");
00065 
00066     // Declare run-time constructor selection table
00067 
00068         declareRunTimeSelectionTable
00069         (
00070             autoPtr,
00071             tableReader,
00072             dictionary,
00073             (const dictionary& dict),
00074             (dict)
00075         );
00076 
00077 
00078     // Constructors
00079 
00080         //- Construct from dictionary
00081         tableReader(const dictionary& dict);
00082 
00083         //- Construct and return a clone
00084         virtual autoPtr<tableReader<Type> > clone() const = 0;
00085 
00086 
00087     // Selectors
00088 
00089         //- Return a reference to the selected tableReader
00090         static autoPtr<tableReader> New(const dictionary& spec);
00091 
00092 
00093     //- Destructor
00094 
00095         virtual ~tableReader();
00096 
00097 
00098     // Member functions
00099 
00100         //- Read the table
00101         virtual void operator()
00102         (
00103             const fileName&,
00104             List<Tuple2<scalar, Type> >&
00105         ) = 0;
00106 
00107         //- Write additional information
00108         virtual void write(Ostream& os) const;
00109 
00110 };
00111 
00112 
00113 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00114 
00115 } // End namespace Foam
00116 
00117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00118 
00119 #ifdef NoRepository
00120 #   include "tableReader.C"
00121 #endif
00122 
00123 
00124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00125 
00126 #endif
00127 
00128 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines