VTK  9.1.0
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
35#ifndef vtkCGNSReader_h
36#define vtkCGNSReader_h
37
38#include "vtkIOCGNSReaderModule.h" // for export macro
40#include "vtkNew.h" // for vtkNew.
41
42class vtkDataSet;
44class vtkCGNSSubsetInclusionLattice;
45class vtkPoints;
48
49namespace CGNSRead
50{
51class vtkCGNSMetaData;
52}
53
55class VTKIOCGNSREADER_EXPORT vtkCGNSReader : public vtkMultiBlockDataSetAlgorithm
56{
57public:
58 static vtkCGNSReader* New();
60 void PrintSelf(ostream& os, vtkIndent indent) override;
61
63
69
73 int CanReadFile(VTK_FILEPATH const char* filename);
74
79
84
86
92 int GetBaseArrayStatus(const char* name);
93 void SetBaseArrayStatus(const char* name, int status);
97 const char* GetBaseArrayName(int index);
99
101
106 const char* GetFamilyArrayName(int index);
107 void SetFamilyArrayStatus(const char* name, int status);
108 int GetFamilyArrayStatus(const char* name);
112
114
119 const char* GetPointArrayName(int index);
120 int GetPointArrayStatus(const char* name);
121 void SetPointArrayStatus(const char* name, int status);
125
127
132 const char* GetCellArrayName(int index);
133 int GetCellArrayStatus(const char* name);
134 void SetCellArrayStatus(const char* name, int status);
138
139 vtkSetMacro(DoublePrecisionMesh, int);
140 vtkGetMacro(DoublePrecisionMesh, int);
141 vtkBooleanMacro(DoublePrecisionMesh, int);
142
144
148 vtkSetMacro(LoadBndPatch, bool);
149 vtkGetMacro(LoadBndPatch, bool);
150 vtkBooleanMacro(LoadBndPatch, bool);
152
154
158 vtkSetMacro(LoadMesh, bool);
159 vtkGetMacro(LoadMesh, bool);
160 vtkBooleanMacro(LoadMesh, bool);
162
164
167 vtkSetMacro(Use3DVector, bool);
168 vtkGetMacro(Use3DVector, bool);
169 vtkBooleanMacro(Use3DVector, bool);
171
179 vtkSetMacro(CreateEachSolutionAsBlock, int);
180 vtkGetMacro(CreateEachSolutionAsBlock, int);
181 vtkBooleanMacro(CreateEachSolutionAsBlock, int);
182
196 vtkSetMacro(IgnoreFlowSolutionPointers, bool);
197 vtkGetMacro(IgnoreFlowSolutionPointers, bool);
198 vtkBooleanMacro(IgnoreFlowSolutionPointers, bool);
199
206 vtkSetMacro(UseUnsteadyPattern, bool);
207 vtkGetMacro(UseUnsteadyPattern, bool);
208 vtkBooleanMacro(UseUnsteadyPattern, bool);
209
215 vtkSetMacro(DistributeBlocks, bool);
216 vtkGetMacro(DistributeBlocks, bool);
217 vtkBooleanMacro(DistributeBlocks, bool);
218
220
225 void SetCacheMesh(bool enable);
226 vtkGetMacro(CacheMesh, bool);
227 vtkBooleanMacro(CacheMesh, bool);
228
230
235 void SetCacheConnectivity(bool enable);
236 vtkGetMacro(CacheConnectivity, bool);
237 vtkBooleanMacro(CacheConnectivity, bool);
238
240
246 vtkGetObjectMacro(Controller, vtkMultiProcessController);
248
254
259
260protected:
262 ~vtkCGNSReader() override;
263
264 int FillOutputPortInformation(int port, vtkInformation* info) override;
267
270
273
275 int base, int zone, int cell_dim, int phys_dim, void* zsize, vtkMultiBlockDataSet* mbase);
276
278 int base, int zone, int cell_dim, int phys_dim, void* zsize, vtkMultiBlockDataSet* mbase);
282
283private:
284 vtkCGNSReader(const vtkCGNSReader&) = delete;
285 void operator=(const vtkCGNSReader&) = delete;
286
287 char* FileName; // cgns file name
288 bool LoadBndPatch; // option to set section loading for unstructured grid
289 bool LoadMesh; // option to enable/disable mesh loading
290 int DoublePrecisionMesh; // option to set mesh loading to double precision
291 int CreateEachSolutionAsBlock; // debug option to create
292 bool IgnoreFlowSolutionPointers;
293 bool UseUnsteadyPattern;
294 bool DistributeBlocks;
295 bool CacheMesh;
296 bool CacheConnectivity;
297 bool Use3DVector;
298
299 // For internal cgio calls (low level IO)
300 int cgioNum; // cgio file reference
301 double rootId; // id of root node
302 double currentId; // id of node currently being read (zone)
303 //
304 unsigned int NumberOfBases;
305 int ActualTimeStep;
306
307 class vtkPrivate;
308 vtkPrivate* Internals;
309 friend class vtkPrivate;
310};
311
312#endif // vtkCGNSReader_h
vtkCGNSReader creates a multi-block dataset and reads unstructured grids, and structured meshes from ...
Definition: vtkCGNSReader.h:56
void DisableAllFamilies()
API to select families to read.
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
vtkGetFilePathMacro(FileName)
Specify file name of CGNS datafile to read.
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 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.
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()
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 meshconnectivities 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.
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.
vtkNew< vtkDataArraySelection > CellDataArraySelection
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
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.
vtkSetFilePathMacro(FileName)
Specify file name of CGNS datafile 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 * 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 for a vtkSource.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:166
a simple class to control print indentation
Definition: vtkIndent.h:113
Key for string values in vtkInformation.
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Superclass for algorithms that produce only vtkMultiBlockDataSet as output.
Composite dataset that organizes datasets into blocks.
Multiprocessing communication superclass.
Allocate and hold a VTK object.
Definition: vtkNew.h:165
represent and manipulate 3D points
Definition: vtkPoints.h:143
dataset represents arbitrary combinations of all possible cell types
int vtkIdType
Definition: vtkType.h:332
#define VTK_FILEPATH