SMESHsurfaceFormat.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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2016-2024 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::fileFormats::SMESHsurfaceFormat
29 
30 Description
31  Write tetgen SMESH format (Tetgen http://tetgen.berlios.de)
32 
33  Output stream options:
34  - ASCII only
35  - compression on/off
36 
37  Output dictionary options: ignored
38 
39 See also
40  File format information:
41  http://tetgen.berlios.de/fformats.smesh.html
42 
43 SourceFiles
44  SMESHsurfaceFormat.C
45 
46 \*---------------------------------------------------------------------------*/
47 
48 #ifndef Foam_SMESHsurfaceFormat_H
49 #define Foam_SMESHsurfaceFormat_H
50 
51 #include "MeshedSurface.H"
52 #include "MeshedSurfaceProxy.H"
53 #include "UnsortedMeshedSurface.H"
54 
55 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 
57 namespace Foam
58 {
59 namespace fileFormats
60 {
61 
62 /*---------------------------------------------------------------------------*\
63  Class fileFormats::SMESHsurfaceFormat Declaration
64 \*---------------------------------------------------------------------------*/
65 
66 template<class Face>
68 :
69  public MeshedSurface<Face>
70 {
71 public:
72 
73  // Constructors
74 
75  //- Default construct
76  SMESHsurfaceFormat() = default;
77 
78 
79  //- Destructor
80  virtual ~SMESHsurfaceFormat() = default;
81 
82 
83  // Static Functions
84 
85  //- Write surface mesh components (by proxy) in SMESH format
86  static void write
87  (
88  const fileName& filename,
89  const MeshedSurfaceProxy<Face>& surf,
90  IOstreamOption streamOpt = IOstreamOption(),
91  const dictionary& /*unused*/ = dictionary::null
92  );
93 
94 
95  // Member Functions
96 
97  //- Write surface mesh to file (by proxy)
98  virtual void write
99  (
100  const fileName& name,
101  IOstreamOption streamOpt = IOstreamOption(),
102  const dictionary& options = dictionary::null
103  ) const override
104  {
105  write(name, MeshedSurfaceProxy<Face>(*this), streamOpt, options);
106  }
107 
108  //- Write surface mesh to file (by proxy)
109  virtual void write
110  (
111  const fileName& name,
112  const word& fileType, /* ignored */
113  IOstreamOption streamOpt = IOstreamOption(),
114  const dictionary& options = dictionary::null
115  ) const override
116  {
117  write(name, MeshedSurfaceProxy<Face>(*this), streamOpt, options);
118  }
119 };
120 
121 
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123 
124 } // End namespace fileFormats
125 } // End namespace Foam
126 
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 
129 #ifdef NoRepository
130  #include "SMESHsurfaceFormat.C"
131 #endif
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 #endif
136 
137 // ************************************************************************* //
A class for handling file names.
Definition: fileName.H:72
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
Write tetgen SMESH format (Tetgen http://tetgen.berlios.de)
SMESHsurfaceFormat()=default
Default construct.
A simple container for options an IOstream can normally have.
virtual ~SMESHsurfaceFormat()=default
Destructor.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition: exprTraits.C:127
static void write(const fileName &filename, const MeshedSurfaceProxy< Face > &surf, IOstreamOption streamOpt=IOstreamOption(), const dictionary &=dictionary::null)
Write surface mesh components (by proxy) in SMESH format.
A class for handling words, derived from Foam::string.
Definition: word.H:63
static const dictionary null
An empty dictionary, which is also the parent for all dictionaries.
Definition: dictionary.H:486
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats...
Definition: MeshedSurface.H:75
Namespace for OpenFOAM.