Loading...
Searching...
No Matches
VTPsurfaceFormat.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) 2017-2024 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::fileFormats::VTPsurfaceFormat
28
29Description
30 Write surfaces in VTP (xml) format.
31 The default format is INLINE_BASE64
32
33 The output is never sorted by zone.
34
35 Output stream options: ignored (dictionary options only)
36
37 \heading Format options
38 \table
39 Property | Description | Required | Default
40 format | ascii or binary format | no | binary
41 precision | Write precision in ascii | no | same as IOstream
42 \endtable
43
44SourceFiles
45 VTPsurfaceFormat.C
46
47\*---------------------------------------------------------------------------*/
48
49#ifndef Foam_VTPsurfaceFormat_H
50#define Foam_VTPsurfaceFormat_H
51
52#include "MeshedSurface.H"
53#include "MeshedSurfaceProxy.H"
56
57// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
58
59namespace Foam
60{
61namespace fileFormats
62{
63
64/*---------------------------------------------------------------------------*\
65 Class fileFormats::VTPsurfaceFormat Declaration
66\*---------------------------------------------------------------------------*/
67
68template<class Face>
70:
71 public MeshedSurface<Face>,
73{
74 // Private Member Functions
75
76 //- Write polygons
77 static void writePolys
78 (
80 const UList<Face>& faces
81 );
82
83
84public:
85
86 // Constructors
87
88 //- Default construct
89 VTPsurfaceFormat() = default;
90
91
92 //- Destructor
93 virtual ~VTPsurfaceFormat() = default;
94
95
96 // Static Functions
97
98 //- Write surface mesh components (by proxy) in VTP format
99 static void write
100 (
101 const fileName& filename,
102 const MeshedSurfaceProxy<Face>& surf,
104 const dictionary& options = dictionary::null
105 );
106
107 //- Write UnsortedMeshedSurface, the output remains unsorted
108 static void write
110 const fileName& filename,
111 const UnsortedMeshedSurface<Face>& surf,
112 IOstreamOption /*ignored*/ = IOstreamOption(),
113 const dictionary& options = dictionary::null
114 );
115
116
117 // Member Functions
118
119 //- Write surface mesh to file (by proxy)
120 virtual void write
121 (
122 const fileName& name,
123 IOstreamOption streamOpt = IOstreamOption(),
124 const dictionary& options = dictionary::null
125 ) const override
126 {
127 write(name, MeshedSurfaceProxy<Face>(*this), streamOpt, options);
128 }
129
130 //- Write surface mesh to file (by proxy)
131 virtual void write
132 (
133 const fileName& name,
134 const word& fileType, /* ignored */
135 IOstreamOption streamOpt = IOstreamOption(),
136 const dictionary& options = dictionary::null
137 ) const override
138 {
139 write(name, MeshedSurfaceProxy<Face>(*this), streamOpt, options);
140 }
141};
143
144// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145
146} // End namespace fileFormats
147} // End namespace Foam
148
149// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150
151#ifdef NoRepository
152 #include "VTPsurfaceFormat.C"
153#endif
154
155// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156
157#endif
158
159// ************************************************************************* //
A simple container for options an IOstream can normally have.
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats.
friend class UnsortedMeshedSurface
friend class MeshedSurface
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:89
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
static const dictionary null
An empty dictionary, which is also the parent for all dictionaries.
Definition dictionary.H:487
Internal class used by the VTPsurfaceFormat. The default format is INLINE_BASE64.
Write surfaces in VTP (xml) format. The default format is INLINE_BASE64.
VTPsurfaceFormat()=default
Default construct.
virtual ~VTPsurfaceFormat()=default
Destructor.
virtual void write(const fileName &name, const word &fileType, IOstreamOption streamOpt=IOstreamOption(), const dictionary &options=dictionary::null) const override
Write surface mesh to file (by proxy).
virtual void write(const fileName &name, IOstreamOption streamOpt=IOstreamOption(), const dictionary &options=dictionary::null) const override
Write surface mesh to file (by proxy).
A class for handling file names.
Definition fileName.H:75
Abstract class for a VTK output stream formatter.
A class for handling words, derived from Foam::string.
Definition word.H:66
Namespace to isolate specifics for file formats, and some common utilities.
Namespace for OpenFOAM.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127
runTime write()
word format(conversionProperties.get< word >("format"))