initial commit for version 1.5.x patch release
[OpenFOAM-1.5.x.git] / src / lagrangian / intermediate / submodels / IO / DataEntry / Table / Table.H
blob7730d186d522d9c7b12675c3a9603b7f4735416d
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2008 OpenCFD Ltd.
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     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, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::Table
28 Description
29     Templated table container data entry. Items are stored in a list of
30     Tuple2's. First column is always stored as scalar entries. Data is read
31     in the form, e.g. for (scalar, vector):
33     @verbatim
34         entry                    Table
35         entryCoeffs
36         {
37             table
38             (
39                 0.0 (1 2 3)
40                 1.0 (4 5 6)
41             )
42         }
43     @endverbatim
45 SourceFiles
46     Table.C
48 \*---------------------------------------------------------------------------*/
50 #ifndef Table_H
51 #define Table_H
53 #include "DataEntry.H"
54 #include "Tuple2.H"
56 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
58 namespace Foam
61 /*---------------------------------------------------------------------------*\
62                            Class Table Declaration
63 \*---------------------------------------------------------------------------*/
65 template<class Type>
66 class Table
68     public DataEntry<Type>
70     // Private data
72        //- Table data
73        List<Tuple2<scalar, Type> > table_;
76     // Private Member Functions
78         //- Disallow default bitwise copy construct
79         Table(const Table<Type>&);
81         //- Disallow default bitwise assignment
82         void operator=(const Table<Type>&);
85 public:
87     // Runtime type information
88     TypeName("Table");
91     // Constructors
93         //- Construct from dictionary
94         Table
95         (
96             const word& entryName,
97             const dictionary& dict
98         );
101     //- Destructor
103         ~Table();
106     // Member Functions
108         //- Return Table value
109         Type value(const scalar x) const;
111         //- Integrate between two (scalar) values
112         Type integrate(const scalar x1, const scalar x2) const;
116 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118 } // End namespace Foam
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 #ifdef NoRepository
123 #   include "Table.C"
124 #endif
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 #endif
130 // ************************************************************************* //