Initial commit for version 2.0.x patch release
[OpenFOAM-2.0.x.git] / src / sampling / sampledSet / writers / csv / csvSetWriter.H
blob1bbff35435f85070aca4cc85d301017d6e858f2b
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011-2011 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
13     the Free Software Foundation, either version 3 of the License, or
14     (at your 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, see <http://www.gnu.org/licenses/>.
24 Class
25     Foam::csvSetWriter
27 Description
28     Write set in csv format
30 SourceFiles
31     csvSetWriter.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef csvSetWriter_H
36 #define csvSetWriter_H
38 #include "writer.H"
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 namespace Foam
45 /*---------------------------------------------------------------------------*\
46                        Class csvSetWriter Declaration
47 \*---------------------------------------------------------------------------*/
49 template<class Type>
50 class csvSetWriter
52     public writer<Type>
55     // Private Member Functions
57         void writeCoordHeader(const coordSet&, Ostream&) const;
59         void writeHeader(const coordSet&, const wordList&, Ostream&) const;
62 protected:
64     virtual void writeSeparator(Ostream&) const;
67 public:
69     //- Runtime type information
70     TypeName("csv");
73     // Constructors
75         //- Construct null
76         csvSetWriter();
79     //- Destructor
80     virtual ~csvSetWriter();
83     // Member Functions
85         virtual fileName getFileName
86         (
87             const coordSet&,
88             const wordList&
89         ) const;
91         virtual void write
92         (
93             const coordSet&,
94             const wordList&,
95             const List<const Field<Type>*>&,
96             Ostream&
97         ) const;
99         virtual void write
100         (
101             const bool writeTracks,
102             const PtrList<coordSet>&,
103             const wordList& valueSetNames,
104             const List<List<Field<Type> > >&,
105             Ostream&
106         ) const;
110 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
112 } // End namespace Foam
114 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116 #ifdef NoRepository
117 #   include "csvSetWriter.C"
118 #endif
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 #endif
124 // ************************************************************************* //