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 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::ensightGeoFile
29 
30 Description
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 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class ensightGeoFile Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 class ensightGeoFile
51 :
52  public ensightFile
53 {
54 public:
55 
56  // Static Functions
57 
58  //- Return a null ensightGeoFile
59  static const ensightGeoFile& null() noexcept
60  {
61  return NullObjectRef<ensightGeoFile>();
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  :
109  ensightGeoFile(IOstreamOption::NO_APPEND, pathname, fmt)
110  {}
111 
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 // ************************************************************************* //
void operator=(const ensightGeoFile &)=delete
No copy assignment.
A variant of OFstream with specialised handling for Ensight writing of strings, integers and floats (...
Definition: ensightFile.H:47
A class for handling keywords in dictionaries.
Definition: keyType.H:66
A class for handling file names.
Definition: fileName.H:72
A variant of ensightFile (Ensight writing) that includes the extra geometry file header information...
A simple container for options an IOstream can normally have.
virtual const fileName & name() const override
Get the name of the output serial stream. (eg, the name of the Fstream file name) ...
Definition: OSstream.H:134
~ensightGeoFile()=default
Destructor.
void beginGeometry()
Start of geometry information.
auto key(const Type &t) -> std::enable_if_t< std::is_enum_v< Type >, std::underlying_type_t< Type > >
Definition: foamGltfBase.H:103
static const ensightGeoFile & null() noexcept
Return a null ensightGeoFile.
no append (truncates existing)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
const direction noexcept
Definition: scalarImpl.H:255
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
virtual Ostream & writeKeyword(const keyType &key) override
Write keyword with trailing newline.
appendType
File appending (NO_APPEND | APPEND_APP | APPEND_ATE)
rAUs append(new volScalarField(IOobject::groupName("rAU", phase1.name()), 1.0/(U1Eqn.A()+byDt(max(phase1.residualAlpha() - alpha1, scalar(0)) *rho1))))
streamFormat
Data format (ascii | binary)
ensightGeoFile(const ensightGeoFile &)=delete
No copy construct.
Namespace for OpenFOAM.