VTK  9.0.1
vtkEnSightWriter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkEnSightWriter.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 /*----------------------------------------------------------------------------
16  Copyright (c) Sandia Corporation
17  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
18 ----------------------------------------------------------------------------*/
19 
33 #ifndef vtkEnSightWriter_h
34 #define vtkEnSightWriter_h
35 
36 #include "vtkIOParallelModule.h" // For export macro
37 #include "vtkWriter.h"
38 
40 
41 class VTKIOPARALLEL_EXPORT vtkEnSightWriter : public vtkWriter
42 {
43 
44 public:
45  vtkTypeMacro(vtkEnSightWriter, vtkWriter);
46  void PrintSelf(ostream& os, vtkIndent indent) override;
47 
51  static vtkEnSightWriter* New();
52 
54 
57  vtkSetMacro(ProcessNumber, int);
58  vtkGetMacro(ProcessNumber, int);
60 
62 
65  vtkSetStringMacro(Path);
66  vtkGetStringMacro(Path);
68 
70 
73  vtkSetStringMacro(BaseName);
74  vtkGetStringMacro(BaseName);
76 
78 
81  vtkSetStringMacro(FileName);
82  vtkGetStringMacro(FileName);
84 
86 
89  vtkSetMacro(TimeStep, int);
90  vtkGetMacro(TimeStep, int);
92 
94 
97  vtkSetMacro(GhostLevel, int);
98  vtkGetMacro(GhostLevel, int);
100 
102 
106  vtkSetMacro(TransientGeometry, bool);
107  vtkGetMacro(TransientGeometry, bool);
109 
111 
114  vtkSetMacro(NumberOfBlocks, int);
115  vtkGetMacro(NumberOfBlocks, int);
117 
119 
123  virtual void SetBlockIDs(int* val) { BlockIDs = val; }
124  virtual int* GetBlockIDs() { return BlockIDs; }
126 
128 
131  virtual void SetInputData(vtkUnstructuredGrid* input);
132  virtual vtkUnstructuredGrid* GetInput();
134 
136 
143  virtual void WriteCaseFile(int TotalTimeSteps);
144  virtual void WriteSOSCaseFile(int NumProcs);
146 
147 protected:
149  ~vtkEnSightWriter() override;
150 
151  int FillInputPortInformation(int port, vtkInformation* info) override;
152 
153  void WriteData() override; // method to allow this class to be instantiated and delegated to
154 
155  virtual void WriteStringToFile(const char* string, FILE* file);
156  virtual void WriteTerminatedStringToFile(const char* string, FILE* file);
157  virtual void WriteIntToFile(const int i, FILE* file);
158  virtual void WriteFloatToFile(const float f, FILE* file);
159  virtual void WriteElementTypeToFile(int ElementType, FILE* fd);
160 
161  virtual bool ShouldWriteGeometry();
162  virtual void SanitizeFileName(char* name);
163  virtual FILE* OpenFile(char* name);
164 
165  void ComputeNames();
166  void DefaultNames();
167 
168  int GetExodusModelIndex(int* ElementArray, int NumberElements, int PartID);
169 
170  char* Path;
171  char* BaseName;
172  char* FileName;
173  int TimeStep;
178  int* BlockIDs;
182 
183  vtkEnSightWriter(const vtkEnSightWriter&) = delete;
184  void operator=(const vtkEnSightWriter&) = delete;
185 };
186 
187 #endif
write vtk unstructured grid data as an EnSight file
Store vtkAlgorithm input/output information.
void SetInputData(vtkDataObject *input)
Set/get the input to this writer.
abstract class to write data to file(s)
Definition: vtkWriter.h:45
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkDataObject * GetInput()
dataset represents arbitrary combinations of all possible cell types
virtual int * GetBlockIDs()
set the array of Block ID's this class keeps a reference to the array and will not delete it ...
virtual int FillInputPortInformation(int port, vtkInformation *info)
Fill the input port information objects for this algorithm.
vtkUnstructuredGrid * TmpInput
static vtkAlgorithm * New()
virtual void WriteData()=0
virtual void SetBlockIDs(int *val)
set the array of Block ID's this class keeps a reference to the array and will not delete it ...