internalWriter.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 | Copyright (C) 2011-2016 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::internalWriter
26 
27 Description
28  Write fields (internal).
29 
30 SourceFiles
31  internalWriter.C
32  internalWriterTemplates.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef internalWriter_H
37 #define internalWriter_H
38 
39 #include "OFstream.H"
40 #include "volFields.H"
41 #include "pointFields.H"
42 #include "vtkMesh.H"
43 
44 using namespace Foam;
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
52 
53 /*---------------------------------------------------------------------------*\
54  Class internalWriter Declaration
55 \*---------------------------------------------------------------------------*/
56 
57 class internalWriter
58 {
59  const vtkMesh& vMesh_;
60 
61  const bool binary_;
62 
63  const fileName fName_;
64 
65  std::ofstream os_;
66 
67 public:
68 
69  // Constructors
70 
71  //- Construct from components
73  (
74  const vtkMesh&,
75  const bool binary,
76  const fileName&
77  );
78 
79 
80  // Member Functions
81 
82  std::ofstream& os()
83  {
84  return os_;
85  }
86 
87  //- Write cellIDs
88  void writeCellIDs();
89 
90  //- Write generic GeometricFields
91  template<class Type, template<class> class PatchField, class GeoMesh>
92  void write
93  (
95  );
96 
97  //- Interpolate and write volFields
98  template<class Type>
99  void write
100  (
101  const volPointInterpolation&,
103  );
104 };
105 
106 
107 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
108 
109 } // End namespace Foam
110 
111 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
112 
113 #ifdef NoRepository
114  #include "internalWriterTemplates.C"
115 #endif
116 
117 
118 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119 
120 #endif
121 
122 // ************************************************************************* //
A class for handling file names.
Definition: fileName.H:69
Generic GeometricField class.
void writeCellIDs()
Write cellIDs.
void write(const UPtrList< const GeometricField< Type, PatchField, GeoMesh >> &)
Write generic GeometricFields.
std::ofstream & os()
Encapsulation of VTK mesh data. Holds mesh or meshsubset and polyhedral-cell decomposition on it...
Definition: vtkMesh.H:52
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: UPtrList.H:54
Interpolate from cell centres to points (vertices) using inverse distance weighting.
Write fields (internal).
Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
Definition: GeoMesh.H:46
internalWriter(const vtkMesh &, const bool binary, const fileName &)
Construct from components.
Namespace for OpenFOAM.