csvSetWriter.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 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::csvSetWriter
28 
29 Description
30  Write set in csv format
31 
32 SourceFiles
33  csvSetWriter.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef csvSetWriter_H
38 #define csvSetWriter_H
39 
40 #include "writer.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class csvSetWriter Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 template<class Type>
52 class csvSetWriter
53 :
54  public writer<Type>
55 {
56 
57  // Private Member Functions
58 
59  void writeCoordHeader(const coordSet&, Ostream&) const;
60 
61  void writeHeader(const coordSet&, const wordList&, Ostream&) const;
62 
63 
64 protected:
65 
66  virtual void writeSeparator(Ostream&) const;
67 
68 
69 public:
70 
71  //- Runtime type information
72  TypeName("csv");
73 
74 
75  // Constructors
76 
77  //- Construct null
78  csvSetWriter();
79 
80 
81  //- Destructor
82  virtual ~csvSetWriter();
83 
84 
85  // Member Functions
86 
87  virtual fileName getFileName
88  (
89  const coordSet&,
90  const wordList&
91  ) const;
92 
93  virtual void write
94  (
95  const coordSet&,
96  const wordList&,
97  const List<const Field<Type>*>&,
98  Ostream&
99  ) const;
100 
101  virtual void write
102  (
103  const bool writeTracks,
104  const PtrList<coordSet>&,
105  const wordList& valueSetNames,
106  const List<List<Field<Type>>>&,
107  Ostream&
108  ) const;
109 };
110 
111 
112 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
113 
114 } // End namespace Foam
115 
116 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117 
118 #ifdef NoRepository
119  #include "csvSetWriter.C"
120 #endif
121 
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123 
124 #endif
125 
126 // ************************************************************************* //
Foam::csvSetWriter::write
virtual void write(const coordSet &, const wordList &, const List< const Field< Type > * > &, Ostream &) const
General entry point for writing.
Definition: csvSetWriter.C:64
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
Foam::csvSetWriter::getFileName
virtual fileName getFileName(const coordSet &, const wordList &) const
Generate file name with correct extension.
Definition: csvSetWriter.C:53
Foam::csvSetWriter
Write set in csv format.
Definition: csvSetWriter.H:51
Foam::csvSetWriter::~csvSetWriter
virtual ~csvSetWriter()
Destructor.
Definition: csvSetWriter.C:45
csvSetWriter.C
Foam::Field
Generic templated field type.
Definition: Field.H:63
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:62
Foam::writer
Base class for graphics format writing. Entry points are.
Definition: writer.H:80
Foam::coordSet
Holds list of sampling positions.
Definition: coordSet.H:53
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::List< word >
Foam::csvSetWriter::csvSetWriter
csvSetWriter()
Construct null.
Definition: csvSetWriter.C:36
Foam::csvSetWriter::writeSeparator
virtual void writeSeparator(Ostream &) const
Writes a separator. Used by write functions.
Definition: csvSetWriter.C:122
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
writer.H
Foam::csvSetWriter::TypeName
TypeName("csv")
Runtime type information.