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-2020 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::fileFormats::GTSsurfaceFormat
29
30Description
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 Output stream options:
37 - ASCII only
38 - compression on/off
39
40 Output dictionary options: ignored
41
42SourceFiles
43 GTSsurfaceFormat.C
44
45\*---------------------------------------------------------------------------*/
46
47#ifndef GTSsurfaceFormat_H
48#define GTSsurfaceFormat_H
49
50#include "MeshedSurface.H"
51#include "MeshedSurfaceProxy.H"
53
54// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55
56namespace Foam
57{
58namespace fileFormats
59{
60
61/*---------------------------------------------------------------------------*\
62 Class fileFormats::GTSsurfaceFormat Declaration
63\*---------------------------------------------------------------------------*/
64
65template<class Face>
67:
68 public UnsortedMeshedSurface<Face>
69{
70 // Private Member Functions
71
72 //- Check and raise FatalError if output is not triangulated
73 // Triangulating on-the-fly is otherwise too annoying
74 static bool checkIfTriangulated(const UList<Face>& faceLst);
75
76
77public:
78
79 // Constructors
80
81 //- Construct from file name
82 GTSsurfaceFormat(const fileName& filename);
83
84
85 //- Destructor
86 virtual ~GTSsurfaceFormat() = default;
87
88
89 // Static Functions
90
91 //- Write MeshedSurface
92 static void write
93 (
94 const fileName& filename,
95 const MeshedSurface<Face>& surf,
96 IOstreamOption streamOpt = IOstreamOption(),
97 const dictionary& /*unused*/ = dictionary::null
98 );
99
100 //- Write UnsortedMeshedSurface, the output remains unsorted
101 static void write
102 (
103 const fileName& filename,
104 const UnsortedMeshedSurface<Face>& surf,
105 IOstreamOption streamOpt = IOstreamOption(),
106 const dictionary& /*unused*/ = dictionary::null
107 );
108
109
110 // Member Functions
111
112 //- Read from file
113 virtual bool read(const fileName& filename);
114
115 //- Write surface mesh to file
116 virtual void write
117 (
118 const fileName& name,
119 IOstreamOption streamOpt = IOstreamOption(),
120 const dictionary& options = dictionary::null
121 ) const
122 {
123 write(name, *this, streamOpt, options);
124 }
125};
126
127
128// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129
130} // End namespace fileFormats
131} // End namespace Foam
132
133// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134
135#ifdef NoRepository
136 #include "GTSsurfaceFormat.C"
137#endif
138
139// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140
141#endif
142
143// ************************************************************************* //
The IOstreamOption is a simple container for options an IOstream can normally have.
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
Definition: MeshedSurface.H:99
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: UList.H:94
A surface geometry mesh, in which the surface zone information is conveyed by the 'zoneId' associated...
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
virtual void write(const fileName &name, IOstreamOption streamOpt=IOstreamOption(), const dictionary &options=dictionary::null) const
Write surface mesh to file.
virtual bool read(const fileName &filename)
Read from file.
virtual ~GTSsurfaceFormat()=default
Destructor.
A class for handling file names.
Definition: fileName.H:76
Namespace for OpenFOAM.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
runTime write()