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-2022 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
32  interface.
33 
34 SourceFiles
35  OFSsurfaceFormat.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef OFSsurfaceFormat_H
40 #define OFSsurfaceFormat_H
41 
42 #include "Ostream.H"
43 #include "OFstream.H"
44 #include "MeshedSurface.H"
45 #include "MeshedSurfaceProxy.H"
46 #include "UnsortedMeshedSurface.H"
47 #include "OFSsurfaceFormatCore.H"
48 
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 
51 namespace Foam
52 {
53 namespace fileFormats
54 {
55 
56 /*---------------------------------------------------------------------------*\
57  Class OFSsurfaceFormat Declaration
58 \*---------------------------------------------------------------------------*/
59 
60 template<class Face>
61 class OFSsurfaceFormat
62 :
63  public MeshedSurface<Face>,
65 {
66 public:
67 
68  // Constructors
69 
70  //- Construct from file name
71  OFSsurfaceFormat(const fileName&);
72 
73  //- Disallow default bitwise copy construction
75 
76 
77  // Selectors
78 
79  //- Read file and return surface
81  {
83  (
85  );
86  }
87 
88 
89  //- Destructor
90  virtual ~OFSsurfaceFormat()
91  {}
92 
93 
94 
95  // Member Functions
96 
97  //- Read surface mesh components
98  static bool read
99  (
100  Istream&,
101  pointField&,
102  List<Face>&,
104  );
105 
106  //- Read MeshedSurface
107  static bool read
108  (
109  Istream&,
111  );
112 
113  //- Read UnsortedMeshedSurface
114  // The output is sorted by zones
115  static bool read
116  (
117  Istream&,
119  );
120 
121  //- Write surface mesh components by proxy
122  static void write(const fileName&, const MeshedSurfaceProxy<Face>&);
123 
124  //- Read from file
125  virtual bool read(const fileName&);
126 
127  //- Write object
128  virtual void write(const fileName& name) const
129  {
130  write(name, MeshedSurfaceProxy<Face>(*this));
131  }
132 
133 
134  // Member Operators
135 
136  //- Disallow default bitwise assignment
137  void operator=(const OFSsurfaceFormat<Face>&) = delete;
138 };
139 
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 } // End namespace fileFormats
144 } // End namespace Foam
145 
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 
148 #ifdef NoRepository
149  #include "OFSsurfaceFormat.C"
150 #endif
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 #endif
155 
156 // ************************************************************************* //
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.