FreeFOAM The Cross-Platform CFD Toolkit
OFSsurfaceFormat.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 | Copyright (C) 1991-2010 OpenCFD Ltd.
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.x
32 
33 SourceFiles
34  OFSsurfaceFormat.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef OFSsurfaceFormat_H
39 #define OFSsurfaceFormat_H
40 
41 #include <OpenFOAM/Ostream.H>
42 #include <OpenFOAM/OFstream.H>
43 #include <surfMesh/MeshedSurface.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>
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 
97  {}
98 
99 
100 
101  // Member Functions
102 
103  //- Read surface mesh components
104  static bool read
105  (
106  Istream&,
107  pointField&,
108  List<Face>&,
110  );
111 
112  //- Read MeshedSurface
113  static bool read
114  (
115  Istream&,
117  );
118 
119  //- Read UnsortedMeshedSurface
120  // The output is sorted by zones
121  static bool read
122  (
123  Istream&,
125  );
126 
127  //- Write surface mesh components by proxy
128  static void write(const fileName&, const MeshedSurfaceProxy<Face>&);
129 
130  //- Read from file
131  virtual bool read(const fileName&);
132 
133  //- Write object
134  virtual void write(const fileName& name) const
135  {
136  write(name, MeshedSurfaceProxy<Face>(*this));
137  }
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 // ************************ vim: set sw=4 sts=4 et: ************************ //