nullCoordSetWriter.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) 2022 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::coordSetWriters::nullWriter
28
29Description
30 A coordSet(s) writer with suppressed output.
31
32SourceFiles
33 nullCoordSetWriter.C
34
35\*---------------------------------------------------------------------------*/
36
37#ifndef Foam_coordSetWriters_nullWriter_H
38#define Foam_coordSetWriters_nullWriter_H
39
40#include "coordSetWriter.H"
41
42// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43
44namespace Foam
45{
46namespace coordSetWriters
47{
48
49/*---------------------------------------------------------------------------*\
50 Class nullWriter Declaration
51\*---------------------------------------------------------------------------*/
53class nullWriter
54:
55 public coordSetWriter
56{
57 // Private Member Functions
58
59 //- Templated write operation
60 template<class Type>
61 fileName writeTemplate
62 (
63 const word& fieldName,
64 const Field<Type>& values
65 )
66 {
67 return fileName();
68 }
69
70 //- Templated write operation
71 template<class Type>
72 fileName writeTemplate
73 (
74 const word& fieldName,
75 const List<Field<Type>>& fieldValues
76 )
77 {
78 return fileName();
79 }
80
81
82public:
83
84 //- Runtime type information (no debug)
85 TypeNameNoDebug("none");
86
87
88 // Constructors
89
90 //- Default construct
91 nullWriter();
92
93 //- Construct with some output options
94 explicit nullWriter(const dictionary& options);
95
96 //- Construct from components
98 (
99 const coordSet& coords,
100 const fileName& outputPath,
101 const dictionary& options = dictionary()
102 );
103
104 //- Construct from components
106 (
107 const UPtrList<coordSet>& tracks,
108 const fileName& outputPath,
109 const dictionary& options = dictionary()
110 );
111
112
113 //- Destructor
114 virtual ~nullWriter();
115
116
117 // Member Functions
118
119 // Capability
120
121 //- False: The null writer is never enabled, which lets the caller
122 //- skip various (possibly expensive) preparatory operations.
123 virtual bool enabled() const;
124
125 //- False: no internal buffering possible
126 virtual bool buffering() const; // override
127
128 //- False: never needs an update.
129 virtual bool needsUpdate() const;
130
131 //- True: like a /dev/null device.
132 virtual bool wroteData() const;
133
134
135 // Content Association
136
137 //- Set coordinates (no-op).
138 virtual void setCoordinates(const coordSet*); // override
139
140 //- Set coordinates (no-op).
141 virtual void setCoordinates(const coordSet&); // override
142
143 //- Set tracks (no-op).
144 virtual void setTracks(const UPtrList<coordSet>&); // override
145
146
147 // Output
148
149 //- Characteristic output file name - information only.
150 //- Always an empty fileName
151 virtual fileName path() const; // override
152
153 //- Open for output on specified path, using existing content (no-op)
154 virtual void open(const fileName& outputPath); // override
155
156
157 // Member Functions
165};
166
167
168// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169
170} // End namespace coordSetWriters
171} // End namespace Foam
172
173// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174
175#endif
176
177// ************************************************************************* //
Generic templated field type.
Definition: Field.H:82
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: List.H:77
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
Definition: UPtrList.H:71
Base class for writing coordSet(s) and tracks with fields.
A coordSet(s) writer with suppressed output.
virtual void open(const fileName &outputPath)
Open for output on specified path, using existing content (no-op)
virtual bool buffering() const
False: no internal buffering possible.
TypeNameNoDebug("none")
Runtime type information (no debug)
declareCoordSetWriterWriteMethod(sphericalTensor)
virtual bool needsUpdate() const
False: never needs an update.
virtual void setTracks(const UPtrList< coordSet > &)
Set tracks (no-op).
virtual bool wroteData() const
True: like a /dev/null device.
virtual void setCoordinates(const coordSet *)
Set coordinates (no-op).
Holds list of sampling positions.
Definition: coordSet.H:56
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A class for handling file names.
Definition: fileName.H:76
A class for handling words, derived from Foam::string.
Definition: word.H:68
#define declareCoordSetWriterWriteMethod(Type)
Namespace for OpenFOAM.
#define TypeNameNoDebug(TypeNameString)
Declare a ClassNameNoDebug() with extra virtual type info.
Definition: typeInfo.H:68