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

Table.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-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::Table
00026 
00027 Description
00028     Templated table container data entry. Items are stored in a list of
00029     Tuple2's. First column is always stored as scalar entries. Data is read
00030     in the form, e.g. for an entry <entryName> that is (scalar, vector):
00031 
00032     @verbatim
00033         <entryName>   table
00034         (
00035             0.0 (1 2 3)
00036             1.0 (4 5 6)
00037         );
00038     @endverbatim
00039 
00040 SourceFiles
00041     Table.C
00042 
00043 \*---------------------------------------------------------------------------*/
00044 
00045 #ifndef Table_H
00046 #define Table_H
00047 
00048 #include <lagrangianIntermediate/DataEntry.H>
00049 #include <OpenFOAM/Tuple2.H>
00050 
00051 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00052 
00053 namespace Foam
00054 {
00055 
00056 template<class Type>
00057 class Table;
00058 
00059 template<class Type>
00060 Ostream& operator<<
00061 (
00062     Ostream&,
00063     const Table<Type>&
00064 );
00065 
00066 /*---------------------------------------------------------------------------*\
00067                            Class Table Declaration
00068 \*---------------------------------------------------------------------------*/
00069 
00070 template<class Type>
00071 class Table
00072 :
00073     public DataEntry<Type>
00074 {
00075     // Private data
00076 
00077         //- Table data
00078         List<Tuple2<scalar, Type> > table_;
00079 
00080 
00081     // Private Member Functions
00082 
00083         //- Disallow default bitwise assignment
00084         void operator=(const Table<Type>&);
00085 
00086 
00087 public:
00088 
00089     //- Runtime type information
00090     TypeName("table");
00091 
00092 
00093     // Constructors
00094 
00095         //- Construct from entry name and Istream
00096         Table(const word& entryName, Istream& is);
00097 
00098         //- Copy constructor
00099         Table(const Table<Type>& tbl);
00100 
00101 
00102     //- Destructor
00103     virtual ~Table();
00104 
00105 
00106     // Member Functions
00107 
00108         //- Return Table value
00109         Type value(const scalar x) const;
00110 
00111         //- Integrate between two (scalar) values
00112         Type integrate(const scalar x1, const scalar x2) const;
00113 
00114 
00115     //- Ostream Operator
00116     friend Ostream& operator<< <Type>
00117     (
00118         Ostream&,
00119         const Constant<Type>&
00120     );
00121 };
00122 
00123 
00124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00125 
00126 } // End namespace Foam
00127 
00128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00129 
00130 #ifdef NoRepository
00131 #   include <lagrangianIntermediate/Table.C>
00132 #endif
00133 
00134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00135 
00136 #endif
00137 
00138 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines