ensightGeoFile.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-2015 OpenFOAM Foundation
9 Copyright (C) 2016-2022 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::ensightGeoFile
29
30Description
31 Specialized Ensight output with extra geometry file header
32
33\*---------------------------------------------------------------------------*/
34
35#ifndef Foam_ensightGeoFile_H
36#define Foam_ensightGeoFile_H
37
38#include "ensightFile.H"
39
40// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41
42namespace Foam
43{
44
45/*---------------------------------------------------------------------------*\
46 Class ensightGeoFile Declaration
47\*---------------------------------------------------------------------------*/
50:
51 public ensightFile
52{
53 // Private Member Functions
54
55 //- Initialize by outputting header information
56 void initialize();
57
58 //- No copy construct
59 ensightGeoFile(const ensightGeoFile&) = delete;
60
61 //- No copy assignment
62 void operator=(const ensightGeoFile&) = delete;
63
64
65public:
66
67 // Static Functions
68
69 //- Return a null ensightGeoFile
70 inline static const ensightGeoFile& null()
71 {
72 return NullObjectRef<ensightGeoFile>();
73 }
74
75
76 // Constructors
77
78 //- Construct from pathName.
79 // The entire pathName is checked for valid ensight naming.
80 explicit ensightGeoFile
81 (
82 const fileName& pathname,
84 );
85
86 //- Construct from path and name.
87 // Only the name portion is checked for valid ensight naming.
89 (
90 const fileName& path,
91 const fileName& name,
93 );
94
95
96 //- Destructor
97 ~ensightGeoFile() = default;
98
99
100 // Member Functions
101
102 // Output
103
104 //- Write keyword with trailing newline
105 virtual Ostream& writeKeyword(const keyType& key);
106
107
108 // Convenience Output Methods
109
110 //- Begin a part (0-based index).
112
113 //- Begin a "part" (0-based index), with a description.
114 void beginPart(const label index, const string& description);
115
116 //- Begin a "coordinates" block
117 void beginCoordinates(const label npoints);
118};
119
120
121// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122
123} // End namespace Foam
124
125// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126
127#endif
128
129// ************************************************************************* //
streamFormat format() const noexcept
Get the current stream format.
streamFormat
Data format (ascii | binary)
virtual const fileName & name() const
Read/write access to the name of the stream.
Definition: OSstream.H:107
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Ensight output with specialized write() for strings, integers and floats. Correctly handles binary wr...
Definition: ensightFile.H:55
void beginPart(const label index)
Begin a part (0-based index internally).
Definition: ensightFile.C:354
Specialized Ensight output with extra geometry file header.
virtual Ostream & writeKeyword(const keyType &key)
Write keyword with trailing newline.
static const ensightGeoFile & null()
Return a null ensightGeoFile.
void beginCoordinates(const label npoints)
Begin a "coordinates" block.
~ensightGeoFile()=default
Destructor.
void beginPart(const label index, const string &description)
Begin a "part" (0-based index), with a description.
A class for handling file names.
Definition: fileName.H:76
A class for handling keywords in dictionaries.
Definition: keyType.H:71
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
Namespace for OpenFOAM.