VTK
dox/IO/ParallelExodus/vtkPExodusIIReader.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkPExodusIIReader.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 =========================================================================*/
00015 /*----------------------------------------------------------------------------
00016  Copyright (c) Sandia Corporation
00017  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
00018 ----------------------------------------------------------------------------*/
00019 
00038 #ifndef __vtkPExodusIIReader_h
00039 #define __vtkPExodusIIReader_h
00040 
00041 #include "vtkIOParallelExodusModule.h" // For export macro
00042 #include "vtkExodusIIReader.h"
00043 
00044 #include <vector> // Required for vector
00045 
00046 class vtkTimerLog;
00047 class vtkMultiProcessController;
00048 
00049 class VTKIOPARALLELEXODUS_EXPORT vtkPExodusIIReader : public vtkExodusIIReader
00050 {
00051 public:
00052   static vtkPExodusIIReader* New();
00053   vtkTypeMacro(vtkPExodusIIReader,vtkExodusIIReader);
00054   void PrintSelf( ostream& os, vtkIndent indent );
00055 
00057 
00060   void SetController(vtkMultiProcessController* c);
00061   vtkGetObjectMacro(Controller, vtkMultiProcessController);
00063 
00065 
00072   vtkSetStringMacro(FilePattern);
00073   vtkGetStringMacro(FilePattern);
00074   vtkSetStringMacro(FilePrefix);
00075   vtkGetStringMacro(FilePrefix);
00077 
00079 
00081   void SetFileRange( int, int );
00082   void SetFileRange( int* r ) { this->SetFileRange( r[0], r[1] ); }
00083   vtkGetVector2Macro(FileRange,int);
00085 
00090   void SetFileNames( int nfiles, const char** names );
00091 
00092   virtual void SetFileName( const char* name );
00093 
00095   char** GetFileNames() { return this->FileNames; }
00096 
00098   int GetNumberOfFileNames() { return this->NumberOfFileNames; }
00099 
00101 
00102   vtkGetMacro(NumberOfFiles,int);
00104 
00105   virtual vtkIdType GetTotalNumberOfElements();
00106   virtual vtkIdType GetTotalNumberOfNodes();
00107 
00113   virtual void UpdateTimeInformation();
00114 
00118   virtual void Broadcast( vtkMultiProcessController* ctrl );
00119 
00121 
00128   vtkGetMacro(VariableCacheSize,double);
00129   vtkSetMacro(VariableCacheSize,double);
00131 
00132 protected:
00133   vtkPExodusIIReader();
00134   ~vtkPExodusIIReader();
00135 
00137 
00138   int DeterminePattern( const char* file );
00139   static int DetermineFileId( const char* file );
00141 
00142   //holds the size of the variable cache in GigaBytes
00143   double VariableCacheSize;
00144 
00145   // **KEN** Previous discussions concluded with std classes in header
00146   // files is bad.  Perhaps we should change ReaderList.
00147 
00148   vtkMultiProcessController* Controller;
00149   vtkIdType ProcRank;
00150   vtkIdType ProcSize;
00151   char* FilePattern;
00152   char* CurrentFilePattern;
00153   char* FilePrefix;
00154   char* CurrentFilePrefix;
00155   char* MultiFileName;
00156   int FileRange[2];
00157   int CurrentFileRange[2];
00158   int NumberOfFiles;
00159   char **FileNames;
00160   int NumberOfFileNames;
00161 //BTX
00162   std::vector<vtkExodusIIReader*> ReaderList;
00163   std::vector<int> NumberOfPointsPerFile;
00164   std::vector<int> NumberOfCellsPerFile;
00165 //ETX
00166 
00167   int LastCommonTimeStep;
00168 
00169   int Timing;
00170   vtkTimerLog *TimerLog;
00171 
00172   int RequestInformation( vtkInformation*, vtkInformationVector**, vtkInformationVector* );
00173   int RequestData( vtkInformation*, vtkInformationVector**, vtkInformationVector* );
00174 
00175 private:
00176   vtkPExodusIIReader( const vtkPExodusIIReader& ); // Not implemented
00177   void operator = ( const vtkPExodusIIReader& ); // Not implemented
00178 };
00179 
00180 #endif