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 -------------------------------------------------------------------------------
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  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 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class ensightGeoFile Declaration
47 \*---------------------------------------------------------------------------*/
48 
49 class ensightGeoFile
50 :
51  public ensightFile
52 {
53  // Private Member Functions
54 
55  //- Initialize outputs the header information and beginGeometry
56  void init();
57 
58  //- Start of geometry information
59  void beginGeometry();
60 
61  //- End of geometry information
62  void endGeometry();
63 
64  //- No copy construct
65  ensightGeoFile(const ensightGeoFile&) = delete;
66 
67  //- No copy assignment
68  void operator=(const ensightGeoFile&) = delete;
69 
70 public:
71 
72  // Static Functions
73 
74  //- Return a null ensightGeoFile
75  static const ensightGeoFile& null()
76  {
77  return NullObjectRef<ensightGeoFile>();
78  }
79 
80 
81  // Constructors
82 
83  //- Construct from path-name.
84  // The path-name is adjusted for valid ensight file naming.
85  explicit ensightGeoFile
86  (
87  const fileName& pathname,
89  );
90 
91  //- Construct from path and name.
92  // Only the name portion is adjusted for valid ensight file naming.
94  (
95  const fileName& path,
96  const fileName& name,
98  );
99 
100 
101  //- Destructor
102  ~ensightGeoFile() = default;
103 
104 
105  // Member Functions
106 
107  // Output
108 
109  //- Write keyword with trailing newline
110  virtual Ostream& writeKeyword(const keyType& key);
111 
112 
113  // Convenience Output Methods
114 
115  //- Begin a part (0-based index).
117 
118  //- Begin a "part" (0-based index), with a description.
119  void beginPart(const label index, const std::string& description);
120 
121  //- Begin a "coordinates" block
122  void beginCoordinates(const label npoints);
123 };
124 
125 
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127 
128 } // End namespace Foam
129 
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
131 
132 #endif
133 
134 // ************************************************************************* //
Ensight output with specialized write() for strings, integers and floats. Correctly handles binary wr...
Definition: ensightFile.H:46
A class for handling keywords in dictionaries.
Definition: keyType.H:66
static const ensightGeoFile & null()
Return a null ensightGeoFile.
A class for handling file names.
Definition: fileName.H:72
Specialized Ensight output with extra geometry file header.
void beginPart(const label index, const std::string &description)
Begin a "part" (0-based index), with a description.
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:128
void beginPart(const label index)
Begin a part (0-based index internally).
Definition: ensightFile.C:359
~ensightGeoFile()=default
Destructor.
virtual Ostream & writeKeyword(const keyType &key)
Write keyword with trailing newline.
void beginCoordinates(const label npoints)
Begin a "coordinates" block.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
Definition: foamGltfBase.H:103
streamFormat
Data format (ascii | binary)
Namespace for OpenFOAM.