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-2015 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  //- Write generic internal fields
98  template<class Type, class GeoMesh>
99  void write
100  (
102  );
103 
104  //- Interpolate and write volFields
105  template<class Type>
106  void write
107  (
108  const volPointInterpolation&,
110  );
111 
112  //- Interpolate and internal fields
113  template<class Type, class GeoMesh>
114  void write
115  (
116  const volPointInterpolation&,
118  );
119 };
120 
121 
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123 
124 } // End namespace Foam
125 
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127 
128 #ifdef NoRepository
129  #include "internalWriterTemplates.C"
130 #endif
131 
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 #endif
136 
137 // ************************************************************************* //
volFields.H
Foam::internalWriter::write
void write(const PtrList< GeometricField< Type, PatchField, GeoMesh > > &)
Write generic GeometricFields.
Definition: internalWriterTemplates.C:33
Foam::internalWriter::binary_
const bool binary_
Definition: internalWriter.H:60
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
Foam::internalWriter::vMesh_
const vtkMesh & vMesh_
Definition: internalWriter.H:58
Foam::vtkMesh
Encapsulation of VTK mesh data. Holds mesh or meshsubset and polyhedral-cell decomposition on it.
Definition: vtkMesh.H:52
Foam::internalWriter
Write fields (internal).
Definition: internalWriter.H:56
vtkMesh.H
Foam::internalWriter::internalWriter
internalWriter(const vtkMesh &, const bool binary, const fileName &)
Construct from components.
Definition: internalWriter.C:32
OFstream.H
Foam::PtrList
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:61
Foam::internalWriter::fName_
const fileName fName_
Definition: internalWriter.H:62
Foam::internalWriter::os
std::ofstream & os()
Definition: internalWriter.H:81
Foam::GeoMesh
Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
Definition: GeoMesh.H:46
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::internalWriter::writeCellIDs
void writeCellIDs()
Write cellIDs.
Foam::internalWriter::os_
std::ofstream os_
Definition: internalWriter.H:64
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52
Foam::volPointInterpolation
Interpolate from cell centres to points (vertices) using inverse distance weighting.
Definition: volPointInterpolation.H:56
pointFields.H
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51