VTK  9.3.1
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
26 #ifndef vtkFLUENTReader_h
27 #define vtkFLUENTReader_h
28 
29 #include "vtkIOGeometryModule.h" // For export macro
31 
32 VTK_ABI_NAMESPACE_BEGIN
34 class vtkPoints;
35 class vtkTriangle;
36 class vtkTetra;
37 class vtkQuad;
38 class vtkHexahedron;
39 class vtkPyramid;
40 class vtkWedge;
41 class vtkConvexPointSet;
42 
43 class VTKIOGEOMETRY_EXPORT vtkFLUENTReader : public vtkMultiBlockDataSetAlgorithm
44 {
45 public:
46  static vtkFLUENTReader* New();
48  void PrintSelf(ostream& os, vtkIndent indent) override;
49 
51 
54  vtkSetFilePathMacro(FileName);
55  vtkGetFilePathMacro(FileName);
57 
59 
63  vtkGetMacro(NumberOfCells, vtkIdType);
65 
69  int GetNumberOfCellArrays();
70 
75  const char* GetCellArrayName(int index);
76 
78 
82  int GetCellArrayStatus(const char* name);
83  void SetCellArrayStatus(const char* name, int status);
85 
87 
90  void DisableAllCellArrays();
91  void EnableAllCellArrays();
93 
95 
109  void SetDataByteOrderToBigEndian();
110  void SetDataByteOrderToLittleEndian();
111  int GetDataByteOrder();
112  void SetDataByteOrder(int);
113  const char* GetDataByteOrderAsString();
114  //
115  // Structures
116  //
117  struct Cell;
118  struct Face;
119  struct ScalarDataChunk;
120  struct VectorDataChunk;
121  struct stdString;
122  struct intVector;
123  struct doubleVector;
124  struct stringVector;
125  struct cellVector;
126  struct faceVector;
127  struct stdMap;
128  struct scalarDataVector;
129  struct vectorDataVector;
130  struct intVectorVector;
132 
133 protected:
134  vtkFLUENTReader();
135  ~vtkFLUENTReader() override;
138 
140 
144  vtkSetMacro(SwapBytes, vtkTypeBool);
145  vtkTypeBool GetSwapBytes() { return this->SwapBytes; }
146  vtkBooleanMacro(SwapBytes, vtkTypeBool);
148 
149  virtual bool OpenCaseFile(const char* filename);
150  virtual bool OpenDataFile(const char* filename);
151  virtual int GetCaseChunk();
152  virtual void GetNumberOfCellZones();
153  virtual int GetCaseIndex();
154  virtual void LoadVariableNames();
155  virtual int GetDataIndex();
156  virtual int GetDataChunk();
157  virtual void GetSpeciesVariableNames();
158 
159  virtual bool ParseCaseFile();
160  virtual int GetDimension();
161  virtual void GetLittleEndianFlag();
162  virtual void GetNodesAscii();
163  virtual void GetNodesSinglePrecision();
164  virtual void GetNodesDoublePrecision();
165  virtual void GetCellsAscii();
166  virtual void GetCellsBinary();
167  virtual bool GetFacesAscii();
168  virtual void GetFacesBinary();
169  virtual void GetPeriodicShadowFacesAscii();
170  virtual void GetPeriodicShadowFacesBinary();
171  virtual void GetCellTreeAscii();
172  virtual void GetCellTreeBinary();
173  virtual void GetFaceTreeAscii();
174  virtual void GetFaceTreeBinary();
175  virtual void GetInterfaceFaceParentsAscii();
176  virtual void GetInterfaceFaceParentsBinary();
177  virtual void GetNonconformalGridInterfaceFaceInformationAscii();
178  virtual void GetNonconformalGridInterfaceFaceInformationBinary();
179  virtual void GetPartitionInfo() {}
180  virtual void CleanCells();
181  virtual void PopulateCellNodes();
182  virtual int GetCaseBufferInt(int ptr);
183  virtual float GetCaseBufferFloat(int ptr);
184  virtual double GetCaseBufferDouble(int ptr);
185  virtual void PopulateTriangleCell(int i);
186  virtual void PopulateTetraCell(int i);
187  virtual void PopulateQuadCell(int i);
188  virtual void PopulateHexahedronCell(int i);
189  virtual void PopulatePyramidCell(int i);
190  virtual void PopulateWedgeCell(int i);
191  virtual void PopulatePolyhedronCell(int i);
192  virtual void ParseDataFile();
193  virtual int GetDataBufferInt(int ptr);
194  virtual float GetDataBufferFloat(int ptr);
195  virtual double GetDataBufferDouble(int ptr);
196  virtual void GetData(int dataType);
197  virtual bool ParallelCheckCell(int vtkNotUsed(i)) { return true; }
198 
199  //
200  // Variables
201  //
203  char* FileName;
206 
207  istream* FluentCaseFile;
208  istream* FluentDataFile;
209  stdString* CaseBuffer;
210  stdString* DataBuffer;
211 
220 
221  cellVector* Cells;
222  faceVector* Faces;
223  stdMap* VariableNames;
224  intVector* CellZones;
225  scalarDataVector* ScalarDataChunks;
226  vectorDataVector* VectorDataChunks;
227 
228  intVectorVector* SubSectionZones;
229  intVector* SubSectionIds;
230  intVector* SubSectionSize;
231 
232  stringVector* ScalarVariableNames;
234  stringVector* VectorVariableNames;
236 
239  int DataPass;
242 
243 private:
244  vtkFLUENTReader(const vtkFLUENTReader&) = delete;
245  void operator=(const vtkFLUENTReader&) = delete;
246 
247  bool Parsed = false;
248 };
249 VTK_ABI_NAMESPACE_END
250 #endif
scalarDataVector * ScalarDataChunks
intVector * SubSectionSize
vectorDataVector * VectorDataChunks
Store vtkAlgorithm input/output information.
a 3D cell that represents a linear pyramid
Definition: vtkPyramid.h:35
vtkDataArraySelection * CellDataArraySelection
virtual bool ParallelCheckCell(int vtkNotUsed(i))
a cell that represents a 2D quadrilateral
Definition: vtkQuad.h:27
int vtkIdType
Definition: vtkType.h:315
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:64
a 3D cell that represents a tetrahedron
Definition: vtkTetra.h:33
a simple class to control print indentation
Definition: vtkIndent.h:28
vtkPyramid * Pyramid
stdMap * VariableNames
Store on/off settings for data arrays, etc.
vtkHexahedron * Hexahedron
cellVector * Cells
reads a dataset in Fluent file format
a cell that represents a linear 3D hexahedron
Definition: vtkHexahedron.h:33
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.
vtkSmartPointer< vtkDataArray > GetData(const Ioss::GroupingEntity *entity, const std::string &fieldname, Ioss::Transform *transform=nullptr, Cache *cache=nullptr, const std::string &cachekey=std::string())
Returns a VTK array for a given field (fieldname) on the chosen block (or set) entity.
vtkIdType NumberOfCells
istream * FluentDataFile
intVector * ScalarSubSectionIds
intVector * SubSectionIds
a cell that represents a triangle
Definition: vtkTriangle.h:27
faceVector * Faces
stdString * CaseBuffer
Store zero or more vtkInformation instances.
istream * FluentCaseFile
stringVector * VectorVariableNames
vtkConvexPointSet * ConvexPointSet
vtkTypeBool SwapBytes
stringVector * ScalarVariableNames
vtkPoints * Points
a 3D cell that represents a linear wedge
Definition: vtkWedge.h:35
represent and manipulate 3D points
Definition: vtkPoints.h:28
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
intVector * VectorSubSectionIds