surfaceMeshWriter.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-2018 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::surfaceMeshWriter
26 
27 Description
28  Write faces with fields
29 
30 SourceFiles
31  surfaceMeshWriter.C
32  surfaceMeshWriterTemplates.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef surfaceMeshWriter_H
37 #define surfaceMeshWriter_H
38 
39 #include "pointMesh.H"
40 #include "OFstream.H"
41 #include "volFields.H"
42 #include "surfaceFields.H"
43 #include "vtkMesh.H"
44 #include "indirectPrimitivePatch.H"
45 
46 using namespace Foam;
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 
54 
55 /*---------------------------------------------------------------------------*\
56  Class surfaceMeshWriter Declaration
57 \*---------------------------------------------------------------------------*/
58 
60 {
61  const bool binary_;
62 
63  const indirectPrimitivePatch& pp_;
64 
65  const fileName fName_;
66 
67  std::ofstream os_;
68 
69 
70 public:
71 
72  // Constructors
73 
74  //- Construct from components
76  (
77  const bool binary,
78  const indirectPrimitivePatch& pp,
79  const word& name,
80  const fileName&
81  );
82 
83 
84  // Member Functions
85 
86  std::ofstream& os()
87  {
88  return os_;
89  }
90 
91  //- Extract face data
92  template<class Type>
94  (
96  ) const;
97 
98  //- Write surfaceFields
99  template<class Type>
100  void write
101  (
102  const UPtrList
103  <
105  >&
106  );
107 };
108 
109 
110 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
111 
112 } // End namespace Foam
113 
114 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
115 
116 #ifdef NoRepository
118 #endif
119 
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 #endif
124 
125 // ************************************************************************* //
Foam::surfaceFields.
A class for handling file names.
Definition: fileName.H:79
Write faces with fields.
tmp< Field< Type > > getFaceField(const GeometricField< Type, fvsPatchField, surfaceMesh > &) const
Extract face data.
Generic GeometricField class.
A list of faces which address into the list of points.
A class for handling words, derived from string.
Definition: word.H:59
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.
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
void write(const UPtrList< const GeometricField< Type, fvsPatchField, surfaceMesh > > &)
Write surfaceFields.
surfaceMeshWriter(const bool binary, const indirectPrimitivePatch &pp, const word &name, const fileName &)
Construct from components.
A class for managing temporary objects.
Definition: PtrList.H:53
Namespace for OpenFOAM.