VTK
dox/IO/vtkFLUENTReader.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkFLUENTReader.h
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   vtkTypeMacro(vtkFLUENTReader,vtkMultiBlockDataSetAlgorithm);
00054   void PrintSelf(ostream& os, vtkIndent indent);
00055 
00057 
00058   vtkSetStringMacro(FileName);
00059   vtkGetStringMacro(FileName);
00061 
00063 
00066   vtkGetMacro(NumberOfCells,int);
00068 
00070   int GetNumberOfCellArrays(void);
00071 
00073   const char* GetCellArrayName(int index);
00074 
00076 
00077   int GetCellArrayStatus(const char* name);
00078   void SetCellArrayStatus(const char* name, int status);
00080 
00082 
00083   void DisableAllCellArrays();
00084   void EnableAllCellArrays();
00086 
00088 
00099   void SetDataByteOrderToBigEndian();
00100   void SetDataByteOrderToLittleEndian();
00101   int  GetDataByteOrder();
00102   void SetDataByteOrder(int);
00103   const char *GetDataByteOrderAsString();
00104   //
00105   //  Structures
00106   //
00107   struct Cell;
00108   struct Face;
00109   struct ScalarDataChunk;
00110   struct VectorDataChunk;
00111   struct stdString;
00112   struct intVector;
00113   struct doubleVector;
00114   struct stringVector;
00115   struct cellVector;
00116   struct faceVector;
00117   struct stdMap;
00118   struct scalarDataVector;
00119   struct vectorDataVector;
00120   struct intVectorVector;
00122 
00123 protected:
00124   vtkFLUENTReader();
00125   ~vtkFLUENTReader();
00126   int RequestInformation(vtkInformation *, 
00127     vtkInformationVector **, vtkInformationVector *);
00128   int RequestData(vtkInformation *, vtkInformationVector **, 
00129     vtkInformationVector *);
00130 
00132 
00134   vtkSetMacro(SwapBytes,int);
00135   int GetSwapBytes() {return this->SwapBytes;}
00136   vtkBooleanMacro(SwapBytes,int);
00138 
00139   vtkDataArraySelection* CellDataArraySelection;
00140   char * FileName;
00141   int NumberOfCells;
00142   int NumberOfCellArrays;
00143   virtual bool                   OpenCaseFile(const char *filename);
00144   virtual bool                   OpenDataFile(const char *filename);
00145   virtual int                    GetCaseChunk ();
00146   virtual void                   GetNumberOfCellZones();
00147   virtual int                    GetCaseIndex();
00148   virtual void                   LoadVariableNames();
00149   virtual int                    GetDataIndex();
00150   virtual int                    GetDataChunk();
00151   virtual void                   GetSpeciesVariableNames();
00152 
00153   virtual void                   ParseCaseFile();
00154   virtual int                    GetDimension();
00155   virtual void                   GetLittleEndianFlag();
00156   virtual void                   GetNodesAscii();
00157   virtual void                   GetNodesSinglePrecision();
00158   virtual void                   GetNodesDoublePrecision();
00159   virtual void                   GetCellsAscii();
00160   virtual void                   GetCellsBinary();
00161   virtual void                   GetFacesAscii();
00162   virtual void                   GetFacesBinary();
00163   virtual void                   GetPeriodicShadowFacesAscii();
00164   virtual void                   GetPeriodicShadowFacesBinary();
00165   virtual void                   GetCellTreeAscii();
00166   virtual void                   GetCellTreeBinary();
00167   virtual void                   GetFaceTreeAscii();
00168   virtual void                   GetFaceTreeBinary();
00169   virtual void                   GetInterfaceFaceParentsAscii();
00170   virtual void                   GetInterfaceFaceParentsBinary();
00171   virtual void                   GetNonconformalGridInterfaceFaceInformationAscii();
00172   virtual void                   GetNonconformalGridInterfaceFaceInformationBinary();
00173   virtual void                   GetPartitionInfo() {};
00174   virtual void                   CleanCells();
00175   virtual void                   PopulateCellNodes();
00176   virtual int                    GetCaseBufferInt(int ptr);
00177   virtual float                  GetCaseBufferFloat(int ptr);
00178   virtual double                 GetCaseBufferDouble(int ptr);
00179   virtual void                   PopulateTriangleCell(int i);
00180   virtual void                   PopulateTetraCell(int i);
00181   virtual void                   PopulateQuadCell(int i);
00182   virtual void                   PopulateHexahedronCell(int i);
00183   virtual void                   PopulatePyramidCell(int i);
00184   virtual void                   PopulateWedgeCell(int i);
00185   virtual void                   PopulatePolyhedronCell(int i);
00186   virtual void                   ParseDataFile();
00187   virtual int                    GetDataBufferInt(int ptr);
00188   virtual float                  GetDataBufferFloat(int ptr);
00189   virtual double                 GetDataBufferDouble(int ptr);
00190   virtual void                   GetData(int dataType);
00191   virtual bool                   ParallelCheckCell(int vtkNotUsed(i)) { return true; }
00192 
00193   //
00194   //  Variables
00195   //
00196   ifstream *FluentCaseFile;
00197   ifstream *FluentDataFile;
00198   stdString *CaseBuffer;
00199   stdString *DataBuffer;
00200 
00201   vtkPoints           *Points;
00202   vtkTriangle         *Triangle;
00203   vtkTetra            *Tetra;
00204   vtkQuad             *Quad;
00205   vtkHexahedron       *Hexahedron;
00206   vtkPyramid          *Pyramid;
00207   vtkWedge            *Wedge;
00208   vtkConvexPointSet   *ConvexPointSet;
00209 
00210   cellVector *Cells;
00211   faceVector *Faces;
00212   stdMap *VariableNames;
00213   intVector  *CellZones;
00214   scalarDataVector *ScalarDataChunks;
00215   vectorDataVector *VectorDataChunks;
00216 
00217   intVectorVector *SubSectionZones;
00218   intVector *SubSectionIds;
00219   intVector *SubSectionSize;
00220 
00221   stringVector *ScalarVariableNames;
00222   intVector *ScalarSubSectionIds;
00223   stringVector *VectorVariableNames;
00224   intVector *VectorSubSectionIds;
00225 
00226   int SwapBytes;
00227   int GridDimension;
00228   int DataPass;
00229   int NumberOfScalars;
00230   int NumberOfVectors;
00231 
00232 private:
00233   vtkFLUENTReader(const vtkFLUENTReader&);  // Not implemented.
00234   void operator=(const vtkFLUENTReader&);  // Not implemented.
00235 };
00236 #endif