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-2018 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  // Private Member Functions
66 
67  //- Disallow default bitwise copy construct
69 
70  //- Disallow default bitwise assignment
71  void operator=(const OFSsurfaceFormat<Face>&);
72 
73 
74 public:
75 
76  // Constructors
77 
78  //- Construct from file name
79  OFSsurfaceFormat(const fileName&);
80 
81 
82  // Selectors
83 
84  //- Read file and return surface
86  {
88  (
90  );
91  }
92 
93 
94  //- Destructor
95  virtual ~OFSsurfaceFormat()
96  {}
97 
98 
99 
100  // Member Functions
101 
102  //- Read surface mesh components
103  static bool read
104  (
105  Istream&,
106  pointField&,
107  List<Face>&,
109  );
110 
111  //- Read MeshedSurface
112  static bool read
113  (
114  Istream&,
116  );
117 
118  //- Read UnsortedMeshedSurface
119  // The output is sorted by zones
120  static bool read
121  (
122  Istream&,
124  );
125 
126  //- Write surface mesh components by proxy
127  static void write(const fileName&, const MeshedSurfaceProxy<Face>&);
128 
129  //- Read from file
130  virtual bool read(const fileName&);
131 
132  //- Write object
133  virtual void write(const fileName& name) const
134  {
135  write(name, MeshedSurfaceProxy<Face>(*this));
136  }
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:69
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.
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.
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.