VTK
dox/IO/Parallel/vtkEnSightWriter.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkEnSightWriter.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 
00032 #ifndef __vtkEnSightWriter_h
00033 #define __vtkEnSightWriter_h
00034 
00035 #include "vtkIOParallelModule.h" // For export macro
00036 #include "vtkWriter.h"
00037 
00038 class vtkUnstructuredGrid;
00039 
00040 class VTKIOPARALLEL_EXPORT vtkEnSightWriter : public vtkWriter
00041 {
00042 
00043 public:
00044   vtkTypeMacro(vtkEnSightWriter,vtkWriter);
00045   virtual void PrintSelf(ostream& os, vtkIndent indent);
00046 
00047  */
00048   static vtkEnSightWriter *New();
00049 
00051 
00052   vtkSetMacro(ProcessNumber,int);
00053   vtkGetMacro(ProcessNumber,int);
00055 
00057 
00058   vtkSetStringMacro(Path);
00059   vtkGetStringMacro(Path);
00061 
00063 
00064   vtkSetStringMacro(BaseName);
00065   vtkGetStringMacro(BaseName);
00067 
00069 
00070   vtkSetStringMacro(FileName);
00071   vtkGetStringMacro(FileName);
00073 
00075 
00076   vtkSetMacro(TimeStep,int);
00077   vtkGetMacro(TimeStep,int);
00079 
00081 
00082   vtkSetMacro(GhostLevel,int);
00083   vtkGetMacro(GhostLevel,int);
00085 
00087 
00089   vtkSetMacro(TransientGeometry,bool);
00090   vtkGetMacro(TransientGeometry,bool);
00092 
00094 
00095   vtkSetMacro(NumberOfBlocks,int);
00096   vtkGetMacro(NumberOfBlocks,int);
00098 
00100 
00102   virtual void SetBlockIDs(int* val)
00103     {
00104     BlockIDs=val;
00105     }
00106   virtual int* GetBlockIDs()
00107     {
00108     return BlockIDs;
00109     }
00111 
00113 
00114   virtual void SetInputData(vtkUnstructuredGrid *input);
00115   virtual vtkUnstructuredGrid* GetInput();
00117 
00119 
00123   virtual void WriteCaseFile(int TotalTimeSteps);
00124   virtual void WriteSOSCaseFile(int NumProcs);
00126 
00127 protected:
00128   vtkEnSightWriter();
00129   virtual ~vtkEnSightWriter();
00130 
00131   virtual int FillInputPortInformation(int port, vtkInformation* info);
00132 
00133   virtual void WriteData(); // method to allow this class to be instantiated and delegated to
00134 
00135   virtual void WriteStringToFile(const char* string, FILE* file);
00136   virtual void WriteTerminatedStringToFile(const char* string, FILE* file);
00137   virtual void WriteIntToFile(const int i,FILE* file);
00138   virtual void WriteFloatToFile(const float f,FILE* file);
00139   virtual void WriteElementTypeToFile(int ElementType, FILE* fd);
00140 
00141   virtual bool ShouldWriteGeometry();
00142   virtual void SanitizeFileName(char* name);
00143   virtual FILE* OpenFile(char* name);
00144 
00145   void ComputeNames();
00146   void DefaultNames();
00147 
00148   int GetExodusModelIndex(int *ElementArray,int NumberElements,int PartID);
00149 
00150   char *Path;
00151   char *BaseName;
00152   char *FileName;
00153   int TimeStep;
00154   int GhostLevelMultiplier;
00155   int ProcessNumber;
00156   int NumberOfProcesses;
00157   int NumberOfBlocks;
00158   int * BlockIDs;
00159   bool TransientGeometry;
00160   int GhostLevel;
00161   vtkUnstructuredGrid* TmpInput;
00162 
00163   vtkEnSightWriter(const vtkEnSightWriter&);  // Not implemented.
00164   void operator=(const vtkEnSightWriter&);  // Not implemented.
00165 
00166 };
00167 
00168 #endif