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