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-2020 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 ensightGeoFile_H
36 #define 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 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 
65 public:
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 // ************************************************************************* //
Foam::ensightGeoFile::beginPart
void beginPart(const label index, const string &description)
Begin a "part" (0-based index), with a description.
Definition: ensightGeoFile.C:97
Foam::fileName
A class for handling file names.
Definition: fileName.H:73
Foam::ensightGeoFile::~ensightGeoFile
~ensightGeoFile()=default
Destructor.
Foam::glTF::key
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
Definition: foamGltfBase.H:108
Foam::IOstreamOption::format
streamFormat format() const noexcept
Get the current stream format.
Definition: IOstreamOption.H:286
Foam::ensightGeoFile::beginCoordinates
void beginCoordinates(const label npoints)
Begin a "coordinates" block.
Definition: ensightGeoFile.C:108
Foam::keyType
A class for handling keywords in dictionaries.
Definition: keyType.H:68
Foam::ensightGeoFile
Specialized Ensight output with extra geometry file header.
Definition: ensightGeoFile.H:48
Foam::OSstream::name
virtual const fileName & name() const
Get the name of the stream.
Definition: OSstream.H:107
ensightFile.H
Foam::IOstreamOption::streamFormat
streamFormat
Data format (ascii | binary)
Definition: IOstreamOption.H:70
Foam::ensightFile
Ensight output with specialized write() for strings, integers and floats. Correctly handles binary wr...
Definition: ensightFile.H:52
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::IOstreamOption::BINARY
"binary"
Definition: IOstreamOption.H:73
Foam::ensightGeoFile::writeKeyword
virtual Ostream & writeKeyword(const keyType &key)
Write keyword with trailing newline.
Definition: ensightGeoFile.C:83
path
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
Foam::ensightFile::beginPart
void beginPart(const label index)
Begin a part (0-based index internally).
Definition: ensightFile.C:354
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56