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);
134 
136 
143  virtual void WriteCaseFile(int TotalTimeSteps);
144  virtual void WriteSOSCaseFile(int NumProcs);
146 
147 protected:
149  ~vtkEnSightWriter() override;
150 
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 
184  void operator=(const vtkEnSightWriter&) = delete;
185 };
186 
187 #endif
vtkEnSightWriter::OpenFile
virtual FILE * OpenFile(char *name)
vtkEnSightWriter::operator=
void operator=(const vtkEnSightWriter &)=delete
vtkEnSightWriter::New
static vtkEnSightWriter * New()
vtkEnSightWriter::DefaultNames
void DefaultNames()
vtkEnSightWriter::WriteStringToFile
virtual void WriteStringToFile(const char *string, FILE *file)
vtkEnSightWriter::TimeStep
int TimeStep
Definition: vtkEnSightWriter.h:173
vtkEnSightWriter::~vtkEnSightWriter
~vtkEnSightWriter() override
vtkEnSightWriter
write vtk unstructured grid data as an EnSight file
Definition: vtkEnSightWriter.h:42
vtkEnSightWriter::NumberOfBlocks
int NumberOfBlocks
Definition: vtkEnSightWriter.h:177
vtkEnSightWriter::WriteFloatToFile
virtual void WriteFloatToFile(const float f, FILE *file)
vtkEnSightWriter::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkEnSightWriter::WriteSOSCaseFile
virtual void WriteSOSCaseFile(int NumProcs)
vtkEnSightWriter::GhostLevelMultiplier
int GhostLevelMultiplier
Definition: vtkEnSightWriter.h:174
vtkEnSightWriter::WriteElementTypeToFile
virtual void WriteElementTypeToFile(int ElementType, FILE *fd)
vtkX3D::port
@ port
Definition: vtkX3D.h:453
vtkEnSightWriter::BlockIDs
int * BlockIDs
Definition: vtkEnSightWriter.h:178
vtkEnSightWriter::GetInput
virtual vtkUnstructuredGrid * GetInput()
vtkEnSightWriter::SanitizeFileName
virtual void SanitizeFileName(char *name)
vtkEnSightWriter::SetInputData
virtual void SetInputData(vtkUnstructuredGrid *input)
Specify the input data or filter.
vtkEnSightWriter::FileName
char * FileName
Definition: vtkEnSightWriter.h:172
vtkEnSightWriter::WriteCaseFile
virtual void WriteCaseFile(int TotalTimeSteps)
Writes the case file that EnSight is capable of reading The other data files must be written before t...
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
vtkWriter
abstract class to write data to file(s)
Definition: vtkWriter.h:43
vtkEnSightWriter::SetBlockIDs
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
Definition: vtkEnSightWriter.h:123
vtkEnSightWriter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkX3D::name
@ name
Definition: vtkX3D.h:225
vtkEnSightWriter::TransientGeometry
bool TransientGeometry
Definition: vtkEnSightWriter.h:179
vtkEnSightWriter::TmpInput
vtkUnstructuredGrid * TmpInput
Definition: vtkEnSightWriter.h:181
vtkEnSightWriter::WriteData
void WriteData() override
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:65
vtkEnSightWriter::vtkEnSightWriter
vtkEnSightWriter(const vtkEnSightWriter &)=delete
vtkX3D::info
@ info
Definition: vtkX3D.h:382
vtkEnSightWriter::ComputeNames
void ComputeNames()
vtkWriter.h
vtkEnSightWriter::BaseName
char * BaseName
Definition: vtkEnSightWriter.h:171
vtkEnSightWriter::GetBlockIDs
virtual int * GetBlockIDs()
Definition: vtkEnSightWriter.h:124
vtkEnSightWriter::ProcessNumber
int ProcessNumber
Definition: vtkEnSightWriter.h:175
vtkEnSightWriter::ShouldWriteGeometry
virtual bool ShouldWriteGeometry()
vtkEnSightWriter::Path
char * Path
Definition: vtkEnSightWriter.h:170
vtkUnstructuredGrid
dataset represents arbitrary combinations of all possible cell types
Definition: vtkUnstructuredGrid.h:93
vtkEnSightWriter::NumberOfProcesses
int NumberOfProcesses
Definition: vtkEnSightWriter.h:176
vtkEnSightWriter::vtkEnSightWriter
vtkEnSightWriter()
vtkEnSightWriter::GhostLevel
int GhostLevel
Definition: vtkEnSightWriter.h:180
vtkEnSightWriter::WriteIntToFile
virtual void WriteIntToFile(const int i, FILE *file)
vtkEnSightWriter::WriteTerminatedStringToFile
virtual void WriteTerminatedStringToFile(const char *string, FILE *file)
vtkEnSightWriter::GetExodusModelIndex
int GetExodusModelIndex(int *ElementArray, int NumberElements, int PartID)