vtkRectilinearGridConnectivity.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
3 // SPDX-License-Identifier: BSD-3-Clause
65 #ifndef vtkRectilinearGridConnectivity_h
66 #define vtkRectilinearGridConnectivity_h
67 
69 #include "vtkPVVTKExtensionsFiltersGeneralModule.h" //needed for exports
70 
71 class vtkPolyData;
72 class vtkDoubleArray;
73 class vtkInformation;
74 class vtkEquivalenceSet;
75 class vtkRectilinearGrid;
79 class vtkRectilinearGridConnectivityFaceHash;
80 class vtkRectilinearGridConnectivityInternal;
81 
84 {
85 public:
88  void PrintSelf(ostream& os, vtkIndent indent) override;
89 
91 
94  vtkSetClampMacro(VolumeFractionSurfaceValue, double, 0.0, 1.0);
95  vtkGetMacro(VolumeFractionSurfaceValue, double);
97 
101  void RemoveAllVolumeArrayNames();
102 
106  void RemoveDoubleVolumeArrayNames();
107 
111  void RemoveFloatVolumeArrayNames();
112 
116  void RemoveUnsignedCharVolumeArrayNames();
117 
121  void AddDoubleVolumeArrayName(char* arayName);
122 
126  void AddFloatVolumeArrayName(char* arayName);
127 
131  void AddUnsignedCharVolumeArrayName(char* arayName);
132 
136  void AddVolumeArrayName(char* arayName);
137 
138 protected:
140  ~vtkRectilinearGridConnectivity() override;
141 
145  double DualGridBounds[6];
151  vtkRectilinearGridConnectivityFaceHash* FaceHash;
152  vtkRectilinearGridConnectivityInternal* Internal;
153 
155  int FillInputPortInformation(int, vtkInformation*) override;
156  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
157  vtkInformationVector* outputVector) override;
158 
159  // ---------------------------------------------------------------------- //
160  // --------------------------- Volume arrays --------------------------- //
161  // ---------------------------------------------------------------------- //
162 
166  int GetNumberOfVolumeFractionArrays();
167 
172  int GetNumberOfVolumeArrays();
173 
177  const char* GetVolumeFractionArrayName(int arrayIdx);
178 
183  bool IsVolumeFractionArray(const char* arayName);
184 
190  bool IsVolumeArray(const char* arayName);
191 
200  int CheckVolumeDataArrays(vtkRectilinearGrid** recGrids, int numGrids);
201 
202  // ---------------------------------------------------------------------- //
203  // ----------- Dual grids generation and fragments extraction ----------- //
204  // ---------------------------------------------------------------------- //
205 
211  void CreateDualRectilinearGrid(vtkRectilinearGrid* rectGrid, vtkRectilinearGrid* dualGrid);
212 
221  void ExtractFragments(vtkRectilinearGrid** dualGrds, int numBlcks, double boundBox[6],
222  unsigned char partIndx, vtkPolyData* polyData);
223 
224  // ---------------------------------------------------------------------- //
225  // ------------- Common functions for fragments extraction ------------- //
226  // ---------------------------------------------------------------------- //
227 
240  void IntegrateFragmentAttributes(int fragIndx, int numComps, double* attrVals);
241 
247  void ResolveEquivalentFragments();
248 
258  void ResolveFaceFragmentIds();
259 
268  void ResolveIntegratedFragmentAttributes();
269 
270  // ---------------------------------------------------------------------- //
271  // ----------- Intra-process intra-block fragments extraction ----------- //
272  // ---------------------------------------------------------------------- //
273 
274  // Descrption:
275  // Give a vtkRectilinearGrid data block (rectGrid, the dual version of an
276  // original input block) with point data attributes (including some volume
277  // fraction arrays and others like pressure, density, or velocity vector),
278  // the name of a selected volume fraction array (fracName, through which to
279  // extract fragments), and a specified volume fraction iso-value (isoValue),
280  // this function performs the marching-cubes algorithm based on the volume
281  // fraction array and the iso-value to produce greater-than-isovalue sub-
282  // volumes (or polyhedra) by employing an extended 256-entry lookup table.
283  // These resulting polyhedra are stored in the output vtkPolyData (plyHedra).
284  // All point data attributes except for non-selected volume fraction arrays
285  // are integrated when marching cubes. The integrated attribute arrays are
286  // attached to the polyhedra's faces as the cell data.
287  void ExtractFragmentPolyhedra(
288  vtkRectilinearGrid* rectGrid, const char* fracName, double isoValue, vtkPolyData* plyHedra);
289 
296  void InitializeFaceHash(vtkPolyData* plyHedra);
297 
308  void AddPolygonsToFaceHash(int blockIdx, vtkPolyData* plyHedra);
309 
332  void ExtractFragmentPolygons(int blockIdx, int& maxFsize, vtkPolyData* plyHedra,
333  vtkPolyData* polygons, vtkIncrementalOctreePointLocator* gPtIdGen);
334 
335  // ---------------------------------------------------------------------- //
336  // ----------- Intra-process inter-block fragments extraction ----------- //
337  // ---------------------------------------------------------------------- //
338 
346  void InitializeFaceHash(vtkPolyData** plyDatas, int numPolys);
347 
362  void AddPolygonsToFaceHash(vtkPolyData** plyDatas, int* maxFsize, int numPolys);
363 
377  void GenerateOutputFromSingleProcess(
378  vtkPolyData** surfaces, int numSurfs, unsigned char partIndx, vtkPolyData* polyData);
379 
380  // ---------------------------------------------------------------------- //
381  // ----------------- Inter-process fragments extraction ----------------- //
382  // ---------------------------------------------------------------------- //
383 
396  void CreateInterProcessPolygons(vtkPolyData* fragPoly, vtkPolyData* procPoly,
397  vtkIncrementalOctreePointLocator* gPtIdGen, int& maxFsize);
398 
415  void AddInterProcessPolygonsToFaceHash(vtkPolyData** procPlys, int* maxFsize, int numProcs);
416 
431  void GenerateOutputFromMultiProcesses(
432  vtkPolyData** procPlys, int numProcs, unsigned char partIndx, vtkPolyData* polyData);
433 
434 private:
436  void operator=(const vtkRectilinearGridConnectivity&) = delete;
437 };
438 
439 #endif
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
static vtkMultiBlockDataSetAlgorithm * New()
vtkRectilinearGridConnectivityInternal * Internal
#define VTKPVVTKEXTENSIONSFILTERSGENERAL_EXPORT
virtual int FillInputPortInformation(int port, vtkInformation *info)
Extracts material fragments from multi-block vtkRectilinearGrid datasets based on the selected volume...
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
vtkRectilinearGridConnectivityFaceHash * FaceHash
void operator=(const vtkObjectBase &)
records groups of integers that are equivalent.
virtual vtkExecutive * CreateDefaultExecutive()