VTK
vtkFLUENTReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkFLUENTReader.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
35 #ifndef vtkFLUENTReader_h
36 #define vtkFLUENTReader_h
37 
38 #include "vtkIOGeometryModule.h" // For export macro
40 
42 class vtkPoints;
43 class vtkTriangle;
44 class vtkTetra;
45 class vtkQuad;
46 class vtkHexahedron;
47 class vtkPyramid;
48 class vtkWedge;
49 class vtkConvexPointSet;
50 
51 class VTKIOGEOMETRY_EXPORT vtkFLUENTReader : public vtkMultiBlockDataSetAlgorithm
52 {
53 public:
54  static vtkFLUENTReader *New();
56  void PrintSelf(ostream& os, vtkIndent indent) override;
57 
59 
62  vtkSetStringMacro(FileName);
63  vtkGetStringMacro(FileName);
65 
67 
71  vtkGetMacro(NumberOfCells,int);
73 
77  int GetNumberOfCellArrays(void);
78 
83  const char* GetCellArrayName(int index);
84 
86 
90  int GetCellArrayStatus(const char* name);
91  void SetCellArrayStatus(const char* name, int status);
93 
95 
98  void DisableAllCellArrays();
99  void EnableAllCellArrays();
101 
103 
117  void SetDataByteOrderToBigEndian();
118  void SetDataByteOrderToLittleEndian();
119  int GetDataByteOrder();
120  void SetDataByteOrder(int);
121  const char *GetDataByteOrderAsString();
122  //
123  // Structures
124  //
125  struct Cell;
126  struct Face;
127  struct ScalarDataChunk;
128  struct VectorDataChunk;
129  struct stdString;
130  struct intVector;
131  struct doubleVector;
132  struct stringVector;
133  struct cellVector;
134  struct faceVector;
135  struct stdMap;
136  struct scalarDataVector;
137  struct vectorDataVector;
138  struct intVectorVector;
140 
141 protected:
142  vtkFLUENTReader();
143  ~vtkFLUENTReader() override;
147  vtkInformationVector *) override;
148 
150 
154  vtkSetMacro(SwapBytes,vtkTypeBool);
155  vtkTypeBool GetSwapBytes() {return this->SwapBytes;}
156  vtkBooleanMacro(SwapBytes,vtkTypeBool);
158 
160  char * FileName;
163  virtual bool OpenCaseFile(const char *filename);
164  virtual bool OpenDataFile(const char *filename);
165  virtual int GetCaseChunk ();
166  virtual void GetNumberOfCellZones();
167  virtual int GetCaseIndex();
168  virtual void LoadVariableNames();
169  virtual int GetDataIndex();
170  virtual int GetDataChunk();
171  virtual void GetSpeciesVariableNames();
172 
173  virtual void ParseCaseFile();
174  virtual int GetDimension();
175  virtual void GetLittleEndianFlag();
176  virtual void GetNodesAscii();
177  virtual void GetNodesSinglePrecision();
178  virtual void GetNodesDoublePrecision();
179  virtual void GetCellsAscii();
180  virtual void GetCellsBinary();
181  virtual void GetFacesAscii();
182  virtual void GetFacesBinary();
183  virtual void GetPeriodicShadowFacesAscii();
184  virtual void GetPeriodicShadowFacesBinary();
185  virtual void GetCellTreeAscii();
186  virtual void GetCellTreeBinary();
187  virtual void GetFaceTreeAscii();
188  virtual void GetFaceTreeBinary();
189  virtual void GetInterfaceFaceParentsAscii();
190  virtual void GetInterfaceFaceParentsBinary();
191  virtual void GetNonconformalGridInterfaceFaceInformationAscii();
192  virtual void GetNonconformalGridInterfaceFaceInformationBinary();
193  virtual void GetPartitionInfo() {}
194  virtual void CleanCells();
195  virtual void PopulateCellNodes();
196  virtual int GetCaseBufferInt(int ptr);
197  virtual float GetCaseBufferFloat(int ptr);
198  virtual double GetCaseBufferDouble(int ptr);
199  virtual void PopulateTriangleCell(int i);
200  virtual void PopulateTetraCell(int i);
201  virtual void PopulateQuadCell(int i);
202  virtual void PopulateHexahedronCell(int i);
203  virtual void PopulatePyramidCell(int i);
204  virtual void PopulateWedgeCell(int i);
205  virtual void PopulatePolyhedronCell(int i);
206  virtual void ParseDataFile();
207  virtual int GetDataBufferInt(int ptr);
208  virtual float GetDataBufferFloat(int ptr);
209  virtual double GetDataBufferDouble(int ptr);
210  virtual void GetData(int dataType);
211  virtual bool ParallelCheckCell(int vtkNotUsed(i)) { return true; }
212 
213  //
214  // Variables
215  //
216  ifstream *FluentCaseFile;
217  ifstream *FluentDataFile;
218  stdString *CaseBuffer;
219  stdString *DataBuffer;
220 
229 
230  cellVector *Cells;
231  faceVector *Faces;
232  stdMap *VariableNames;
233  intVector *CellZones;
234  scalarDataVector *ScalarDataChunks;
235  vectorDataVector *VectorDataChunks;
236 
237  intVectorVector *SubSectionZones;
238  intVector *SubSectionIds;
239  intVector *SubSectionSize;
240 
241  stringVector *ScalarVariableNames;
243  stringVector *VectorVariableNames;
245 
248  int DataPass;
251 
252 private:
253  vtkFLUENTReader(const vtkFLUENTReader&) = delete;
254  void operator=(const vtkFLUENTReader&) = delete;
255 };
256 #endif
scalarDataVector * ScalarDataChunks
intVector * SubSectionSize
vectorDataVector * VectorDataChunks
Store vtkAlgorithm input/output information.
a 3D cell that represents a linear pyramid
Definition: vtkPyramid.h:43
vtkDataArraySelection * CellDataArraySelection
ifstream * FluentDataFile
virtual bool ParallelCheckCell(int vtkNotUsed(i))
a cell that represents a 2D quadrilateral
Definition: vtkQuad.h:35
ifstream * FluentCaseFile
Superclass for algorithms that produce only vtkMultiBlockDataSet as output.
stdString * DataBuffer
intVectorVector * SubSectionZones
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
virtual void GetPartitionInfo()
vtkTriangle * Triangle
vtkTypeBool GetSwapBytes()
Set/Get the byte swapping to explicitly swap the bytes of a file.
static vtkMultiBlockDataSetAlgorithm * New()
int vtkTypeBool
Definition: vtkABI.h:69
a 3D cell that represents a tetrahedron
Definition: vtkTetra.h:41
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkPyramid * Pyramid
stdMap * VariableNames
Store on/off settings for data arrays for a vtkSource.
vtkHexahedron * Hexahedron
cellVector * Cells
reads a dataset in Fluent file format
a cell that represents a linear 3D hexahedron
Definition: vtkHexahedron.h:41
intVector * CellZones
a 3D cell defined by a set of convex points
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
intVector * ScalarSubSectionIds
intVector * SubSectionIds
a cell that represents a triangle
Definition: vtkTriangle.h:35
faceVector * Faces
stdString * CaseBuffer
Store zero or more vtkInformation instances.
stringVector * VectorVariableNames
vtkConvexPointSet * ConvexPointSet
vtkTypeBool SwapBytes
stringVector * ScalarVariableNames
vtkPoints * Points
a 3D cell that represents a linear wedge
Definition: vtkWedge.h:43
represent and manipulate 3D points
Definition: vtkPoints.h:33
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
intVector * VectorSubSectionIds