VTK  9.7.1
vtkCGNSReader.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright 2013-2014 Mickael Philit
3 // SPDX-License-Identifier: BSD-3-Clause
19 #ifndef vtkCGNSReader_h
20 #define vtkCGNSReader_h
21 
22 #include "vtkIOCGNSReaderModule.h" // for export macro
24 #include "vtkNew.h" // for vtkNew.
25 
26 #include <map> // for std::map
27 #include <set> // for std::set
28 #include <string> // for std::string
29 
30 namespace CGNSRead
31 {
32 VTK_ABI_NAMESPACE_BEGIN
33 class vtkCGNSMetaData;
34 VTK_ABI_NAMESPACE_END
35 }
36 
37 VTK_ABI_NAMESPACE_BEGIN
41 
42 class VTKIOCGNSREADER_EXPORT vtkCGNSReader : public vtkMultiBlockDataSetAlgorithm
43 {
44 public:
45  static vtkCGNSReader* New();
47  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
50  {
51  CELL_DATA = 0,
52  FACE_DATA
53  };
54 
56 
66  vtkSetClampMacro(DataLocation, int, vtkCGNSReader::CELL_DATA, vtkCGNSReader::FACE_DATA);
67  vtkGetMacro(DataLocation, int);
69 
71 
74  vtkSetStdStringFromCharMacro(FileName);
75  vtkGetCharFromStdStringMacro(FileName);
77 
81  int CanReadFile(VTK_FILEPATH const char* filename);
82 
86  vtkDataArraySelection* GetBaseSelection();
87 
91  vtkDataArraySelection* GetFamilySelection();
92 
96  vtkGetMacro(CellDataArraySelection, vtkDataArraySelection*);
97 
101  vtkGetMacro(FaceDataArraySelection, vtkDataArraySelection*);
102 
106  vtkGetMacro(PointDataArraySelection, vtkDataArraySelection*);
107 
109 
115  int GetBaseArrayStatus(const char* name);
116  void SetBaseArrayStatus(const char* name, int status);
117  void DisableAllBases();
118  void EnableAllBases();
119  int GetNumberOfBaseArrays();
120  const char* GetBaseArrayName(int index);
122 
124 
128  int GetNumberOfFamilyArrays();
129  const char* GetFamilyArrayName(int index);
130  void SetFamilyArrayStatus(const char* name, int status);
131  int GetFamilyArrayStatus(const char* name);
132  void EnableAllFamilies();
133  void DisableAllFamilies();
135 
137 
141  int GetNumberOfPointArrays();
142  const char* GetPointArrayName(int index);
143  int GetPointArrayStatus(const char* name);
144  void SetPointArrayStatus(const char* name, int status);
145  void DisableAllPointArrays();
146  void EnableAllPointArrays();
148 
150 
154  int GetNumberOfCellArrays();
155  const char* GetCellArrayName(int index);
156  int GetCellArrayStatus(const char* name);
157  void SetCellArrayStatus(const char* name, int status);
158  void DisableAllCellArrays();
159  void EnableAllCellArrays();
161 
163 
167  int GetNumberOfFaceArrays();
168  const char* GetFaceArrayName(int index);
169  int GetFaceArrayStatus(const char* name);
170  void SetFaceArrayStatus(const char* name, int status);
171  void DisableAllFaceArrays();
172  void EnableAllFaceArrays();
174 
176 
180  vtkSetMacro(DoublePrecisionMesh, int);
181  vtkGetMacro(DoublePrecisionMesh, int);
182  vtkBooleanMacro(DoublePrecisionMesh, int);
184 
186 
190  vtkSetMacro(LoadBndPatch, bool);
191  vtkGetMacro(LoadBndPatch, bool);
192  vtkBooleanMacro(LoadBndPatch, bool);
194 
196 
200  vtkSetMacro(LoadSurfacePatch, bool);
201  vtkGetMacro(LoadSurfacePatch, bool);
202  vtkBooleanMacro(LoadSurfacePatch, bool);
204 
206 
210  vtkSetMacro(LoadMesh, bool);
211  vtkGetMacro(LoadMesh, bool);
212  vtkBooleanMacro(LoadMesh, bool);
214 
216 
220  vtkSetMacro(Use3DVector, bool);
221  vtkGetMacro(Use3DVector, bool);
222  vtkBooleanMacro(Use3DVector, bool);
224 
226 
232  vtkSetMacro(FlipFaceNormals, bool);
233  vtkGetMacro(FlipFaceNormals, bool);
234  vtkBooleanMacro(FlipFaceNormals, bool);
236 
238 
246  vtkSetMacro(CreateEachSolutionAsBlock, int);
247  vtkGetMacro(CreateEachSolutionAsBlock, int);
248  vtkBooleanMacro(CreateEachSolutionAsBlock, int);
250 
252 
265  vtkSetMacro(IgnoreFlowSolutionPointers, bool);
266  vtkGetMacro(IgnoreFlowSolutionPointers, bool);
267  vtkBooleanMacro(IgnoreFlowSolutionPointers, bool);
269 
271 
277  vtkSetMacro(UseUnsteadyPattern, bool);
278  vtkGetMacro(UseUnsteadyPattern, bool);
279  vtkBooleanMacro(UseUnsteadyPattern, bool);
281 
283 
288  vtkSetMacro(UnsteadySolutionStartTimestep, int);
289  vtkGetMacro(UnsteadySolutionStartTimestep, int);
291 
293 
298  vtkSetMacro(DistributeBlocks, bool);
299  vtkGetMacro(DistributeBlocks, bool);
300  vtkBooleanMacro(DistributeBlocks, bool);
302 
304 
310  void SetCacheMesh(bool enable);
311  vtkGetMacro(CacheMesh, bool);
312  vtkBooleanMacro(CacheMesh, bool);
314 
316 
322  void SetCacheConnectivity(bool enable);
323  vtkGetMacro(CacheConnectivity, bool);
324  vtkBooleanMacro(CacheConnectivity, bool);
326 
328 
333  void SetController(vtkMultiProcessController* c);
334  vtkGetObjectMacro(Controller, vtkMultiProcessController);
336 
341  void Broadcast(vtkMultiProcessController* ctrl);
342 
346  static vtkInformationStringKey* FAMILY();
347 
348 protected:
349  vtkCGNSReader();
350  ~vtkCGNSReader() override;
351 
355 
356  int GetCurvilinearZone(
357  int base, int zone, int cell_dim, int phys_dim, void* zsize, vtkMultiBlockDataSet* mbase);
358 
359  int GetUnstructuredZone(
360  int base, int zone, int cell_dim, int phys_dim, void* zsize, vtkMultiBlockDataSet* mbase);
361 
366  int ReadUserDefinedData(int zone, vtkMultiBlockDataSet* mbase);
367 
368  vtkMultiProcessController* Controller = nullptr;
369  vtkIdType ProcRank = 0;
370  vtkIdType ProcSize = 1;
371 
374 
378 
379 private:
380  vtkCGNSReader(const vtkCGNSReader&) = delete;
381  void operator=(const vtkCGNSReader&) = delete;
382 
383  std::string FileName;
384  int DataLocation = vtkCGNSReader::CELL_DATA;
385  bool LoadBndPatch = false;
386  bool LoadSurfacePatch = false;
387  bool LoadMesh = true;
388  int DoublePrecisionMesh = 1;
389  int CreateEachSolutionAsBlock = 0;
390  bool IgnoreFlowSolutionPointers = false;
391  bool UseUnsteadyPattern = false;
392  bool DistributeBlocks = true;
393  bool CacheMesh = false;
394  bool CacheConnectivity = false;
395  bool Use3DVector = true;
396  bool FlipFaceNormals = false;
397  int UnsteadySolutionStartTimestep = 0;
398 
399  // For internal cgio calls (low level IO)
400  int cgioNum; // cgio file reference
401  double rootId; // id of root node
402  double currentZoneId; // id of node currently being read (zone)
403 
404  unsigned int NumberOfBases = 0;
405  int ActualTimeStep = 0;
406 
407  class vtkPrivate;
408  vtkPrivate* Internals;
409  friend class vtkPrivate;
410 };
411 
412 VTK_ABI_NAMESPACE_END
413 #endif // vtkCGNSReader_h
vtkNew< vtkDataArraySelection > PointDataArraySelection
Store vtkAlgorithm input/output information.
vtkNew< vtkDataArraySelection > FaceDataArraySelection
int vtkIdType
Definition: vtkType.h:363
Superclass for algorithms that produce only vtkMultiBlockDataSet as output.
vtkNew< vtkDataArraySelection > BaseSelection
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
vtkNew< vtkDataArraySelection > FamilySelection
Key for string values in vtkInformation.
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
static vtkMultiBlockDataSetAlgorithm * New()
a simple class to control print indentation
Definition: vtkIndent.h:28
Store on/off settings for data arrays, etc.
This file defines functions used by vtkCGNSReader and vtkCGNSReaderInternal.
Definition: cgio_helpers.h:18
vtkCGNSReader creates a multi-block dataset and reads unstructured grids and structured meshes from b...
Definition: vtkCGNSReader.h:42
vtkNew< vtkDataArraySelection > CellDataArraySelection
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
#define VTK_FILEPATH
Composite dataset that organizes datasets into blocks.
Store zero or more vtkInformation instances.
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
Multiprocessing communication superclass.