00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
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 struct Cell;
00049 struct Face;
00050 struct ScalarDataChunk;
00051 struct VectorDataChunk;
00052 struct stdString;
00053 struct intVector;
00054 struct doubleVector;
00055 struct stringVector;
00056 struct cellVector;
00057 struct faceVector;
00058 struct stdMap;
00059 struct scalarDataVector;
00060 struct vectorDataVector;
00061 struct intVectorVector;
00062
00063 class VTK_IO_EXPORT vtkFLUENTReader : public vtkMultiBlockDataSetAlgorithm
00064 {
00065 public:
00066 static vtkFLUENTReader *New();
00067 vtkTypeRevisionMacro(vtkFLUENTReader,vtkMultiBlockDataSetAlgorithm);
00068 void PrintSelf(ostream& os, vtkIndent indent);
00069
00071
00072 vtkSetStringMacro(FileName);
00073 vtkGetStringMacro(FileName);
00075
00077
00079 vtkGetMacro(NumberOfCells,int);
00081
00083 int GetNumberOfCellArrays(void);
00084
00086 const char* GetCellArrayName(int index);
00087
00089
00090 int GetCellArrayStatus(const char* name);
00091 void SetCellArrayStatus(const char* name, int status);
00093
00095
00096 void DisableAllCellArrays();
00097 void EnableAllCellArrays();
00099
00100 protected:
00101 vtkFLUENTReader();
00102 ~vtkFLUENTReader();
00103 int RequestInformation(vtkInformation *,
00104 vtkInformationVector **, vtkInformationVector *);
00105 int RequestData(vtkInformation *, vtkInformationVector **,
00106 vtkInformationVector *);
00107 vtkDataArraySelection* CellDataArraySelection;
00108 char * FileName;
00109 int NumberOfCells;
00110 int NumberOfCellArrays;
00111 bool OpenCaseFile(const char *filename);
00112 bool OpenDataFile(const char *filename);
00113 int GetCaseChunk ();
00114 void GetNumberOfCellZones();
00115 int GetCaseIndex();
00116 void LoadVariableNames();
00117 int GetDataIndex();
00118 int GetDataChunk();
00119
00120 void ParseCaseFile();
00121 int GetDimension();
00122 void GetLittleEndianFlag();
00123 void GetNodesAscii();
00124 void GetNodesSinglePrecision();
00125 void GetNodesDoublePrecision();
00126 void GetCellsAscii();
00127 void GetCellsBinary();
00128 void GetFacesAscii();
00129 void GetFacesBinary();
00130 void GetPeriodicShadowFacesAscii();
00131 void GetPeriodicShadowFacesBinary();
00132 void GetCellTreeAscii();
00133 void GetCellTreeBinary();
00134 void GetFaceTreeAscii();
00135 void GetFaceTreeBinary();
00136 void GetInterfaceFaceParentsAscii();
00137 void GetInterfaceFaceParentsBinary();
00138 void GetNonconformalGridInterfaceFaceInformationAscii();
00139 void GetNonconformalGridInterfaceFaceInformationBinary();
00140 void CleanCells();
00141 void PopulateCellNodes();
00142 int GetCaseBufferInt(int ptr);
00143 float GetCaseBufferFloat(int ptr);
00144 double GetCaseBufferDouble(int ptr);
00145 void PopulateTriangleCell(int i);
00146 void PopulateTetraCell(int i);
00147 void PopulateQuadCell(int i);
00148 void PopulateHexahedronCell(int i);
00149 void PopulatePyramidCell(int i);
00150 void PopulateWedgeCell(int i);
00151 void PopulatePolyhedronCell(int i);
00152 void ParseDataFile();
00153 int GetDataBufferInt(int ptr);
00154 float GetDataBufferFloat(int ptr);
00155 double GetDataBufferDouble(int ptr);
00156 void GetData(int dataType);
00157
00158
00159
00160
00161 ifstream *FluentCaseFile;
00162 ifstream *FluentDataFile;
00163 stdString *CaseBuffer;
00164 stdString *DataBuffer;
00165
00166 vtkPoints *Points;
00167 vtkTriangle *Triangle;
00168 vtkTetra *Tetra;
00169 vtkQuad *Quad;
00170 vtkHexahedron *Hexahedron;
00171 vtkPyramid *Pyramid;
00172 vtkWedge *Wedge;
00173 vtkConvexPointSet *ConvexPointSet;
00174
00175 cellVector *Cells;
00176 faceVector *Faces;
00177 stdMap *VariableNames;
00178 intVector *CellZones;
00179 scalarDataVector *ScalarDataChunks;
00180 vectorDataVector *VectorDataChunks;
00181
00182 intVectorVector *SubSectionZones;
00183 intVector *SubSectionIds;
00184 intVector *SubSectionSize;
00185
00186 stringVector *ScalarVariableNames;
00187 intVector *ScalarSubSectionIds;
00188 stringVector *VectorVariableNames;
00189 intVector *VectorSubSectionIds;
00190
00191 int LittleEndianFlag;
00192 int GridDimension;
00193 int DataPass;
00194 int NumberOfScalars;
00195 int NumberOfVectors;
00196
00197 private:
00198 vtkFLUENTReader(const vtkFLUENTReader&);
00199 void operator=(const vtkFLUENTReader&);
00200 };
00201 #endif