VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkFLUENTReader.h,v $ 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00034 #ifndef __vtkFLUENTReader_h 00035 #define __vtkFLUENTReader_h 00036 00037 #include "vtkMultiBlockDataSetAlgorithm.h" 00038 00039 class vtkDataArraySelection; 00040 class vtkPoints; 00041 class vtkTriangle; 00042 class vtkTetra; 00043 class vtkQuad; 00044 class vtkHexahedron; 00045 class vtkPyramid; 00046 class vtkWedge; 00047 class vtkConvexPointSet; 00048 00049 class VTK_IO_EXPORT vtkFLUENTReader : public vtkMultiBlockDataSetAlgorithm 00050 { 00051 public: 00052 static vtkFLUENTReader *New(); 00053 vtkTypeRevisionMacro(vtkFLUENTReader,vtkMultiBlockDataSetAlgorithm); 00054 void PrintSelf(ostream& os, vtkIndent indent); 00055 00057 00058 vtkSetStringMacro(FileName); 00059 vtkGetStringMacro(FileName); 00061 00063 00065 vtkGetMacro(NumberOfCells,int); 00067 00069 int GetNumberOfCellArrays(void); 00070 00072 const char* GetCellArrayName(int index); 00073 00075 00076 int GetCellArrayStatus(const char* name); 00077 void SetCellArrayStatus(const char* name, int status); 00079 00081 00082 void DisableAllCellArrays(); 00083 void EnableAllCellArrays(); 00085 00087 00098 void SetDataByteOrderToBigEndian(); 00099 void SetDataByteOrderToLittleEndian(); 00100 int GetDataByteOrder(); 00101 void SetDataByteOrder(int); 00102 const char *GetDataByteOrderAsString(); 00103 // 00104 // Structures 00105 // 00106 struct Cell; 00107 struct Face; 00108 struct ScalarDataChunk; 00109 struct VectorDataChunk; 00110 struct stdString; 00111 struct intVector; 00112 struct doubleVector; 00113 struct stringVector; 00114 struct cellVector; 00115 struct faceVector; 00116 struct stdMap; 00117 struct scalarDataVector; 00118 struct vectorDataVector; 00119 struct intVectorVector; 00121 00122 protected: 00123 vtkFLUENTReader(); 00124 ~vtkFLUENTReader(); 00125 int RequestInformation(vtkInformation *, 00126 vtkInformationVector **, vtkInformationVector *); 00127 int RequestData(vtkInformation *, vtkInformationVector **, 00128 vtkInformationVector *); 00129 00131 00133 vtkSetMacro(SwapBytes,int); 00134 int GetSwapBytes() {return this->SwapBytes;} 00135 vtkBooleanMacro(SwapBytes,int); 00137 00138 vtkDataArraySelection* CellDataArraySelection; 00139 char * FileName; 00140 int NumberOfCells; 00141 int NumberOfCellArrays; 00142 virtual bool OpenCaseFile(const char *filename); 00143 virtual bool OpenDataFile(const char *filename); 00144 virtual int GetCaseChunk (); 00145 virtual void GetNumberOfCellZones(); 00146 virtual int GetCaseIndex(); 00147 virtual void LoadVariableNames(); 00148 virtual int GetDataIndex(); 00149 virtual int GetDataChunk(); 00150 virtual void GetSpeciesVariableNames(); 00151 00152 virtual void ParseCaseFile(); 00153 virtual int GetDimension(); 00154 virtual void GetLittleEndianFlag(); 00155 virtual void GetNodesAscii(); 00156 virtual void GetNodesSinglePrecision(); 00157 virtual void GetNodesDoublePrecision(); 00158 virtual void GetCellsAscii(); 00159 virtual void GetCellsBinary(); 00160 virtual void GetFacesAscii(); 00161 virtual void GetFacesBinary(); 00162 virtual void GetPeriodicShadowFacesAscii(); 00163 virtual void GetPeriodicShadowFacesBinary(); 00164 virtual void GetCellTreeAscii(); 00165 virtual void GetCellTreeBinary(); 00166 virtual void GetFaceTreeAscii(); 00167 virtual void GetFaceTreeBinary(); 00168 virtual void GetInterfaceFaceParentsAscii(); 00169 virtual void GetInterfaceFaceParentsBinary(); 00170 virtual void GetNonconformalGridInterfaceFaceInformationAscii(); 00171 virtual void GetNonconformalGridInterfaceFaceInformationBinary(); 00172 virtual void GetPartitionInfo() {}; 00173 virtual void CleanCells(); 00174 virtual void PopulateCellNodes(); 00175 virtual int GetCaseBufferInt(int ptr); 00176 virtual float GetCaseBufferFloat(int ptr); 00177 virtual double GetCaseBufferDouble(int ptr); 00178 virtual void PopulateTriangleCell(int i); 00179 virtual void PopulateTetraCell(int i); 00180 virtual void PopulateQuadCell(int i); 00181 virtual void PopulateHexahedronCell(int i); 00182 virtual void PopulatePyramidCell(int i); 00183 virtual void PopulateWedgeCell(int i); 00184 virtual void PopulatePolyhedronCell(int i); 00185 virtual void ParseDataFile(); 00186 virtual int GetDataBufferInt(int ptr); 00187 virtual float GetDataBufferFloat(int ptr); 00188 virtual double GetDataBufferDouble(int ptr); 00189 virtual void GetData(int dataType); 00190 virtual bool ParallelCheckCell(int vtkNotUsed(i)) { return true; } 00191 00192 // 00193 // Variables 00194 // 00195 ifstream *FluentCaseFile; 00196 ifstream *FluentDataFile; 00197 stdString *CaseBuffer; 00198 stdString *DataBuffer; 00199 00200 vtkPoints *Points; 00201 vtkTriangle *Triangle; 00202 vtkTetra *Tetra; 00203 vtkQuad *Quad; 00204 vtkHexahedron *Hexahedron; 00205 vtkPyramid *Pyramid; 00206 vtkWedge *Wedge; 00207 vtkConvexPointSet *ConvexPointSet; 00208 00209 cellVector *Cells; 00210 faceVector *Faces; 00211 stdMap *VariableNames; 00212 intVector *CellZones; 00213 scalarDataVector *ScalarDataChunks; 00214 vectorDataVector *VectorDataChunks; 00215 00216 intVectorVector *SubSectionZones; 00217 intVector *SubSectionIds; 00218 intVector *SubSectionSize; 00219 00220 stringVector *ScalarVariableNames; 00221 intVector *ScalarSubSectionIds; 00222 stringVector *VectorVariableNames; 00223 intVector *VectorSubSectionIds; 00224 00225 int SwapBytes; 00226 int GridDimension; 00227 int DataPass; 00228 int NumberOfScalars; 00229 int NumberOfVectors; 00230 00231 private: 00232 vtkFLUENTReader(const vtkFLUENTReader&); // Not implemented. 00233 void operator=(const vtkFLUENTReader&); // Not implemented. 00234 }; 00235 #endif