rawSetWriter.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-2023 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::rawSetWriter
26 
27 Description
28  Write set in raw tabulated format
29 
30 SourceFiles
31  rawSetWriter.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef rawSetWriter_H
36 #define rawSetWriter_H
37 
38 #include "setWriter.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class rawSetWriter Declaration
47 \*---------------------------------------------------------------------------*/
48 
49 class rawSetWriter
50 :
51  public setWriter
52 {
53 private:
54 
55  // Private Data
56 
57  //- Whether or not to separate segments
58  mutable bool separateSegments_;
59 
60 
61 protected:
62 
63  // Protected Member Functions
64 
65  //- Write a segment separator
66  virtual void writeSegmentSeparator(Ostream& os) const;
67 
68 
69 public:
70 
71  //- Runtime type information
72  TypeName("raw");
73 
74 
75  // Constructors
76 
77  //- Construct given write options
79  (
80  const IOstream::streamFormat writeFormat,
81  const IOstream::compressionType writeCompression
82  );
83 
84  //- Construct from dictionary
86 
87  //- Construct copy
88  rawSetWriter(const rawSetWriter& writer);
89 
90  //- Construct and return a clone
91  virtual autoPtr<setWriter> clone() const
92  {
93  return autoPtr<setWriter>(new rawSetWriter(*this));
94  }
95 
96 
97  //- Destructor
98  virtual ~rawSetWriter();
99 
100 
101  // Member Functions
102 
103  //- Write a coordSet and associated data
104  virtual void write
105  (
106  const fileName& outputDir,
107  const fileName& setName,
108  const coordSet& set,
109  const wordList& valueSetNames
110  #define TypeValueSetsConstArg(Type, nullArg) \
111  , const UPtrList<const Field<Type>>& Type##ValueSets
113  #undef TypeValueSetsConstArg
114  ) const;
115 
116  //- Inherit base class write methods
117  using setWriter::write;
118 };
119 
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 } // End namespace Foam
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 #endif
128 
129 // ************************************************************************* //
Pre-declare SubField and related Field type.
Definition: Field.H:83
streamFormat
Enumeration for the format of data in the stream.
Definition: IOstream.H:87
compressionType
Enumeration for the format of data in the stream.
Definition: IOstream.H:194
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: UPtrList.H:66
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
Holds list of sampling positions.
Definition: coordSet.H:51
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
A class for handling file names.
Definition: fileName.H:82
Write set in raw tabulated format.
Definition: rawSetWriter.H:51
TypeName("raw")
Runtime type information.
virtual autoPtr< setWriter > clone() const
Construct and return a clone.
Definition: rawSetWriter.H:90
virtual void writeSegmentSeparator(Ostream &os) const
Write a segment separator.
Definition: rawSetWriter.C:45
virtual ~rawSetWriter()
Destructor.
Definition: rawSetWriter.C:83
rawSetWriter(const IOstream::streamFormat writeFormat, const IOstream::compressionType writeCompression)
Construct given write options.
Definition: rawSetWriter.C:57
virtual void write(const fileName &outputDir, const fileName &setName, const coordSet &set, const wordList &valueSetNames #define TypeValueSetsConstArg(Type, nullArg)) const=0
Inherit base class write methods.
Base class for writing coordinate sets with data.
Definition: setWriter.H:64
virtual void write(const fileName &outputDir, const fileName &setName, const coordSet &set, const wordList &valueSetNames #define TypeValueSetsConstArg(Type, nullArg)) const =0
Write a coordSet and associated data.
Namespace for OpenFOAM.
FOR_ALL_FIELD_TYPES(makeFieldSourceTypedef)
#define TypeValueSetsConstArg(Type, nullArg)
dictionary dict