VTK: IO/Geometry/vtkMFIXReader.h Source File

| VTK 9.3.1

vtkMFIXReader.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
26 #ifndef vtkMFIXReader_h
27 #define vtkMFIXReader_h
28
29 #include "vtkIOGeometryModule.h" // For export macro
30 #include "vtkUnstructuredGridAlgorithm.h"
31
32 VTK_ABI_NAMESPACE_BEGIN
33 class vtkDataArraySelection;
34 class vtkDoubleArray;
35 class vtkStringArray;
36 class vtkIntArray;
37 class vtkFloatArray;
38 class vtkXMLUnstructuredGridWriter;
39 class vtkWedge;
40 class vtkQuad;
41 class vtkHexahedron;
42 class vtkPoints;
43
44 class VTKIOGEOMETRY_EXPORT vtkMFIXReader : public vtkUnstructuredGridAlgorithm
45 {
46 public:
47 static vtkMFIXReader* New();
48 vtkTypeMacro(vtkMFIXReader, vtkUnstructuredGridAlgorithm);
49 void PrintSelf(ostream& os, vtkIndent indent) override;
50
52
55 vtkSetFilePathMacro(FileName);
56 vtkGetFilePathMacro(FileName);
58
60
64 vtkGetMacro(NumberOfCells, int);
66
68
72 vtkGetMacro(NumberOfPoints, int);
74
76
79 vtkGetMacro(NumberOfCellFields, int);
81
83
86 vtkSetMacro(TimeStep, int);
87 vtkGetMacro(TimeStep, int);
89
91
94 vtkGetMacro(NumberOfTimeSteps, int);
96
98
101 vtkGetVector2Macro(TimeStepRange, int);
102 vtkSetVector2Macro(TimeStepRange, int);
104
108 int GetNumberOfCellArrays();
109
114 const char* GetCellArrayName(int index);
115
117
121 int GetCellArrayStatus(const char* name);
122 void SetCellArrayStatus(const char* name, int status);
124
126
129 void DisableAllCellArrays();
130 void EnableAllCellArrays();
132
136 void GetCellDataRange(int cellComp, float* min, float* max);
137
138 protected:
139 vtkMFIXReader();
140 ~vtkMFIXReader() override;
141 int RequestInformation(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
142 int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
143
144 //
145 // ParaView Variables
146 //
147
148 char* FileName;
149 int RequestInformationFlag;
150 int MakeMeshFlag;
151 int NumberOfPoints;
152 int NumberOfCells;
153 int NumberOfCellFields;
154 vtkIntArray* VectorLength;
155 vtkFloatArray* Minimum;
156 vtkFloatArray* Maximum;
157 vtkDataArraySelection* CellDataArraySelection;
158 int TimeStep;
159 int ActualTimeStep;
160 int CurrentTimeStep;
161 int NumberOfTimeSteps;
162 int* TimeSteps;
163 int TimeStepRange[2];
164 int TimeStepWasReadOnce;
165
166 //
167 // MFIX Variables
168 //
169
170 vtkFloatArray** CellDataArray; // Arrays for variables that will
171 // attach to mesh
172 vtkPoints* Points; // Points array for building grid
173 vtkUnstructuredGrid* Mesh; // Unstructured Grid
174 vtkHexahedron* AHexahedron; // Hexahedron type cell
175 vtkWedge* AWedge; // Wedge type cell
176 vtkQuad* AQuad; // Quad type cell
177 vtkIntArray* Flag; // Cell Flag array
178 vtkDoubleArray* Dx; // Cell widths in x axis
179 vtkDoubleArray* Dy; // Cell widths in y axis
180 vtkDoubleArray* Dz; // Cell widths in z axis
181 vtkIntArray* NMax; // Array to hold number of species per phase
182 vtkDoubleArray* C; // Array used to parse restart file
183 vtkIntArray* TempI; // Array used to parse restart file
184 vtkDoubleArray* TempD; // Array used to parse restart file
185 vtkIntArray* SpxFileExists; // Array for keeping track of
186 // what spx files exist.
187
188 char FileExtension[15];
189 char DataBuffer[513];
190 char Version[120];
191 float VersionNumber;
192 int DimensionIc;
193 int DimensionBc;
194 int DimensionC;
195 int DimensionIs;
196 double Ce;
197 double Cf;
198 double Phi;
199 double PhiW;
200 double DeltaTime;
201 double XMinimum;
202 char RunName[256];
203 vtkStringArray* VariableNames;
204 vtkIntArray* VariableComponents;
205 int IMinimum1;
206 int JMinimum1;
207 int KMinimum1;
208 int IMaximum;
209 int JMaximum;
210 int KMaximum;
211 int IMaximum1;
212 int JMaximum1;
213 int KMaximum1;
214 int IMaximum2;
215 int JMaximum2;
216 int KMaximum2;
217 int IJMaximum2;
218 int IJKMaximum2;
219 int MMAX;
220 int NumberOfSPXFilesUsed;
221 double XLength;
222 double YLength;
223 double ZLength;
224 int NumberOfScalars;
225 int NumberOfReactionRates;
226 bool BkEpsilon;
227 char CoordinateSystem[17];
228 char Units[17];
229
230 //
231 // SPX Variables
232 //
233
234 int MaximumTimestep; // maximum timesteps amongst the variables
235 int SPXRecordsPerTimestep; // number of records in a single
236 // timestep for a variable
237 vtkIntArray* SPXToNVarTable; // number of variables in each spx file
238 vtkIntArray* VariableToSkipTable; // skip value for each variable, this
239 // is needed in spx files
240 // with more than one variable.
241 vtkIntArray* VariableTimesteps; // number of timesteps for each variable
242 vtkIntArray* VariableTimestepTable; // Since the number of timesteps
243 // vary between variables
244 // this is a table that looks
245 // up the appropriate timestep
246 // for the particular variable.
247 vtkIntArray* variableIndexToSPX; // This gives the spx file number for the
248 // particular variable.
249 vtkIntArray* VariableIndexToSPX; // This gives the spx file number for the
250 // particular variable.
251 vtkIntArray* SPXTimestepIndexTable; // This a table look up for the index
252 // into a file for a certain variable.
253
254 private:
255 vtkMFIXReader(const vtkMFIXReader&) = delete;
256 void operator=(const vtkMFIXReader&) = delete;
257
258 void MakeMesh(vtkUnstructuredGrid* output);
259 void SwapDouble(double& value);
260 void SwapFloat(float& value);
261 void SwapInt(int& value);
262 void GetInt(istream& in, int& val);
263 void GetDouble(istream& in, double& val);
264 void SkipBytes(istream& in, int n);
265 void RestartVersionNumber(const char* buffer);
266 void GetBlockOfDoubles(istream& in, vtkDoubleArray* v, int n);
267 void GetBlockOfFloats(istream& in, vtkFloatArray* v, int n);
268 void GetBlockOfInts(istream& in, vtkIntArray* v, int n);
269 void ReadRestartFile();
270 void GetVariableAtTimestep(int vari, int tstep, vtkFloatArray* v);
271 void CreateVariableNames();
272 void GetTimeSteps();
273 void MakeTimeStepTable(int numberOfVariables);
274 void SetProjectName(const char* infile);
275 void MakeSPXTimeStepIndexTable(int nvars);
276 void CalculateMaxTimeStep();
277 void GetNumberOfVariablesInSPXFiles();
278 void FillVectorVariable(int xindex, int yindex, int zindex, vtkFloatArray* v);
279 void ConvertVectorFromCylindricalToCartesian(int xindex, int zindex);
280 void GetAllTimes(vtkInformationVector* outputVector);
281 };
282
283 VTK_ABI_NAMESPACE_END
284 #endif
vtkDataArraySelection
Store on/off settings for data arrays, etc.
Definition: vtkDataArraySelection.h:37
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:40
vtkFloatArray
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:40
vtkHexahedron
a cell that represents a linear 3D hexahedron
Definition: vtkHexahedron.h:43
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:40
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:72
vtkIntArray
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:44
vtkMFIXReader
reads a dataset in MFIX file format
Definition: vtkMFIXReader.h:45
vtkMFIXReader::~vtkMFIXReader
~vtkMFIXReader() override
vtkMFIXReader::vtkGetFilePathMacro
vtkGetFilePathMacro(FileName)
Specify the file name of the MFIX Restart data file to read.
vtkMFIXReader::IMinimum1
int IMinimum1
Definition: vtkMFIXReader.h:205
vtkMFIXReader::JMaximum1
int JMaximum1
Definition: vtkMFIXReader.h:212
vtkMFIXReader::SPXToNVarTable
vtkIntArray * SPXToNVarTable
Definition: vtkMFIXReader.h:237
vtkMFIXReader::AQuad
vtkQuad * AQuad
Definition: vtkMFIXReader.h:176
vtkMFIXReader::IMaximum1
int IMaximum1
Definition: vtkMFIXReader.h:211
vtkMFIXReader::DimensionC
int DimensionC
Definition: vtkMFIXReader.h:194
vtkMFIXReader::KMaximum
int KMaximum
Definition: vtkMFIXReader.h:210
vtkMFIXReader::Flag
vtkIntArray * Flag
Definition: vtkMFIXReader.h:177
vtkMFIXReader::ActualTimeStep
int ActualTimeStep
Definition: vtkMFIXReader.h:159
vtkMFIXReader::vtkSetFilePathMacro
vtkSetFilePathMacro(FileName)
Specify the file name of the MFIX Restart data file to read.
vtkMFIXReader::AHexahedron
vtkHexahedron * AHexahedron
Definition: vtkMFIXReader.h:174
vtkMFIXReader::SetCellArrayStatus
void SetCellArrayStatus(const char *name, int status)
Get/Set whether the cell array with the given name is to be read.
vtkMFIXReader::NumberOfScalars
int NumberOfScalars
Definition: vtkMFIXReader.h:224
vtkMFIXReader::GetCellArrayStatus
int GetCellArrayStatus(const char *name)
Get/Set whether the cell array with the given name is to be read.
vtkMFIXReader::Mesh
vtkUnstructuredGrid * Mesh
Definition: vtkMFIXReader.h:173
vtkMFIXReader::GetNumberOfCellArrays
int GetNumberOfCellArrays()
Get the number of cell arrays available in the input.
vtkMFIXReader::PhiW
double PhiW
Definition: vtkMFIXReader.h:199
vtkMFIXReader::DimensionBc
int DimensionBc
Definition: vtkMFIXReader.h:193
vtkMFIXReader::NumberOfReactionRates
int NumberOfReactionRates
Definition: vtkMFIXReader.h:225
vtkMFIXReader::KMaximum2
int KMaximum2
Definition: vtkMFIXReader.h:216
vtkMFIXReader::CurrentTimeStep
int CurrentTimeStep
Definition: vtkMFIXReader.h:160
vtkMFIXReader::KMaximum1
int KMaximum1
Definition: vtkMFIXReader.h:213
vtkMFIXReader::MakeMeshFlag
int MakeMeshFlag
Definition: vtkMFIXReader.h:150
vtkMFIXReader::VariableToSkipTable
vtkIntArray * VariableToSkipTable
Definition: vtkMFIXReader.h:238
vtkMFIXReader::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkMFIXReader::vtkMFIXReader
vtkMFIXReader()
vtkMFIXReader::NumberOfPoints
int NumberOfPoints
Definition: vtkMFIXReader.h:151
vtkMFIXReader::IJKMaximum2
int IJKMaximum2
Definition: vtkMFIXReader.h:218
vtkMFIXReader::SPXTimestepIndexTable
vtkIntArray * SPXTimestepIndexTable
Definition: vtkMFIXReader.h:251
vtkMFIXReader::DimensionIc
int DimensionIc
Definition: vtkMFIXReader.h:192
vtkMFIXReader::JMaximum2
int JMaximum2
Definition: vtkMFIXReader.h:215
vtkMFIXReader::TempD
vtkDoubleArray * TempD
Definition: vtkMFIXReader.h:184
vtkMFIXReader::MaximumTimestep
int MaximumTimestep
Definition: vtkMFIXReader.h:234
vtkMFIXReader::YLength
double YLength
Definition: vtkMFIXReader.h:222
vtkMFIXReader::KMinimum1
int KMinimum1
Definition: vtkMFIXReader.h:207
vtkMFIXReader::GetCellArrayName
const char * GetCellArrayName(int index)
Get the name of the cell array with the given index in the input.
vtkMFIXReader::Dz
vtkDoubleArray * Dz
Definition: vtkMFIXReader.h:180
vtkMFIXReader::VariableTimestepTable
vtkIntArray * VariableTimestepTable
Definition: vtkMFIXReader.h:242
vtkMFIXReader::ZLength
double ZLength
Definition: vtkMFIXReader.h:223
vtkMFIXReader::AWedge
vtkWedge * AWedge
Definition: vtkMFIXReader.h:175
vtkMFIXReader::RequestInformation
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
vtkMFIXReader::Dx
vtkDoubleArray * Dx
Definition: vtkMFIXReader.h:178
vtkMFIXReader::New
static vtkMFIXReader * New()
vtkMFIXReader::Cf
double Cf
Definition: vtkMFIXReader.h:197
vtkMFIXReader::XMinimum
double XMinimum
Definition: vtkMFIXReader.h:201
vtkMFIXReader::VariableNames
vtkStringArray * VariableNames
Definition: vtkMFIXReader.h:203
vtkMFIXReader::VariableTimesteps
vtkIntArray * VariableTimesteps
Definition: vtkMFIXReader.h:241
vtkMFIXReader::IMaximum
int IMaximum
Definition: vtkMFIXReader.h:208
vtkMFIXReader::VersionNumber
float VersionNumber
Definition: vtkMFIXReader.h:191
vtkMFIXReader::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkMFIXReader::IJMaximum2
int IJMaximum2
Definition: vtkMFIXReader.h:217
vtkMFIXReader::TimeSteps
int * TimeSteps
Definition: vtkMFIXReader.h:162
vtkMFIXReader::CellDataArraySelection
vtkDataArraySelection * CellDataArraySelection
Definition: vtkMFIXReader.h:157
vtkMFIXReader::NMax
vtkIntArray * NMax
Definition: vtkMFIXReader.h:181
vtkMFIXReader::VariableComponents
vtkIntArray * VariableComponents
Definition: vtkMFIXReader.h:204
vtkMFIXReader::TimeStep
int TimeStep
Definition: vtkMFIXReader.h:158
vtkMFIXReader::CellDataArray
vtkFloatArray ** CellDataArray
Definition: vtkMFIXReader.h:170
vtkMFIXReader::NumberOfTimeSteps
int NumberOfTimeSteps
Definition: vtkMFIXReader.h:161
vtkMFIXReader::NumberOfCells
int NumberOfCells
Definition: vtkMFIXReader.h:152
vtkMFIXReader::SPXRecordsPerTimestep
int SPXRecordsPerTimestep
Definition: vtkMFIXReader.h:235
vtkMFIXReader::Dy
vtkDoubleArray * Dy
Definition: vtkMFIXReader.h:179
vtkMFIXReader::SpxFileExists
vtkIntArray * SpxFileExists
Definition: vtkMFIXReader.h:185
vtkMFIXReader::DeltaTime
double DeltaTime
Definition: vtkMFIXReader.h:200
vtkMFIXReader::EnableAllCellArrays
void EnableAllCellArrays()
Turn on/off all cell arrays.
vtkMFIXReader::FileName
char * FileName
Definition: vtkMFIXReader.h:148
vtkMFIXReader::Maximum
vtkFloatArray * Maximum
Definition: vtkMFIXReader.h:156
vtkMFIXReader::VectorLength
vtkIntArray * VectorLength
Definition: vtkMFIXReader.h:154
vtkMFIXReader::IMaximum2
int IMaximum2
Definition: vtkMFIXReader.h:214
vtkMFIXReader::Ce
double Ce
Definition: vtkMFIXReader.h:196
vtkMFIXReader::VariableIndexToSPX
vtkIntArray * VariableIndexToSPX
Definition: vtkMFIXReader.h:249
vtkMFIXReader::DimensionIs
int DimensionIs
Definition: vtkMFIXReader.h:195
vtkMFIXReader::NumberOfCellFields
int NumberOfCellFields
Definition: vtkMFIXReader.h:153
vtkMFIXReader::TimeStepWasReadOnce
int TimeStepWasReadOnce
Definition: vtkMFIXReader.h:164
vtkMFIXReader::XLength
double XLength
Definition: vtkMFIXReader.h:221
vtkMFIXReader::RequestInformationFlag
int RequestInformationFlag
Definition: vtkMFIXReader.h:149
vtkMFIXReader::JMaximum
int JMaximum
Definition: vtkMFIXReader.h:209
vtkMFIXReader::Minimum
vtkFloatArray * Minimum
Definition: vtkMFIXReader.h:155
vtkMFIXReader::DisableAllCellArrays
void DisableAllCellArrays()
Turn on/off all cell arrays.
vtkMFIXReader::Points
vtkPoints * Points
Definition: vtkMFIXReader.h:172
vtkMFIXReader::BkEpsilon
bool BkEpsilon
Definition: vtkMFIXReader.h:226
vtkMFIXReader::Phi
double Phi
Definition: vtkMFIXReader.h:198
vtkMFIXReader::NumberOfSPXFilesUsed
int NumberOfSPXFilesUsed
Definition: vtkMFIXReader.h:220
vtkMFIXReader::C
vtkDoubleArray * C
Definition: vtkMFIXReader.h:182
vtkMFIXReader::variableIndexToSPX
vtkIntArray * variableIndexToSPX
Definition: vtkMFIXReader.h:247
vtkMFIXReader::JMinimum1
int JMinimum1
Definition: vtkMFIXReader.h:206
vtkMFIXReader::TempI
vtkIntArray * TempI
Definition: vtkMFIXReader.h:183
vtkMFIXReader::MMAX
int MMAX
Definition: vtkMFIXReader.h:219
vtkMFIXReader::GetCellDataRange
void GetCellDataRange(int cellComp, float *min, float *max)
Get the range of cell data.
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:38
vtkQuad
a cell that represents a 2D quadrilateral
Definition: vtkQuad.h:37
vtkStringArray
a vtkAbstractArray subclass for strings
Definition: vtkStringArray.h:41
vtkUnstructuredGridAlgorithm
Superclass for algorithms that produce only unstructured grid as output.
Definition: vtkUnstructuredGridAlgorithm.h:30
vtkUnstructuredGrid
dataset represents arbitrary combinations of all possible cell types
Definition: vtkUnstructuredGrid.h:99
vtkWedge
a 3D cell that represents a linear wedge
Definition: vtkWedge.h:45
vtkXMLUnstructuredGridWriter
Write VTK XML UnstructuredGrid files.
Definition: vtkXMLUnstructuredGridWriter.h:40
vtkX3D::value
@ value
Definition: vtkX3D.h:220
vtkX3D::name
@ name
Definition: vtkX3D.h:219
vtkX3D::index
@ index
Definition: vtkX3D.h:246
vtkUnstructuredGridAlgorithm.h
max
#define max(a, b)
Definition: vtkX3DExporterFIWriterHelper.h:19