Loading...
Searching...
No Matches
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-2024 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 A variant of ensightFile (Ensight writing) that includes
32 the extra geometry file header information.
33
34\*---------------------------------------------------------------------------*/
35
36#ifndef Foam_ensightGeoFile_H
37#define Foam_ensightGeoFile_H
38
39#include "ensightFile.H"
40
41// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42
43namespace Foam
44{
45
46/*---------------------------------------------------------------------------*\
47 Class ensightGeoFile Declaration
48\*---------------------------------------------------------------------------*/
49
51:
52 public ensightFile
53{
54public:
55
56 // Static Functions
57
58 //- Return a null ensightGeoFile
59 static const ensightGeoFile& null() noexcept
60 {
62 }
63
64
65 // Generated Methods
66
67 //- No copy construct
68 ensightGeoFile(const ensightGeoFile&) = delete;
69
70 //- No copy assignment
71 void operator=(const ensightGeoFile&) = delete;
72
73
74 // Constructors
75
76 //- Construct from path-name and initialise the binary header.
77 // The path-name is adjusted for valid ensight file naming.
78 // Created as an atomic or in append mode (single-file format).
80 (
83 const fileName& pathname,
85 );
86
87 //- Construct from path / name and initialise the binary header.
88 // Only the name portion is adjusted for valid ensight file naming.
89 // Created as an atomic or in append mode (single-file format).
91 (
94 const fileName& path,
95 const fileName& name,
97 );
98
99 //- Construct from path-name and initialise the binary header.
100 // The path-name is adjusted for valid ensight file naming.
101 // Created as an atomic, non-append mode.
102 // \note Since 2024-05 does \em not call beginGeometry() !!
103 explicit ensightGeoFile
104 (
105 const fileName& pathname,
107 )
108 :
110 {}
112 //- Construct from path / name and initialise the binary header.
113 // Only the name portion is adjusted for valid ensight file naming.
114 // Created as an atomic, non-append mode.
115 // \note Since 2024-05 does \em not call beginGeometry() !!
117 (
118 const fileName& path,
119 const fileName& name,
121 )
122 :
124 {}
125
126
127 //- Destructor
128 ~ensightGeoFile() = default;
129
130
131 // Member Functions
132
133 // Output
134
135 //- Write keyword with trailing newline
136 virtual Ostream& writeKeyword(const keyType& key) override;
137
138
139 // Convenience Output Methods
140
141 //- Start of geometry information
142 void beginGeometry();
143};
144
145
146// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147
148} // End namespace Foam
149
150// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151
152#endif
153
154// ************************************************************************* //
A simple container for options an IOstream can normally have.
streamFormat
Data format (ascii | binary | coherent).
appendType
File appending (NO_APPEND | APPEND_APP | APPEND_ATE).
@ NO_APPEND
no append (truncates existing)
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
ensightGeoFile(const fileName &pathname, IOstreamOption::streamFormat fmt=IOstreamOption::BINARY)
Construct from path-name and initialise the binary header.
static const ensightGeoFile & null() noexcept
Return a null ensightGeoFile.
virtual Ostream & writeKeyword(const keyType &key) override
Write keyword with trailing newline.
void beginGeometry()
Start of geometry information.
ensightGeoFile(const fileName &path, const fileName &name, IOstreamOption::streamFormat fmt=IOstreamOption::BINARY)
Construct from path / name and initialise the binary header.
ensightGeoFile(const ensightGeoFile &)=delete
No copy construct.
~ensightGeoFile()=default
Destructor.
void operator=(const ensightGeoFile &)=delete
No copy assignment.
A class for handling file names.
Definition fileName.H:75
A class for handling keywords in dictionaries.
Definition keyType.H:69
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
rAUs append(new volScalarField(IOobject::groupName("rAU", phase1.name()), 1.0/(U1Eqn.A()+byDt(max(phase1.residualAlpha() - alpha1, scalar(0)) *rho1))))
Namespace for OpenFOAM.
const T & NullObjectRef() noexcept
Const reference (of type T) to the nullObject.
Definition nullObject.H:228
const direction noexcept
Definition scalarImpl.H:265
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127