VTKsurfaceFormat.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::fileFormats::VTKsurfaceFormat
26 
27 Description
28  Provide a means of reading/writing VTK legacy format.
29  The output is never sorted by zone.
30 
31 SourceFiles
32  VTKsurfaceFormat.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef VTKsurfaceFormat_H
37 #define VTKsurfaceFormat_H
38 
39 #include "MeshedSurface.H"
40 #include "MeshedSurfaceProxy.H"
41 #include "UnsortedMeshedSurface.H"
42 #include "VTKsurfaceFormatCore.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 namespace fileFormats
49 {
50 
51 /*---------------------------------------------------------------------------*\
52  Class VTKsurfaceFormat Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 template<class Face>
56 class VTKsurfaceFormat
57 :
58  public MeshedSurface<Face>,
60 {
61  // Private Member Functions
62 
63  //- Write header information about number of polygon points
64  static void writeHeaderPolygons(Ostream&, const UList<Face>&);
65 
66 
67 public:
68 
69  // Constructors
70 
71  //- Construct from file name
72  VTKsurfaceFormat(const fileName&);
73 
74  //- Disallow default bitwise copy construction
76 
77 
78  // Selectors
79 
80  //- Read file and return surface
82  {
84  (
86  );
87  }
88 
89  //- Destructor
90  virtual ~VTKsurfaceFormat()
91  {}
92 
93 
94  // Member Functions
95 
96  // Write
97 
98  //- Write surface mesh components by proxy
99  static void write(const fileName&, const MeshedSurfaceProxy<Face>&);
100 
101  //- Write UnsortedMeshedSurface, the output remains unsorted
102  static void write(const fileName&, const UnsortedMeshedSurface<Face>&);
103 
104  //- Read from file
105  virtual bool read(const fileName&);
106 
107  //- Write object file
108  virtual void write(const fileName& name) const
109  {
111  }
112 
113 
114  // Member Operators
115 
116  //- Disallow default bitwise assignment
117  void operator=(const VTKsurfaceFormat<Face>&) = delete;
118 };
119 
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 } // End namespace fileFormats
124 } // End namespace Foam
125 
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127 
128 #ifdef NoRepository
129  #include "VTKsurfaceFormat.C"
130 #endif
131 
132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133 
134 #endif
135 
136 // ************************************************************************* //
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats.
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
Definition: MeshedSurface.H:85
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: UList.H:74
A surface geometry mesh, in which the surface zone information is conveyed by the 'zoneId' associated...
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
Internal class used by the VTKsurfaceFormat.
Provide a means of reading/writing VTK legacy format. The output is never sorted by zone.
void operator=(const VTKsurfaceFormat< Face > &)=delete
Disallow default bitwise assignment.
virtual ~VTKsurfaceFormat()
Destructor.
static void write(const fileName &, const MeshedSurfaceProxy< Face > &)
Write surface mesh components by proxy.
virtual bool read(const fileName &)
Read from file.
static autoPtr< MeshedSurface< Face > > New(const fileName &name)
Read file and return surface.
VTKsurfaceFormat(const fileName &)
Construct from file name.
A class for handling file names.
Definition: fileName.H:82
Namespace for OpenFOAM.
word name(const bool)
Return a word representation of a bool.
Definition: boolIO.C:39