vtkWriteOps.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::vtkWriteOps
26 
27 Description
28  VTK ASCII and binary write functions
29 
30 SourceFiles
31  vtkWriteOps.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef vtkWriteOps_H
36 #define vtkWriteOps_H
37 
38 #include "floatScalar.H"
39 #include "point.H"
40 #include "tensor.H"
41 #include "labelList.H"
42 #include "DynamicList.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Namespace vtkWriteOps Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 namespace vtkWriteOps
54 {
55  //- Swap halves of word
56  void swapWord(label& word32);
57 
58  //- Swap halves of word
59  void swapWords(const label nWords, label* words32);
60 
61  //- Write header
62  void writeHeader
63  (
64  std::ostream&,
65  const bool isBinary,
66  const std::string& title
67  );
68 
70  (
71  std::ostream&,
72  const label nCells,
73  const label nFields
74  );
75 
77  (
78  std::ostream&,
79  const label nPoints,
80  const label nFields
81  );
82 
83 
84  //- Write floats ascii or binary.
85  // If binary optionally in-place swaps argument
86  void write(std::ostream& os, const bool binary, List<floatScalar>& fField);
87 
88  //- Write floats ascii or binary.
89  // If binary optionally in-place swaps argument
90  void write(std::ostream&, const bool, DynamicList<floatScalar>&);
91 
92  //- Write floats ascii or binary.
93  // If binary optionally in-place swaps argument
94  void write(std::ostream&, const bool, labelList&);
95 
96  //- Write floats ascii or binary.
97  // If binary optionally in-place swaps argument
98  void write(std::ostream&, const bool, DynamicList<label>&);
99 
100 
101  //- Append scalar to given DynamicList
102  void insert(const scalar, DynamicList<floatScalar>&);
103 
104  //- Append point to given DynamicList
105  void insert(const point&, DynamicList<floatScalar>&);
106 
107  //- Append sphericalTensor to given DynamicList
109 
110  //- Append symmTensor to given DynamicList
112 
113  //- Append tensor to given DynamicList
114  void insert(const tensor&, DynamicList<floatScalar>&);
115 
116  //- Append elements to DynamicList
117  void insert(const labelList&, DynamicList<label>&);
118 
119  //- Append elements to DynamicList
120  template<class Type>
122 
123  //- Append elements of scalarList to given DynamicList using map
124  void insert
125  (
126  const labelList& map,
127  const List<scalar>& source,
129  );
130 
131  //- Append points to given DynamicList of floats
132  void insert(const List<point>& source, DynamicList<floatScalar>&);
133 
134  //- Append points to given DynamicList of floats using map
135  void insert
136  (
137  const labelList& map,
138  const List<point>& source,
140  );
141 
142 } // End namespace vtkWriteOps
143 
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 } // End namespace Foam
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 #ifdef NoRepository
152  #include "vtkWriteOpsTemplates.C"
153 #endif
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 #endif
158 
159 // ************************************************************************* //
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
Templated 3D symmetric tensor derived from VectorSpace adding construction from 6 components...
Definition: SymmTensor.H:53
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
void writeCellDataHeader(std::ostream &, const label nCells, const label nFields)
void insert(const scalar, DynamicList< floatScalar > &)
Append scalar to given DynamicList.
Templated 3D SphericalTensor derived from VectorSpace adding construction from 1 component, element access using th ii() member function and the inner-product (dot-product) and outer-product operators.
void swapWords(const label nWords, label *words32)
Swap halves of word.
void writeHeader(std::ostream &, const bool isBinary, const std::string &title)
Write header.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
Definition: DynamicList.H:56
label nPoints
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
Templated 3D Vector derived from VectorSpace adding construction from 3 components, element access using x(), y() and z() member functions and the inner-product (dot-product) and cross product operators.
Definition: Vector.H:57
VTK ASCII and binary write functions.
void writePointDataHeader(std::ostream &, const label nPoints, const label nFields)
void swapWord(label &word32)
Swap halves of word.
Namespace for OpenFOAM.