Table.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
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.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::Function1s::Table
26 
27 Description
28  Templated table container function.
29 
30  Items are stored in a list of Tuple2's. First column is always stored as
31  scalar entries. Data is read in Tuple2 form.
32 
33  Usage:
34  \verbatim
35  <entryName> table
36  (
37  (0.0 (1 2 3))
38  (1.0 (4 5 6))
39  );
40  \endverbatim
41 
42 SourceFiles
43  Table.C
44 
45 \*---------------------------------------------------------------------------*/
46 
47 #ifndef Table_H
48 #define Table_H
49 
50 #include "TableBase.H"
51 
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 
54 namespace Foam
55 {
56 namespace Function1s
57 {
58 
59 /*---------------------------------------------------------------------------*\
60  Class Table Declaration
61 \*---------------------------------------------------------------------------*/
62 
63 template<class Type>
64 class Table
65 :
66  public TableBase<Type, Table<Type>>
67 {
68 
69 public:
70 
71  //- Runtime type information
72  TypeName("table");
73 
74 
75  // Constructors
76 
77  //- Construct from entry name and Istream
78  Table(const word& entryName, const dictionary& dict);
79 
80  //- Construct from components
81  Table
82  (
83  const word& name,
85  const word& interpolationScheme,
86  const List<Tuple2<scalar, Type>>& table
87  );
88 
89  //- Copy constructor
90  Table(const Table<Type>& tbl);
91 
92 
93  //- Destructor
94  virtual ~Table();
95 
96 
97  // Member Functions
98 
99  //- Write entries only in dictionary format
100  virtual void writeEntries(Ostream& os) const;
101 
102 
103  // Member Operators
104 
105  //- Disallow default bitwise assignment
106  void operator=(const Table<Type>&) = delete;
107 };
108 
109 
110 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
111 
112 } // End namespace Function1s
113 } // End namespace Foam
114 
115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116 
117 #ifdef NoRepository
118  #include "Table.C"
119 #endif
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 #endif
124 
125 // ************************************************************************* //
const word const dictionary & dict
Definition: Function1.H:84
TypeName("table")
Runtime type information.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
A 2-tuple for storing two objects of different types.
Definition: HashTable.H:65
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
virtual void writeEntries(Ostream &os) const
Write entries only in dictionary format.
Definition: Table.C:97
const word & name() const
Return the name of the entry.
Definition: Function1.C:91
const word & entryName
Definition: Function1.H:84
Templated table container function.
Definition: Table.H:63
Table(const word &entryName, const dictionary &dict)
Construct from entry name and Istream.
Definition: Table.C:32
A class for handling words, derived from string.
Definition: word.H:59
virtual ~Table()
Destructor.
Definition: Table.C:90
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
boundsHandling
Enumeration for handling out-of-bound values.
Definition: tableBase.H:54
void operator=(const Table< Type > &)=delete
Disallow default bitwise assignment.
Base class for table with bounds handling, interpolation and integration.
Definition: TableBase.H:56
Namespace for OpenFOAM.