VTK  9.2.6
vtkCGNSReader.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkCGNSReader.h
5
6 Copyright (c) Ken Martin, Will Schrodeder, 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// Copyright 2013-2014 Mickael Philit.
16
28
29#ifndef vtkCGNSReader_h
30#define vtkCGNSReader_h
31
32#include "vtkIOCGNSReaderModule.h" // for export macro
34#include "vtkNew.h" // for vtkNew.
35
36#include <string> // for std::string
37
40
41namespace CGNSRead
42{
43class vtkCGNSMetaData;
44}
45
47class VTKIOCGNSREADER_EXPORT vtkCGNSReader : public vtkMultiBlockDataSetAlgorithm
48{
49public:
50 static vtkCGNSReader* New();
52 void PrintSelf(ostream& os, vtkIndent indent) override;
53
59
61
71 vtkSetClampMacro(DataLocation, int, vtkCGNSReader::CELL_DATA, vtkCGNSReader::FACE_DATA);
72 vtkGetMacro(DataLocation, int);
74
76
82
86 int CanReadFile(VTK_FILEPATH const char* filename);
87
92
97
99
105 int GetBaseArrayStatus(const char* name);
106 void SetBaseArrayStatus(const char* name, int status);
110 const char* GetBaseArrayName(int index);
112
114
119 const char* GetFamilyArrayName(int index);
120 void SetFamilyArrayStatus(const char* name, int status);
121 int GetFamilyArrayStatus(const char* name);
125
127
132 const char* GetPointArrayName(int index);
133 int GetPointArrayStatus(const char* name);
134 void SetPointArrayStatus(const char* name, int status);
138
140
145 const char* GetCellArrayName(int index);
146 int GetCellArrayStatus(const char* name);
147 void SetCellArrayStatus(const char* name, int status);
151
153
158 const char* GetFaceArrayName(int index);
159 int GetFaceArrayStatus(const char* name);
160 void SetFaceArrayStatus(const char* name, int status);
164
165 vtkSetMacro(DoublePrecisionMesh, int);
166 vtkGetMacro(DoublePrecisionMesh, int);
167 vtkBooleanMacro(DoublePrecisionMesh, int);
168
170
174 vtkSetMacro(LoadBndPatch, bool);
175 vtkGetMacro(LoadBndPatch, bool);
176 vtkBooleanMacro(LoadBndPatch, bool);
178
180
184 vtkSetMacro(LoadMesh, bool);
185 vtkGetMacro(LoadMesh, bool);
186 vtkBooleanMacro(LoadMesh, bool);
188
190
193 vtkSetMacro(Use3DVector, bool);
194 vtkGetMacro(Use3DVector, bool);
195 vtkBooleanMacro(Use3DVector, bool);
197
205 vtkSetMacro(CreateEachSolutionAsBlock, int);
206 vtkGetMacro(CreateEachSolutionAsBlock, int);
207 vtkBooleanMacro(CreateEachSolutionAsBlock, int);
208
222 vtkSetMacro(IgnoreFlowSolutionPointers, bool);
223 vtkGetMacro(IgnoreFlowSolutionPointers, bool);
224 vtkBooleanMacro(IgnoreFlowSolutionPointers, bool);
225
232 vtkSetMacro(UseUnsteadyPattern, bool);
233 vtkGetMacro(UseUnsteadyPattern, bool);
234 vtkBooleanMacro(UseUnsteadyPattern, bool);
235
241 vtkSetMacro(DistributeBlocks, bool);
242 vtkGetMacro(DistributeBlocks, bool);
243 vtkBooleanMacro(DistributeBlocks, bool);
244
246
251 void SetCacheMesh(bool enable);
252 vtkGetMacro(CacheMesh, bool);
253 vtkBooleanMacro(CacheMesh, bool);
254
256
261 void SetCacheConnectivity(bool enable);
262 vtkGetMacro(CacheConnectivity, bool);
263 vtkBooleanMacro(CacheConnectivity, bool);
264
266
274
280
285
286protected:
288 ~vtkCGNSReader() override;
289
290 int FillOutputPortInformation(int port, vtkInformation* info) override;
293
295 int base, int zone, int cell_dim, int phys_dim, void* zsize, vtkMultiBlockDataSet* mbase);
296
298 int base, int zone, int cell_dim, int phys_dim, void* zsize, vtkMultiBlockDataSet* mbase);
299
303
306
310
311private:
312 vtkCGNSReader(const vtkCGNSReader&) = delete;
313 void operator=(const vtkCGNSReader&) = delete;
314
315 std::string FileName = "";
316 int DataLocation = vtkCGNSReader::CELL_DATA;
317 bool LoadBndPatch = false; // option to set section loading for unstructured grid
318 bool LoadMesh = true; // option to enable/disable mesh loading
319 int DoublePrecisionMesh = 1; // option to set mesh loading to double precision
320 int CreateEachSolutionAsBlock = 0; // debug option to create
321 bool IgnoreFlowSolutionPointers = false;
322 bool UseUnsteadyPattern = false;
323 bool DistributeBlocks = true;
324 bool CacheMesh = false;
325 bool CacheConnectivity = false;
326 bool Use3DVector = true;
327
328 // For internal cgio calls (low level IO)
329 int cgioNum; // cgio file reference
330 double rootId; // id of root node
331 double currentId; // id of node currently being read (zone)
332
333 unsigned int NumberOfBases = 0;
334 int ActualTimeStep = 0;
335
336 class vtkPrivate;
337 vtkPrivate* Internals;
338 friend class vtkPrivate;
339};
340
341#endif // vtkCGNSReader_h
void DisableAllFamilies()
API to select families to read.
int GetNumberOfFaceArrays()
API to get information of face arrays and enable/disable loading of a particular arrays.
friend class vtkPrivate
void Broadcast(vtkMultiProcessController *ctrl)
Sends metadata (that read from the input file, not settings modified through this API) from the rank ...
const char * GetPointArrayName(int index)
API to get information of point arrays and enable/disable loading of a particular arrays.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
void SetController(vtkMultiProcessController *c)
Set/get the communication object used to relay a list of files from the rank 0 process to all others.
void SetCacheMesh(bool enable)
This reader can cache the mesh points if they are time invariant.
int GetCurvilinearZone(int base, int zone, int cell_dim, int phys_dim, void *zsize, vtkMultiBlockDataSet *mbase)
~vtkCGNSReader() override
int GetCellArrayStatus(const char *name)
API to get information of cell arrays and enable/disable loading of a particular arrays.
vtkMultiProcessController * Controller
int GetPointArrayStatus(const char *name)
API to get information of point arrays and enable/disable loading of a particular arrays.
void EnableAllFaceArrays()
API to get information of face arrays and enable/disable loading of a particular arrays.
void DisableAllCellArrays()
API to get information of cell arrays and enable/disable loading of a particular arrays.
void EnableAllFamilies()
API to select families to read.
void DisableAllPointArrays()
API to get information of point arrays and enable/disable loading of a particular arrays.
const char * GetBaseArrayName(int index)
API to select bases to read.
int GetNumberOfPointArrays()
API to get information of point arrays and enable/disable loading of a particular arrays.
vtkNew< vtkDataArraySelection > FaceDataArraySelection
void SetBaseArrayStatus(const char *name, int status)
API to select bases to read.
vtkIdType ProcSize
vtkDataArraySelection * GetBaseSelection()
Returns access to the base selection object.
const char * GetCellArrayName(int index)
API to get information of cell arrays and enable/disable loading of a particular arrays.
int GetUnstructuredZone(int base, int zone, int cell_dim, int phys_dim, void *zsize, vtkMultiBlockDataSet *mbase)
vtkIdType ProcRank
static vtkCGNSReader * New()
void SetFaceArrayStatus(const char *name, int status)
API to get information of face arrays and enable/disable loading of a particular arrays.
vtkDataArraySelection * GetFamilySelection()
Returns access to the family selection object.
void DisableAllBases()
API to select bases to read.
void SetCacheConnectivity(bool enable)
This reader can cache the mesh connectivities if they are time invariant.
int GetBaseArrayStatus(const char *name)
API to select bases to read.
void EnableAllCellArrays()
API to get information of cell arrays and enable/disable loading of a particular arrays.
vtkGetCharFromStdStringMacro(FileName)
Specify file name of CGNS datafile to read.
int CanReadFile(VTK_FILEPATH const char *filename)
Is the given file name a CGNS file?
int GetFamilyArrayStatus(const char *name)
API to select families to read.
vtkNew< vtkDataArraySelection > PointDataArraySelection
int GetNumberOfBaseArrays()
API to select bases to read.
void DisableAllFaceArrays()
API to get information of face arrays and enable/disable loading of a particular arrays.
vtkNew< vtkDataArraySelection > CellDataArraySelection
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkSetStdStringFromCharMacro(FileName)
Specify file name of CGNS datafile to read.
void EnableAllPointArrays()
API to get information of point arrays and enable/disable loading of a particular arrays.
void SetFamilyArrayStatus(const char *name, int status)
API to select families to read.
vtkNew< vtkDataArraySelection > BaseSelection
void SetCellArrayStatus(const char *name, int status)
API to get information of cell arrays and enable/disable loading of a particular arrays.
int GetNumberOfFamilyArrays()
API to select families to read.
const char * GetFaceArrayName(int index)
API to get information of face arrays and enable/disable loading of a particular arrays.
int GetFaceArrayStatus(const char *name)
API to get information of face arrays and enable/disable loading of a particular arrays.
const char * GetFamilyArrayName(int index)
API to select families to read.
int GetNumberOfCellArrays()
API to get information of cell arrays and enable/disable loading of a particular arrays.
void SetPointArrayStatus(const char *name, int status)
API to get information of point arrays and enable/disable loading of a particular arrays.
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkInformationStringKey * FAMILY()
Key used to put a family name in the meta-data associated with a node.
void EnableAllBases()
API to select bases to read.
vtkNew< vtkDataArraySelection > FamilySelection
Store on/off settings for data arrays, etc.
a simple class to control print indentation
Definition vtkIndent.h:34
Key for string values in vtkInformation.
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Composite dataset that organizes datasets into blocks.
Multiprocessing communication superclass.
Allocate and hold a VTK object.
Definition vtkNew.h:56
int vtkIdType
Definition vtkType.h:332
#define VTK_FILEPATH