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 "vtkCGNSCache.h" // for vtkCGNSCache, caching of mesh and connectivity
40 #include "vtkNew.h" // for vtkNew.
41 #include "vtkPVVTKExtensionsCGNSReaderModule.h" // for export macro
42 
43 class vtkDataSet;
45 class vtkCGNSSubsetInclusionLattice;
46 class vtkPoints;
49 
50 namespace CGNSRead
51 {
52 class vtkCGNSMetaData;
53 }
54 
57 {
58 public:
59  static vtkCGNSReader* New();
61  void PrintSelf(ostream& os, vtkIndent indent) override;
62 
64 
67  vtkSetStringMacro(FileName);
68  vtkGetStringMacro(FileName);
70 
74  int CanReadFile(const char* filename);
75 
79  vtkDataArraySelection* GetBaseSelection();
80 
84  vtkDataArraySelection* GetFamilySelection();
85 
87 
93  int GetBaseArrayStatus(const char* name);
94  void SetBaseArrayStatus(const char* name, int status);
95  void DisableAllBases();
96  void EnableAllBases();
97  int GetNumberOfBaseArrays();
98  const char* GetBaseArrayName(int index);
100 
102 
106  int GetNumberOfFamilyArrays();
107  const char* GetFamilyArrayName(int index);
108  void SetFamilyArrayStatus(const char* name, int status);
109  int GetFamilyArrayStatus(const char* name);
110  void EnableAllFamilies();
111  void DisableAllFamilies();
113 
115 
119  int GetNumberOfPointArrays();
120  const char* GetPointArrayName(int index);
121  int GetPointArrayStatus(const char* name);
122  void SetPointArrayStatus(const char* name, int status);
123  void DisableAllPointArrays();
124  void EnableAllPointArrays();
126 
128 
132  int GetNumberOfCellArrays();
133  const char* GetCellArrayName(int index);
134  int GetCellArrayStatus(const char* name);
135  void SetCellArrayStatus(const char* name, int status);
136  void DisableAllCellArrays();
137  void EnableAllCellArrays();
139 
140  vtkSetMacro(DoublePrecisionMesh, int);
141  vtkGetMacro(DoublePrecisionMesh, int);
142  vtkBooleanMacro(DoublePrecisionMesh, int);
143 
145 
149  vtkSetMacro(LoadBndPatch, bool);
150  vtkGetMacro(LoadBndPatch, bool);
151  vtkBooleanMacro(LoadBndPatch, bool);
153 
155 
159  vtkSetMacro(LoadMesh, bool);
160  vtkGetMacro(LoadMesh, bool);
161  vtkBooleanMacro(LoadMesh, bool);
163 
171  vtkSetMacro(CreateEachSolutionAsBlock, int);
172  vtkGetMacro(CreateEachSolutionAsBlock, int);
173  vtkBooleanMacro(CreateEachSolutionAsBlock, int);
174 
188  vtkSetMacro(IgnoreFlowSolutionPointers, bool);
189  vtkGetMacro(IgnoreFlowSolutionPointers, bool);
190  vtkBooleanMacro(IgnoreFlowSolutionPointers, bool);
191 
198  vtkSetMacro(UseUnsteadyPattern, bool);
199  vtkGetMacro(UseUnsteadyPattern, bool);
200  vtkBooleanMacro(UseUnsteadyPattern, bool);
201 
207  vtkSetMacro(DistributeBlocks, bool);
208  vtkGetMacro(DistributeBlocks, bool);
209  vtkBooleanMacro(DistributeBlocks, bool);
210 
212 
217  void SetCacheMesh(bool enable);
218  vtkGetMacro(CacheMesh, bool);
219  vtkBooleanMacro(CacheMesh, bool);
220 
222 
227  void SetCacheConnectivity(bool enable);
228  vtkGetMacro(CacheConnectivity, bool);
229  vtkBooleanMacro(CacheConnectivity, bool);
230 
232 
237  void SetController(vtkMultiProcessController* c);
238  vtkGetObjectMacro(Controller, vtkMultiProcessController);
240 
245  void Broadcast(vtkMultiProcessController* ctrl);
246 
250  static vtkInformationStringKey* FAMILY();
251 
252 protected:
253  vtkCGNSReader();
254  ~vtkCGNSReader() override;
255 
256  int FillOutputPortInformation(int port, vtkInformation* info) override;
257  int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
258  int RequestInformation(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
259 
262 
265 
266  int GetCurvilinearZone(
267  int base, int zone, int cell_dim, int phys_dim, void* zsize, vtkMultiBlockDataSet* mbase);
268 
269  int GetUnstructuredZone(
270  int base, int zone, int cell_dim, int phys_dim, void* zsize, vtkMultiBlockDataSet* mbase);
274 
275 private:
276  vtkCGNSReader(const vtkCGNSReader&) = delete;
277  void operator=(const vtkCGNSReader&) = delete;
278 
279  CGNSRead::vtkCGNSMetaData* Internal; // Metadata
280  CGNSRead::vtkCGNSCache<vtkPoints> MeshPointsCache; // Cache for the mesh points
282  ConnectivitiesCache; // Cache for the mesh connectivities
283 
284  char* FileName; // cgns file name
285  bool LoadBndPatch; // option to set section loading for unstructured grid
286  bool LoadMesh; // option to enable/disable mesh loading
287  int DoublePrecisionMesh; // option to set mesh loading to double precision
288  int CreateEachSolutionAsBlock; // debug option to create
289  bool IgnoreFlowSolutionPointers;
290  bool UseUnsteadyPattern;
291  bool DistributeBlocks;
292  bool CacheMesh;
293  bool CacheConnectivity;
294 
295  // For internal cgio calls (low level IO)
296  int cgioNum; // cgio file reference
297  double rootId; // id of root node
298  double currentId; // id of node currently being read (zone)
299  //
300  unsigned int NumberOfBases;
301  int ActualTimeStep;
302 
303  class vtkPrivate;
304  friend class vtkPrivate;
305 };
306 
307 #endif // vtkCGNSReader_h
vtkNew< vtkDataArraySelection > PointDataArraySelection
vtkIdType ProcSize
#define VTKPVVTKEXTENSIONSCGNSREADER_EXPORT
int vtkIdType
vtkIdType ProcRank
vtkNew< vtkDataArraySelection > BaseSelection
vtkNew< vtkDataArraySelection > FamilySelection
vtkCGNSReader creates a multi-block dataset and reads unstructured grids, and structured meshes from ...
Definition: vtkCGNSReader.h:56
vtkNew< vtkDataArraySelection > CellDataArraySelection
vtkMultiProcessController * Controller