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-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::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  {
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 proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats.
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
Definition: MeshedSurface.H:85
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
A surface geometry mesh, in which the surface zone information is conveyed by the 'zoneId' associated...
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
Provide a means of reading/writing .tri format.
static void write(const fileName &, const MeshedSurfaceProxy< Face > &)
Write surface mesh components by proxy.
TRIsurfaceFormat(const fileName &)
Construct from file name.
virtual bool read(const fileName &)
Read from file.
static autoPtr< MeshedSurface< Face > > New(const fileName &name)
Read file and return surface.
void operator=(const TRIsurfaceFormat< Face > &)=delete
Disallow default bitwise assignment.
virtual ~TRIsurfaceFormat()
Destructor.
A class for handling file names.
Definition: fileName.H:82
Namespace for OpenFOAM.
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
word name(const bool)
Return a word representation of a bool.
Definition: boolIO.C:39