OFSsurfaceFormat.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-2019 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::OFSsurfaceFormat
26 
27 Description
28  Provide a means of reading/writing the single-file OpenFOAM surface format.
29 
30 Note
31  This class provides more methods than the regular surface format interface.
32 
33 SourceFiles
34  OFSsurfaceFormat.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef OFSsurfaceFormat_H
39 #define OFSsurfaceFormat_H
40 
41 #include "Ostream.H"
42 #include "OFstream.H"
43 #include "MeshedSurface.H"
44 #include "MeshedSurfaceProxy.H"
45 #include "UnsortedMeshedSurface.H"
46 #include "OFSsurfaceFormatCore.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 namespace fileFormats
53 {
54 
55 /*---------------------------------------------------------------------------*\
56  Class OFSsurfaceFormat Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 template<class Face>
60 class OFSsurfaceFormat
61 :
62  public MeshedSurface<Face>,
64 {
65 public:
66 
67  // Constructors
68 
69  //- Construct from file name
70  OFSsurfaceFormat(const fileName&);
71 
72  //- Disallow default bitwise copy construction
74 
75 
76  // Selectors
77 
78  //- Read file and return surface
80  {
82  (
84  );
85  }
86 
87 
88  //- Destructor
89  virtual ~OFSsurfaceFormat()
90  {}
91 
92 
93 
94  // Member Functions
95 
96  //- Read surface mesh components
97  static bool read
98  (
99  Istream&,
100  pointField&,
101  List<Face>&,
103  );
104 
105  //- Read MeshedSurface
106  static bool read
107  (
108  Istream&,
110  );
111 
112  //- Read UnsortedMeshedSurface
113  // The output is sorted by zones
114  static bool read
115  (
116  Istream&,
118  );
119 
120  //- Write surface mesh components by proxy
121  static void write(const fileName&, const MeshedSurfaceProxy<Face>&);
122 
123  //- Read from file
124  virtual bool read(const fileName&);
125 
126  //- Write object
127  virtual void write(const fileName& name) const
128  {
129  write(name, MeshedSurfaceProxy<Face>(*this));
130  }
131 
132 
133  // Member Operators
134 
135  //- Disallow default bitwise assignment
136  void operator=(const OFSsurfaceFormat<Face>&) = delete;
137 };
138 
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 } // End namespace fileFormats
143 } // End namespace Foam
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 #ifdef NoRepository
148  #include "OFSsurfaceFormat.C"
149 #endif
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 #endif
154 
155 // ************************************************************************* //
A surface geometry mesh, in which the surface zone information is conveyed by the &#39;zoneId&#39; associated...
Definition: MeshedSurface.H:74
A class for handling file names.
Definition: fileName.H:79
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
Definition: MeshedSurface.H:72
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
virtual ~OFSsurfaceFormat()
Destructor.
OFSsurfaceFormat(const fileName &)
Construct from file name.
static void write(const fileName &, const MeshedSurfaceProxy< Face > &)
Write surface mesh components by proxy.
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats...
Definition: MeshedSurface.H:73
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
Internal class used by the OFSsurfaceFormat.
static bool read(Istream &, pointField &, List< Face > &, List< surfZone > &)
Read surface mesh components.
void operator=(const OFSsurfaceFormat< Face > &)=delete
Disallow default bitwise assignment.
Provide a means of reading/writing the single-file OpenFOAM surface format.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
static autoPtr< MeshedSurface< Face > > New(const fileName &name)
Read file and return surface.
Namespace for OpenFOAM.