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
56  void init();
57 
58  //- No copy construct
59  ensightGeoFile(const ensightGeoFile&) = delete;
60 
61  //- No copy assignment
62  void operator=(const ensightGeoFile&) = delete;
63 
64 
65 public:
66 
67  // Static Functions
68 
69  //- Return a null ensightGeoFile
70  static const ensightGeoFile& null()
71  {
72  return NullObjectRef<ensightGeoFile>();
73  }
74 
75 
76  // Constructors
77 
78  //- Construct from path-name.
79  // The path-name is adjusted for valid ensight file naming.
80  explicit ensightGeoFile
81  (
82  const fileName& pathname,
84  );
85 
86  //- Construct from path and name.
87  // Only the name portion is adjusted for valid ensight file 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 // ************************************************************************* //
Ensight output with specialized write() for strings, integers and floats. Correctly handles binary wr...
Definition: ensightFile.H:46
virtual const fileName & name() const
Get the name of the output serial stream. (eg, the name of the Fstream file name) ...
Definition: OSstream.H:128
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:71
Specialized Ensight output with extra geometry file header.
void beginPart(const label index)
Begin a part (0-based index internally).
Definition: ensightFile.C:332
~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:55
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
void beginPart(const label index, const string &description)
Begin a "part" (0-based index), with a description.
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.