VTK  9.3.1
vtkEnSightWriter.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
3 // SPDX-License-Identifier: BSD-3-Clause
4 
24 #ifndef vtkEnSightWriter_h
25 #define vtkEnSightWriter_h
26 
27 #include "vtkIOParallelModule.h" // For export macro
28 #include "vtkWriter.h"
29 
30 VTK_ABI_NAMESPACE_BEGIN
32 
33 class VTKIOPARALLEL_EXPORT vtkEnSightWriter : public vtkWriter
34 {
35 
36 public:
37  vtkTypeMacro(vtkEnSightWriter, vtkWriter);
38  void PrintSelf(ostream& os, vtkIndent indent) override;
39 
43  static vtkEnSightWriter* New();
44 
46 
49  vtkSetMacro(ProcessNumber, int);
50  vtkGetMacro(ProcessNumber, int);
52 
54 
57  vtkSetFilePathMacro(Path);
58  vtkGetFilePathMacro(Path);
60 
62 
65  vtkSetStringMacro(BaseName);
66  vtkGetStringMacro(BaseName);
68 
70 
73  vtkSetFilePathMacro(FileName);
74  vtkGetFilePathMacro(FileName);
76 
78 
81  vtkSetMacro(TimeStep, int);
82  vtkGetMacro(TimeStep, int);
84 
86 
89  vtkSetMacro(GhostLevel, int);
90  vtkGetMacro(GhostLevel, int);
92 
94 
98  vtkSetMacro(TransientGeometry, bool);
99  vtkGetMacro(TransientGeometry, bool);
101 
103 
106  vtkSetMacro(NumberOfBlocks, int);
107  vtkGetMacro(NumberOfBlocks, int);
109 
111 
119  vtkBooleanMacro(WriteNodeIDs, bool);
120  vtkSetMacro(WriteNodeIDs, bool);
121  vtkGetMacro(WriteNodeIDs, bool);
123 
125 
133  vtkBooleanMacro(WriteElementIDs, bool);
134  vtkSetMacro(WriteElementIDs, bool);
135  vtkGetMacro(WriteElementIDs, bool);
137 
139 
143  virtual void SetBlockIDs(int* val) { BlockIDs = val; }
144  virtual int* GetBlockIDs() { return BlockIDs; }
146 
148 
151  virtual void SetInputData(vtkUnstructuredGrid* input);
152  virtual vtkUnstructuredGrid* GetInput();
154 
156 
163  virtual void WriteCaseFile(int TotalTimeSteps);
164  virtual void WriteSOSCaseFile(int NumProcs);
166 
167 protected:
169  ~vtkEnSightWriter() override;
170 
171  int FillInputPortInformation(int port, vtkInformation* info) override;
172  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
173  vtkInformationVector* outputVector) override;
174 
175  void WriteData() override; // method to allow this class to be instantiated and delegated to
176 
177  virtual void WriteStringToFile(const char* string, FILE* file);
178  virtual void WriteTerminatedStringToFile(const char* string, FILE* file);
179  virtual void WriteIntToFile(int i, FILE* file);
180  virtual void WriteFloatToFile(float f, FILE* file);
181  virtual void WriteElementTypeToFile(int ElementType, FILE* fd);
182 
183  virtual bool ShouldWriteGeometry();
184  virtual void SanitizeFileName(char* name);
185  virtual FILE* OpenFile(char* name);
186 
187  void ComputeNames();
188  void DefaultNames();
189 
190  int GetExodusModelIndex(int* ElementArray, int NumberElements, int PartID);
191 
192  static int GetDestinationComponent(int srcComponent, int numComponents);
193 
194  char* Path;
195  char* BaseName;
196  char* FileName;
197  int TimeStep;
202  int* BlockIDs;
208 
209  vtkEnSightWriter(const vtkEnSightWriter&) = delete;
210  void operator=(const vtkEnSightWriter&) = delete;
211 };
212 
213 VTK_ABI_NAMESPACE_END
214 #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:34
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:28
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 RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
virtual int FillInputPortInformation(int port, vtkInformation *info)
Fill the input port information objects for this algorithm.
vtkUnstructuredGrid * TmpInput
Store zero or more vtkInformation instances.
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 ...