All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
csvSetWriter.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-2021 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::csvSetWriter
26 
27 Description
28  Write set in csv format
29 
30 SourceFiles
31  csvSetWriter.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef csvSetWriter_H
36 #define csvSetWriter_H
37 
38 #include "setWriter.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class csvSetWriter Declaration
47 \*---------------------------------------------------------------------------*/
48 
49 template<class Type>
50 class csvSetWriter
51 :
52  public setWriter<Type>
53 {
54 
55  // Private Member Functions
56 
57  void writeCoordHeader(const coordSet&, Ostream&) const;
58 
59  void writeHeader(const coordSet&, const wordList&, Ostream&) const;
60 
61 
62 protected:
63 
64  virtual void writeSeparator(Ostream&) const;
65 
66 
67 public:
68 
69  //- Runtime type information
70  TypeName("csv");
71 
72 
73  // Constructors
74 
75  //- Construct null
76  csvSetWriter();
77 
78 
79  //- Destructor
80  virtual ~csvSetWriter();
81 
82 
83  // Member Functions
84 
85  virtual fileName getFileName
86  (
87  const coordSet&,
88  const wordList&
89  ) const;
90 
91  virtual void write
92  (
93  const coordSet&,
94  const wordList&,
95  const List<const Field<Type>*>&,
96  Ostream&
97  ) const;
98 
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;
107 };
108 
109 
110 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
111 
112 } // End namespace Foam
113 
114 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
115 
116 #ifdef NoRepository
117  #include "csvSetWriter.C"
118 #endif
119 
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121 
122 #endif
123 
124 // ************************************************************************* //
virtual ~csvSetWriter()
Destructor.
Definition: csvSetWriter.C:43
A class for handling file names.
Definition: fileName.H:79
Base class for graphics format writing. Entry points are.
Definition: setWriter.H:79
virtual void write(const coordSet &, const wordList &, const List< const Field< Type > *> &, Ostream &) const
General entry point for writing.
Definition: csvSetWriter.C:62
virtual fileName getFileName(const coordSet &, const wordList &) const
Generate file name with correct extension.
Definition: csvSetWriter.C:51
Holds list of sampling positions.
Definition: coordSet.H:49
csvSetWriter()
Construct null.
Definition: csvSetWriter.C:34
Pre-declare SubField and related Field type.
Definition: Field.H:56
Write set in csv format.
Definition: csvSetWriter.H:49
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
TypeName("csv")
Runtime type information.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:70
virtual void writeSeparator(Ostream &) const
Writes a separator. Used by write functions.
Definition: csvSetWriter.C:120
Namespace for OpenFOAM.