VTK  9.4.20241122
vtkFLUENTReader.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
27#ifndef vtkFLUENTReader_h
28#define vtkFLUENTReader_h
29
30#include "vtkIOGeometryModule.h" // For export macro
32#include "vtkNew.h" // For vtkNew
33
34VTK_ABI_NAMESPACE_BEGIN
36class vtkPoints;
37class vtkTriangle;
38class vtkTetra;
39class vtkQuad;
40class vtkHexahedron;
41class vtkPyramid;
42class vtkWedge;
45
46class VTKIOGEOMETRY_EXPORT vtkFLUENTReader : public vtkMultiBlockDataSetAlgorithm
47{
48public:
51 void PrintSelf(ostream& os, vtkIndent indent) override;
52
54
60
62
66 vtkGetMacro(NumberOfCells, vtkIdType);
68
73
78 const char* GetCellArrayName(int index);
79
81
85 int GetCellArrayStatus(const char* name);
86 void SetCellArrayStatus(const char* name, int status);
88
90
96
98
117 //
118 // Structures
119 //
120 struct Cell;
121 struct Face;
122 struct Zone;
123 struct ScalarDataChunk;
124 struct VectorDataChunk;
125 struct SubSection;
127
128protected:
133
135
139 vtkSetMacro(SwapBytes, vtkTypeBool);
140 vtkTypeBool GetSwapBytes() { return this->SwapBytes; }
141 vtkBooleanMacro(SwapBytes, vtkTypeBool);
143
144 virtual bool OpenCaseFile(const char* filename);
145 virtual bool OpenDataFile(const char* filename);
146 virtual int GetCaseChunk();
147 virtual int GetCaseIndex();
148 virtual void LoadVariableNames();
149 virtual int GetDataIndex();
150 virtual int GetDataChunk();
152
153 virtual bool ParseCaseFile();
154 virtual int GetDimension();
155 virtual void GetLittleEndianFlag();
156 virtual void GetNodesAscii();
159 virtual void GetCellsAscii();
160 virtual void GetCellsBinary();
161 virtual void ReadZone();
162 virtual bool GetFacesAscii();
163 virtual void GetFacesBinary();
166 virtual void GetCellTreeAscii();
167 virtual void GetCellTreeBinary();
168 virtual void GetFaceTreeAscii();
169 virtual void GetFaceTreeBinary();
174 virtual void GetPartitionInfo() {}
175 virtual void CleanCells();
176 virtual void PopulateCellNodes();
177 virtual int GetCaseBufferInt(int ptr);
178 virtual float GetCaseBufferFloat(int ptr);
179 virtual double GetCaseBufferDouble(int ptr);
180 virtual void PopulateTriangleCell(size_t cellIdx);
181 virtual void PopulateTetraCell(size_t cellIdx);
182 virtual void PopulateQuadCell(size_t cellIdx);
183 virtual void PopulateHexahedronCell(size_t cellIdx);
184 virtual void PopulatePyramidCell(size_t cellIdx);
185 virtual void PopulateWedgeCell(size_t cellIdx);
186 virtual void PopulatePolyhedronCell(size_t cellIdx);
187 virtual void ParseDataFile();
188 virtual int GetDataBufferInt(int ptr);
189 virtual float GetDataBufferFloat(int ptr);
190 virtual double GetDataBufferDouble(int ptr);
191 virtual void GetData(int dataType);
192 virtual bool ParallelCheckCell(int vtkNotUsed(i)) { return true; }
193
194private:
205 void FillMultiBlockFromFaces(std::vector<vtkSmartPointer<vtkUnstructuredGrid>>& blockUGs,
206 const std::vector<size_t>& zoneIDToBlockIdx);
207
208 vtkFLUENTReader(const vtkFLUENTReader&) = delete;
209 void operator=(const vtkFLUENTReader&) = delete;
210
211 //
212 // Variables
213 //
214 vtkNew<vtkDataArraySelection> CellDataArraySelection;
215 char* FileName = nullptr;
216 vtkIdType NumberOfCells = 0;
217
218 istream* FluentCaseFile = nullptr;
219 istream* FluentDataFile = nullptr;
220 std::string CaseBuffer;
221 std::string DataBuffer;
222
223 // File data cache
224 vtkNew<vtkPoints> Points;
225 std::vector<Cell> Cells;
226 std::vector<Face> Faces;
227 std::vector<Zone> Zones;
228 std::map<size_t, std::string> VariableNames;
229 std::vector<ScalarDataChunk> ScalarDataChunks;
230 std::vector<VectorDataChunk> VectorDataChunks;
231 std::vector<SubSection> SubSections;
232
233 std::vector<std::string> ScalarVariableNames;
234 std::vector<int> ScalarSubSectionIds;
235 std::vector<std::string> VectorVariableNames;
236 std::vector<int> VectorSubSectionIds;
237
238 vtkTypeBool SwapBytes;
239 int GridDimension = 0;
240 int NumberOfScalars = 0;
241 int NumberOfVectors = 0;
242 bool Parsed = false;
243};
244
245VTK_ABI_NAMESPACE_END
246#endif
a 3D cell defined by a set of convex points
Store on/off settings for data arrays, etc.
reads a dataset in Fluent file format
virtual void PopulateWedgeCell(size_t cellIdx)
virtual void GetPeriodicShadowFacesBinary()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void GetPartitionInfo()
virtual void ParseDataFile()
virtual void PopulateQuadCell(size_t cellIdx)
~vtkFLUENTReader() override
virtual void GetData(int dataType)
virtual void GetSpeciesVariableNames()
virtual void GetFaceTreeAscii()
virtual void PopulatePolyhedronCell(size_t cellIdx)
virtual void GetNonconformalGridInterfaceFaceInformationBinary()
virtual void GetInterfaceFaceParentsAscii()
virtual void PopulatePyramidCell(size_t cellIdx)
virtual void GetNodesDoublePrecision()
virtual void CleanCells()
vtkGetFilePathMacro(FileName)
Specify the file name of the Fluent case file to read.
virtual float GetDataBufferFloat(int ptr)
virtual bool OpenDataFile(const char *filename)
virtual void GetCellsBinary()
virtual void GetPeriodicShadowFacesAscii()
virtual double GetDataBufferDouble(int ptr)
virtual void PopulateCellNodes()
virtual void ReadZone()
virtual void GetCellTreeBinary()
const char * GetCellArrayName(int index)
Get the name of the cell array with the given index in the input.
void SetDataByteOrder(int)
These methods should be used instead of the SwapBytes methods.
void SetDataByteOrderToLittleEndian()
These methods should be used instead of the SwapBytes methods.
virtual int GetDataBufferInt(int ptr)
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkTypeBool GetSwapBytes()
Set/Get the byte swapping to explicitly swap the bytes of a file.
virtual void PopulateHexahedronCell(size_t cellIdx)
virtual bool ParallelCheckCell(int vtkNotUsed(i))
virtual int GetCaseBufferInt(int ptr)
virtual void GetInterfaceFaceParentsBinary()
void SetCellArrayStatus(const char *name, int status)
Get/Set whether the cell array with the given name is to be read.
virtual void GetFaceTreeBinary()
virtual void GetCellsAscii()
virtual bool ParseCaseFile()
int GetCellArrayStatus(const char *name)
Get/Set whether the cell array with the given name is to be read.
virtual void PopulateTetraCell(size_t cellIdx)
void EnableAllCellArrays()
Turn on/off all cell arrays.
virtual double GetCaseBufferDouble(int ptr)
virtual float GetCaseBufferFloat(int ptr)
virtual void GetFacesBinary()
virtual void GetNodesAscii()
virtual int GetCaseIndex()
virtual int GetCaseChunk()
virtual void GetNonconformalGridInterfaceFaceInformationAscii()
int GetDataByteOrder()
These methods should be used instead of the SwapBytes methods.
vtkSetFilePathMacro(FileName)
Specify the file name of the Fluent case file to read.
void SetDataByteOrderToBigEndian()
These methods should be used instead of the SwapBytes methods.
const char * GetDataByteOrderAsString()
These methods should be used instead of the SwapBytes methods.
virtual void PopulateTriangleCell(size_t cellIdx)
virtual void GetLittleEndianFlag()
virtual int GetDataChunk()
virtual void GetNodesSinglePrecision()
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
virtual bool GetFacesAscii()
virtual void GetCellTreeAscii()
virtual bool OpenCaseFile(const char *filename)
virtual int GetDimension()
virtual void LoadVariableNames()
int GetNumberOfCellArrays()
Get the number of cell arrays available in the input.
static vtkFLUENTReader * New()
virtual int GetDataIndex()
void DisableAllCellArrays()
Turn on/off all cell arrays.
a cell that represents a linear 3D hexahedron
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Superclass for algorithms that produce only vtkMultiBlockDataSet as output.
Allocate and hold a VTK object.
Definition vtkNew.h:167
represent and manipulate 3D points
Definition vtkPoints.h:139
a 3D cell that represents a linear pyramid
Definition vtkPyramid.h:95
a cell that represents a 2D quadrilateral
Definition vtkQuad.h:87
Hold a reference to a vtkObjectBase instance.
a 3D cell that represents a tetrahedron
Definition vtkTetra.h:113
a cell that represents a triangle
dataset represents arbitrary combinations of all possible cell types
a 3D cell that represents a linear wedge
Definition vtkWedge.h:85
int vtkTypeBool
Definition vtkABI.h:64
@ Cells
A cell specified by degrees of freedom held in arrays.
int vtkIdType
Definition vtkType.h:315