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-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::lagrangianWriter
26 
27 Description
28  Writes Lagrangian points and fields
29 
30 SourceFiles
31  lagrangianWriter.C
32  lagrangianWriterTemplates.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef lagrangianWriter_H
37 #define lagrangianWriter_H
38 
39 #include "vtkMesh.H"
40 #include <fstream>
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 class volPointInterpolation;
48 
49 /*---------------------------------------------------------------------------*\
50  Class lagrangianWriter Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class lagrangianWriter
54 {
55  const vtkMesh& vMesh_;
56 
57  const bool binary_;
58 
59  const fileName fName_;
60 
61  const word cloudName_;
62 
63  std::ofstream os_;
64 
65  label nParcels_;
66 
67 
68 public:
69 
70  // Constructors
71 
72  //- Construct from components
74  (
75  const vtkMesh&,
76  const bool binary,
77  const fileName&,
78  const word&,
79  const bool dummyCloud
80  );
81 
82 
83  // Member Functions
84 
85  //- Write the fields header specifying the number of fields
86  void writeFieldsHeader(const label nFields);
87 
88  //- Write IOField
89  template<class Type>
90  void writeIOField(const wordList&);
91 };
92 
93 
94 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
95 
96 } // End namespace Foam
97 
98 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
99 
100 #ifdef NoRepository
101  #include "lagrangianWriterTemplates.C"
102 #endif
103 
104 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
105 
106 #endif
107 
108 // ************************************************************************* //
A class for handling file names.
Definition: fileName.H:82
Writes Lagrangian points and fields.
void writeFieldsHeader(const label nFields)
Write the fields header specifying the number of fields.
lagrangianWriter(const vtkMesh &, const bool binary, const fileName &, const word &, const bool dummyCloud)
Construct from components.
void writeIOField(const wordList &)
Write IOField.
Encapsulation of VTK mesh data. Holds mesh or meshsubset and polyhedral-cell decomposition on it.
Definition: vtkMesh.H:53
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
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