foamVtkSurfaceMeshWriter.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) 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::vtk::surfaceMeshWriter
29 
30 Description
31  Write faces (eg face-zones or face-sets) with fields.
32 
33  The file output states are managed by the Foam::vtk::fileWriter class.
34  FieldData (eg, TimeValue) must appear before any geometry pieces.
35 
36 Note
37  Parallel output is combined into a single Piece without point merging,
38  which is similar to using multi-piece data sets, but allows more
39  convenient creation as a streaming process.
40  In the future, the duplicate points at processor connections
41  may be addressed using ghost points.
42 
43 SourceFiles
44  foamVtkSurfaceMeshWriterTemplates.C
45 
46 \*---------------------------------------------------------------------------*/
47 
48 #ifndef foamVtkSurfaceMeshWriter_H
49 #define foamVtkSurfaceMeshWriter_H
50 
51 #include <fstream>
52 #include "areaFields.H"
53 #include "surfaceFields.H"
54 #include "foamVtkIndPatchWriter.H"
55 
56 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57 
58 namespace Foam
59 {
60 namespace vtk
61 {
62 
63 /*---------------------------------------------------------------------------*\
64  Class vtk::surfaceMeshWriter Declaration
65 \*---------------------------------------------------------------------------*/
66 
68 :
70 {
71  // Private Member Functions
72 
73  //- Get face field (internal face or boundary face)
74  template<class Type>
75  tmp<Field<Type>> getFaceField
76  (
78  ) const;
79 
80 
81  //- No copy construct
82  surfaceMeshWriter(const surfaceMeshWriter&) = delete;
83 
84  //- No copy assignment
85  void operator=(const surfaceMeshWriter&) = delete;
86 
87 
88 public:
89 
90  // Constructors
91 
92  //- Construct from patch (default format INLINE_BASE64)
94  (
95  const indirectPrimitivePatch& pp,
97  )
98  :
99  vtk::indirectPatchWriter(pp, opts)
100  {}
101 
102  //- Construct from patch (default format INLINE_BASE64),
103  //- and open the file for writing.
104  // The file name is with/without an extension.
106  (
107  const indirectPrimitivePatch& pp,
108  const fileName& file,
109  bool parallel = Pstream::parRun()
110  )
111  :
112  vtk::indirectPatchWriter(pp, file, parallel)
113  {}
114 
115  //- Construct from patch and open the file for writing.
116  // The file name is with/without an extension.
118  (
119  const indirectPrimitivePatch& pp,
120  const vtk::outputOptions opts,
121  const fileName& file,
122  bool parallel = Pstream::parRun()
123  )
124  :
125  vtk::indirectPatchWriter(pp, opts, file, parallel)
126  {}
127 
128 
129  //- Destructor
130  virtual ~surfaceMeshWriter() = default;
131 
132 
133  // Member Functions
134 
135  //- Write surface field (CellData)
136  template<class Type>
137  void write
138  (
140  );
141 
142  //- Write surface field (CellData)
143  template<class Type>
144  void write
145  (
147  );
148 };
149 
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 } // End namespace vtk
154 } // End namespace Foam
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 #ifdef NoRepository
160 #endif
161 
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 #endif
166 
167 // ************************************************************************* //
Foam::vtk::outputOptions
Encapsulated combinations of output format options. This is primarily useful when defining the output...
Definition: foamVtkOutputOptions.H:59
Foam::vtk::indirectPatchWriter
Write indirectPrimitivePatch faces/points (optionally with fields) as a vtp file or a legacy vtk file...
Definition: foamVtkIndPatchWriter.H:65
Foam::vtk::fileWriter::parallel
bool parallel() const
Parallel output requested?
Definition: foamVtkFileWriterI.H:80
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
Foam::vtk::fileWriter::opts
vtk::outputOptions opts() const
The output options in use.
Definition: foamVtkFileWriterI.H:62
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
foamVtkIndPatchWriter.H
Foam::UPstream::parRun
static bool & parRun()
Test if this a parallel run, or allow modify access.
Definition: UPstream.H:434
surfaceFields.H
Foam::surfaceFields.
Foam::vtk::surfaceMeshWriter::~surfaceMeshWriter
virtual ~surfaceMeshWriter()=default
Destructor.
field
rDeltaTY field()
areaFields.H
Foam::vtk::surfaceMeshWriter
Write faces (eg face-zones or face-sets) with fields.
Definition: foamVtkSurfaceMeshWriter.H:66
Foam::vtk::formatType::INLINE_BASE64
XML inline base64, base64Formatter.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::vtk::surfaceMeshWriter::write
void write(const GeometricField< Type, fvsPatchField, surfaceMesh > &field)
Write surface field (CellData)
Definition: foamVtkSurfaceMeshWriterTemplates.C:70
foamVtkSurfaceMeshWriterTemplates.C
Foam::GeometricField
Generic GeometricField class.
Definition: areaFieldsFwd.H:53
Foam::PrimitivePatch
A list of faces which address into the list of points.
Definition: PrimitivePatch.H:85