initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / lagrangian / intermediate / submodels / IO / DataEntry / Table / Table.H
blob2bd1152bf4ce27ff37630c54c4083d4bb3a38953
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 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 an entry <entryName> that is (scalar, vector):
33     @verbatim
34         <entryName>   table
35         (
36             0.0 (1 2 3)
37             1.0 (4 5 6)
38         );
39     @endverbatim
41 SourceFiles
42     Table.C
44 \*---------------------------------------------------------------------------*/
46 #ifndef Table_H
47 #define Table_H
49 #include "DataEntry.H"
50 #include "Tuple2.H"
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 namespace Foam
57 template<class Type>
58 class Table;
60 template<class Type>
61 Ostream& operator<<
63     Ostream&,
64     const Table<Type>&
67 /*---------------------------------------------------------------------------*\
68                            Class Table Declaration
69 \*---------------------------------------------------------------------------*/
71 template<class Type>
72 class Table
74     public DataEntry<Type>
76     // Private data
78         //- Table data
79         List<Tuple2<scalar, Type> > table_;
82     // Private Member Functions
84         //- Disallow default bitwise assignment
85         void operator=(const Table<Type>&);
88 public:
90     //- Runtime type information
91     TypeName("table");
94     // Constructors
96         //- Construct from entry name and Istream
97         Table(const word& entryName, Istream& is);
99         //- Copy constructor
100         Table(const Table<Type>& tbl);
103     //- Destructor
104     virtual ~Table();
107     // Member Functions
109         //- Return Table value
110         Type value(const scalar x) const;
112         //- Integrate between two (scalar) values
113         Type integrate(const scalar x1, const scalar x2) const;
116     //- Ostream Operator
117     friend Ostream& operator<< <Type>
118     (
119         Ostream&,
120         const Constant<Type>&
121     );
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127 } // End namespace Foam
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
131 #ifdef NoRepository
132 #   include "Table.C"
133 #endif
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 #endif
139 // ************************************************************************* //