Home
Downloads
Documentation
Installation
User Guide
man-pages
API Documentation
README
Release Notes
Changes
License
Support
SourceForge Project
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
OpenFOAM
interpolations
interpolationTable
tableReaders
csv
csvTableReader.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 | Copyright (C) 1991-2011 OpenCFD Ltd.
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::cvsTableReader
26
27
Description
28
Reads an interpolation table from a file - CSV-format
29
30
SourceFiles
31
cvsTableReader.C
32
33
\*---------------------------------------------------------------------------*/
34
35
#ifndef csvTableReader_H
36
#define csvTableReader_H
37
38
#include <
OpenFOAM/tableReader.H
>
39
#include <
OpenFOAM/labelList.H
>
40
41
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42
43
namespace
Foam
44
{
45
46
/*---------------------------------------------------------------------------*\
47
Class csvTableReader Declaration
48
\*---------------------------------------------------------------------------*/
49
50
template
<
class
Type>
51
class
csvTableReader
52
:
53
public
tableReader
<Type>
54
{
55
//- does the file have a header line?
56
const
bool
headerLine_;
57
58
//- column of the time
59
const
label timeColumn_;
60
61
//- labels of the components
62
const
labelList
componentColumns_;
63
64
//- read the next value from the splitted string
65
Type readValue(
const
List<string>
&);
66
67
//- separator character
68
const
char
separator_;
69
70
public
:
71
72
//- Runtime type information
73
TypeName
(
"csv"
);
74
75
// Constructors
76
77
//- Construct from dictionary
78
csvTableReader
(
const
dictionary
& dict);
79
80
//- Construct and return a copy
81
virtual
autoPtr<tableReader<Type>
>
clone
()
const
82
{
83
return
autoPtr<tableReader<Type>
>
84
(
85
new
csvTableReader<Type>
86
(
87
*this
88
)
89
);
90
}
91
92
93
//- Destructor
94
95
virtual
~csvTableReader
();
96
97
98
// Member Functions
99
100
//- Read the table
101
virtual
void
operator()
(
const
fileName
&,
List
<
Tuple2<scalar, Type>
>&);
102
103
//- write the remaining parameters
104
virtual
void
write
(
Ostream
& os)
const
;
105
106
};
107
108
109
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
110
111
}
// End namespace Foam
112
113
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
114
115
#ifdef NoRepository
116
# include "
csvTableReader.C
"
117
#endif
118
119
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120
121
#endif
122
123
// ************************ vim: set sw=4 sts=4 et: ************************ //