vtkWriteFieldOps.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::vtkWriteFieldOps
26 
27 Description
28  VTK ASCII and binary write functions
29 
30 SourceFiles
31  vtkWriteFieldOps.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef vtkWriteFieldOps_H
36 #define vtkWriteFieldOps_H
37 
38 #include "vtkWriteOps.H"
39 #include "pointFieldsFwd.H"
40 #include "vtkMesh.H"
41 #include "volPointInterpolation.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Namespace vtkWriteOps Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 namespace vtkWriteOps
53 {
54  //- Write volField with cell values (including decomposed cells)
55  template<class Type>
56  void write
57  (
58  std::ostream&,
59  const bool binary,
60  const DimensionedField<Type, volMesh>&,
61  const vtkMesh&
62  );
63 
64  //- Write pointField on all mesh points. Interpolate to cell centre
65  // for decomposed cell centres.
66  template<class Type>
67  void write
68  (
69  std::ostream&,
70  const bool binary,
71  const GeometricField<Type, pointPatchField, pointMesh>&,
72  const vtkMesh&
73  );
74 
75  //- Write interpolated field on points and original cell values on
76  // decomposed cell centres.
77  template<class Type>
78  void write
79  (
80  std::ostream&,
81  const bool binary,
82  const GeometricField<Type, fvPatchField, volMesh>&,
83  const GeometricField<Type, pointPatchField, pointMesh>&,
84  const vtkMesh&
85  );
86 
87  //- Write generic GeometricFields
88  template<class Type, template<class> class PatchField, class GeoMesh>
89  void write
90  (
91  std::ostream&,
92  const bool binary,
93  const PtrList<GeometricField<Type, PatchField, GeoMesh>>&,
94  const vtkMesh&
95  );
96 
97  //- Interpolate and write volFields
98  template<class Type>
99  void write
100  (
101  std::ostream&,
102  const bool binary,
103  const volPointInterpolation&,
104  const PtrList<GeometricField<Type, fvPatchField, volMesh>>&,
105  const vtkMesh&
106  );
107 
108 } // End namespace vtkWriteOps
109 
110 
111 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
112 
113 } // End namespace Foam
114 
115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116 
117 #ifdef NoRepository
118  #include "vtkWriteFieldOpsTemplates.C"
119 #endif
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 #endif
124 
125 // ************************************************************************* //
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
Namespace for OpenFOAM.