TRIsurfaceFormat.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::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 
74 public:
75 
76  // Constructors
77 
78  //- Construct from file name
79  TRIsurfaceFormat(const fileName&);
80 
81  //- Disallow default bitwise copy construction
83 
84 
85  // Selectors
86 
87  //- Read file and return surface
89  {
91  (
93  );
94  }
95 
96 
97  //- Destructor
98  virtual ~TRIsurfaceFormat()
99  {}
100 
101 
102  // Member Functions
103 
104  //- Write surface mesh components by proxy
105  static void write(const fileName&, const MeshedSurfaceProxy<Face>&);
106 
107  //- Write UnsortedMeshedSurface,
108  // by default the output is not sorted by zones
109  static void write(const fileName&, const UnsortedMeshedSurface<Face>&);
110 
111  //- Read from file
112  virtual bool read(const fileName&);
113 
114  //- Write object
115  virtual void write(const fileName& name) const
116  {
117  write(name, MeshedSurfaceProxy<Face>(*this));
118  }
119 
120 
121  // Member Operators
122 
123  //- Disallow default bitwise assignment
124  void operator=(const TRIsurfaceFormat<Face>&) = delete;
125 };
126 
127 
128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 
130 } // End namespace fileFormats
131 } // End namespace Foam
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 #ifdef NoRepository
136  #include "TRIsurfaceFormat.C"
137 #endif
138 
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 
141 #endif
142 
143 // ************************************************************************* //
A surface geometry mesh, in which the surface zone information is conveyed by the &#39;zoneId&#39; associated...
Definition: MeshedSurface.H:74
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
A class for handling file names.
Definition: fileName.H:79
static autoPtr< MeshedSurface< Face > > New(const fileName &name)
Read file and return surface.
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
Definition: MeshedSurface.H:72
virtual ~TRIsurfaceFormat()
Destructor.
Provide a means of reading/writing .tri format.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats...
Definition: MeshedSurface.H:73
virtual bool read(const fileName &)
Read from file.
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
void operator=(const TRIsurfaceFormat< Face > &)=delete
Disallow default bitwise assignment.
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 void write(const fileName &, const MeshedSurfaceProxy< Face > &)
Write surface mesh components by proxy.
TRIsurfaceFormat(const fileName &)
Construct from file name.
Namespace for OpenFOAM.