GTSsurfaceFormat.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-2017 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::GTSsurfaceFormat
29 
30 Description
31  Read/write GTS format.
32 
33  The output is never sorted by zone and is only written if it consists
34  entirely of triangles.
35 
36 SourceFiles
37  GTSsurfaceFormat.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef GTSsurfaceFormat_H
42 #define GTSsurfaceFormat_H
43 
44 #include "MeshedSurface.H"
45 #include "MeshedSurfaceProxy.H"
46 #include "UnsortedMeshedSurface.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 namespace fileFormats
53 {
54 
55 /*---------------------------------------------------------------------------*\
56  Class fileFormats::GTSsurfaceFormat Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 template<class Face>
60 class GTSsurfaceFormat
61 :
62  public UnsortedMeshedSurface<Face>
63 {
64  // Private Member Functions
65 
66  //- Check and raise FatalError if output is not triangulated
67  // Triangulating on-the-fly is otherwise too annoying
68  static bool checkIfTriangulated(const UList<Face>& faceLst);
69 
70 
71 public:
72 
73  // Constructors
74 
75  //- Construct from file name
76  GTSsurfaceFormat(const fileName& filename);
77 
78 
79  //- Destructor
80  virtual ~GTSsurfaceFormat() = default;
81 
82 
83  // Static Member Functions
84 
85  //- Write MeshedSurface
86  static void write
87  (
88  const fileName& filename,
89  const MeshedSurface<Face>& surf,
90  const dictionary& options = dictionary::null
91  );
92 
93  //- Write UnsortedMeshedSurface, the output remains unsorted
94  static void write
95  (
96  const fileName& filename,
97  const UnsortedMeshedSurface<Face>& surf,
98  const dictionary& options = dictionary::null
99  );
100 
101 
102  // Member Functions
103 
104  //- Read from file
105  virtual bool read(const fileName& filename);
106 
107  //- Write surface mesh to file
108  virtual void write
109  (
110  const fileName& name,
111  const dictionary& options = dictionary::null
112  ) const
113  {
114  write(name, *this, options);
115  }
116 };
117 
118 
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 
121 } // End namespace fileFormats
122 } // End namespace Foam
123 
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 
126 #ifdef NoRepository
127  #include "GTSsurfaceFormat.C"
128 #endif
129 
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
131 
132 #endif
133 
134 // ************************************************************************* //
MeshedSurfaceProxy.H
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
Foam::fileFormats::GTSsurfaceFormat::read
virtual bool read(const fileName &filename)
Read from file.
Definition: GTSsurfaceFormat.C:85
Foam::dictionary::null
static const dictionary null
An empty dictionary, which is also the parent for all dictionaries.
Definition: dictionary.H:385
UnsortedMeshedSurface.H
Foam::UnsortedMeshedSurface
A surface geometry mesh, in which the surface zone information is conveyed by the 'zoneId' associated...
Definition: MeshedSurface.H:79
Foam::name
word name(const complex &c)
Return string representation of complex.
Definition: complex.C:76
GTSsurfaceFormat.C
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::fileFormats::GTSsurfaceFormat::write
static void write(const fileName &filename, const MeshedSurface< Face > &surf, const dictionary &options=dictionary::null)
Write MeshedSurface.
Definition: GTSsurfaceFormat.C:249
Foam::fileFormats::GTSsurfaceFormat::GTSsurfaceFormat
GTSsurfaceFormat(const fileName &filename)
Construct from file name.
Definition: GTSsurfaceFormat.C:73
Foam::fileFormats::GTSsurfaceFormat
Read/write GTS format.
Definition: GTSsurfaceFormat.H:59
Foam::UList< Face >
Foam::fileFormats::GTSsurfaceFormat::~GTSsurfaceFormat
virtual ~GTSsurfaceFormat()=default
Destructor.
Foam::MeshedSurface
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
Definition: triSurfaceTools.H:80
MeshedSurface.H