TRIsurfaceFormat.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) 2011 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::TRIsurfaceFormat
26 
27 Description
28  Provide a means of reading/writing .tri format.
29 
30 Note
31  For efficiency, the zones are sorted before creating the faces.
32  The class is thus derived from MeshedSurface.
33 
34 SourceFiles
35  TRIsurfaceFormat.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef TRIsurfaceFormat_H
40 #define TRIsurfaceFormat_H
41 
42 #include "TRIsurfaceFormatCore.H"
43 #include "MeshedSurface.H"
44 #include "MeshedSurfaceProxy.H"
45 #include "UnsortedMeshedSurface.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 namespace fileFormats
52 {
53 
54 /*---------------------------------------------------------------------------*\
55  Class TRIsurfaceFormat Declaration
56 \*---------------------------------------------------------------------------*/
57 
58 template<class Face>
59 class TRIsurfaceFormat
60 :
61  public MeshedSurface<Face>
62 {
63  // Private Member Functions
64 
65  static inline void writeShell
66  (
67  Ostream&,
68  const pointField&,
69  const Face&,
70  const label zoneI
71  );
72 
73  //- Disallow default bitwise copy construct
75 
76  //- Disallow default bitwise assignment
77  void operator=(const TRIsurfaceFormat<Face>&);
78 
79 
80 public:
81 
82  // Constructors
83 
84  //- Construct from file name
85  TRIsurfaceFormat(const fileName&);
86 
87 
88  // Selectors
89 
90  //- Read file and return surface
92  {
94  (
96  );
97  }
98 
99 
100  //- Destructor
101  virtual ~TRIsurfaceFormat()
102  {}
103 
104 
105  // Member Functions
106 
107  //- Write surface mesh components by proxy
108  static void write(const fileName&, const MeshedSurfaceProxy<Face>&);
109 
110  //- Write UnsortedMeshedSurface,
111  // by default the output is not sorted by zones
112  static void write(const fileName&, const UnsortedMeshedSurface<Face>&);
113 
114  //- Read from file
115  virtual bool read(const fileName&);
116 
117  //- Write object
118  virtual void write(const fileName& name) const
119  {
120  write(name, MeshedSurfaceProxy<Face>(*this));
121  }
122 };
123 
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 } // End namespace fileFormats
128 } // End namespace Foam
129 
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
131 
132 #ifdef NoRepository
133 # include "TRIsurfaceFormat.C"
134 #endif
135 
136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 
138 #endif
139 
140 // ************************************************************************* //
static autoPtr< MeshedSurface< Face > > New(const fileName &name)
Read file and return surface.
static void write(const fileName &, const MeshedSurfaceProxy< Face > &)
Write surface mesh components by proxy.
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats...
Definition: MeshedSurface.H:73
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Namespace for OpenFOAM.
virtual bool read(const fileName &)
Read from file.
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 Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
Provide a means of reading/writing .tri format.
virtual ~TRIsurfaceFormat()
Destructor.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117