lagrangianWriter.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::lagrangianWriter
26 
27 Description
28  Write fields (internal).
29 
30 SourceFiles
31  lagrangianWriter.C
32  lagrangianWriterTemplates.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef lagrangianWriter_H
37 #define lagrangianWriter_H
38 
39 #include "OFstream.H"
40 #include "Cloud.H"
41 #include "volFields.H"
42 #include "pointFields.H"
43 #include "vtkMesh.H"
44 
45 using namespace Foam;
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
53 
54 /*---------------------------------------------------------------------------*\
55  Class lagrangianWriter Declaration
56 \*---------------------------------------------------------------------------*/
57 
58 class lagrangianWriter
59 {
60  const vtkMesh& vMesh_;
61 
62  const bool binary_;
63 
64  const fileName fName_;
65 
66  const word cloudName_;
67 
68  std::ofstream os_;
69 
70  label nParcels_;
71 
72 
73 public:
74 
75  // Constructors
76 
77  //- Construct from components
79  (
80  const vtkMesh&,
81  const bool binary,
82  const fileName&,
83  const word&,
84  const bool dummyCloud
85  );
86 
87 
88  // Member Functions
89 
90  std::ofstream& os()
91  {
92  return os_;
93  }
94 
95  void writeParcelHeader(const label nFields);
96 
97  //- Write IOField
98  template<class Type>
99  void writeIOField(const wordList&);
100 };
101 
102 
103 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
104 
105 } // End namespace Foam
106 
107 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
108 
109 #ifdef NoRepository
110  #include "lagrangianWriterTemplates.C"
111 #endif
112 
113 
114 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
115 
116 #endif
117 
118 // ************************************************************************* //
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
A class for handling file names.
Definition: fileName.H:69
Write fields (internal).
A class for handling words, derived from string.
Definition: word.H:59
std::ofstream & os()
Encapsulation of VTK mesh data. Holds mesh or meshsubset and polyhedral-cell decomposition on it...
Definition: vtkMesh.H:52
Interpolate from cell centres to points (vertices) using inverse distance weighting.
lagrangianWriter(const vtkMesh &, const bool binary, const fileName &, const word &, const bool dummyCloud)
Construct from components.
void writeParcelHeader(const label nFields)
void writeIOField(const wordList &)
Write IOField.
Namespace for OpenFOAM.