tableReader.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2016 OpenFOAM Foundation
9 Copyright (C) 2020 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::tableReader
29
30Description
31 Base class to read table data for the interpolationTable
32
33SourceFiles
34 tableReader.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef tableReader_H
39#define tableReader_H
40
41#include "fileName.H"
42#include "wordList.H"
43#include "vector.H"
44#include "tensor.H"
45#include "typeInfo.H"
47#include "autoPtr.H"
48#include "dictionary.H"
49#include "Tuple2.H"
50
51// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52
53namespace Foam
54{
55
56/*---------------------------------------------------------------------------*\
57 Class tableReader Declaration
58\*---------------------------------------------------------------------------*/
59
60template<class Type>
61class tableReader
62{
63public:
64
65 //- Declare type-name, virtual type (with debug switch)
66 TypeName("tableReader");
67
68
69 // Declare run-time constructor selection table
72 (
73 autoPtr,
76 (const dictionary& dict),
77 (dict)
78 );
79
80
81 // Constructors
82
83 //- Default construct
84 tableReader() = default;
85
86 //- Construct from dictionary
88
89 //- Construct and return a clone
90 virtual autoPtr<tableReader<Type>> clone() const = 0;
91
92
93 // Selectors
94
95 //- Return a reference to the selected tableReader
96 static autoPtr<tableReader> New(const dictionary& spec);
97
98
99 //- Destructor
100 virtual ~tableReader() = default;
101
102
103 // Member Functions
104
105 //- Read 1D table
106 virtual void operator()
107 (
108 const fileName& fName,
110 ) = 0;
111
112 //- Read 2D table
113 virtual void operator()
114 (
115 const fileName& fName,
117 ) = 0;
118
119 //- Write additional information
120 virtual void write(Ostream& os) const;
121};
122
123
124// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125
126} // End namespace Foam
127
128// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129
130#ifdef NoRepository
131 #include "tableReader.C"
132#endif
133
134
135// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136
137#endif
138
139// ************************************************************************* //
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: List.H:77
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
Database for solution data, solver performance and other reduced data.
Definition: data.H:58
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A class for handling file names.
Definition: fileName.H:76
Base class to read table data for the interpolationTable.
Definition: tableReader.H:61
tableReader()=default
Default construct.
static autoPtr< tableReader > New(const dictionary &spec)
Return a reference to the selected tableReader.
Definition: tableReader.C:35
TypeName("tableReader")
Declare type-name, virtual type (with debug switch)
virtual autoPtr< tableReader< Type > > clone() const =0
Construct and return a clone.
virtual ~tableReader()=default
Destructor.
declareRunTimeSelectionTable(autoPtr, tableReader, dictionary,(const dictionary &dict),(dict))
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
runTime write()
Macros to ease declaration of run-time selection tables.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73