VTK  9.0.2
vtkPDistributedDataFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPDistributedDataFilter.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, 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 /*----------------------------------------------------------------------------
16  Copyright (c) Sandia Corporation
17  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
18 ----------------------------------------------------------------------------*/
19 
89 #ifndef vtkPDistributedDataFilter_h
90 #define vtkPDistributedDataFilter_h
91 
93 #include "vtkFiltersParallelGeometryModule.h" // For export macro
94 
95 class vtkBSPCuts;
96 class vtkDataArray;
97 class vtkFloatArray;
98 class vtkIdList;
99 class vtkIdTypeArray;
100 class vtkIntArray;
102 class vtkPDistributedDataFilterSTLCloak;
103 class vtkPKdTree;
104 class vtkUnstructuredGrid;
105 
106 class VTKFILTERSPARALLELGEOMETRY_EXPORT vtkPDistributedDataFilter : public vtkDistributedDataFilter
107 {
108 public:
110  void PrintSelf(ostream& os, vtkIndent indent) override;
111 
113 
114 protected:
117 
126 
131 
132 private:
133  enum
134  {
135  DeleteNo = 0,
136  DeleteYes = 1
137  };
138 
139  enum
140  {
141  DuplicateCellsNo = 0,
142  DuplicateCellsYes = 1
143  };
144 
145  enum
146  {
147  GhostCellsNo = 0,
148  GhostCellsYes = 1
149  };
150 
151  enum
152  {
153  UnsetGhostLevel = 99
154  };
155 
159  int PartitionDataAndAssignToProcesses(vtkDataSet* set);
160 
164  vtkUnstructuredGrid* RedistributeDataSet(
165  vtkDataSet* set, vtkDataSet* input, int filterOutDuplicateCells);
166 
170  int ClipGridCells(vtkUnstructuredGrid* grid);
171 
175  vtkUnstructuredGrid* AcquireGhostCells(vtkUnstructuredGrid* grid);
176 
180  void ComputeMyRegionBounds();
181 
185  int CheckFieldArrayTypes(vtkDataSet* set);
186 
192  vtkDataSet* TestFixTooFewInputFiles(vtkDataSet* input, int& duplicateCells);
193 
197  vtkUnstructuredGrid* MPIRedistribute(
198  vtkDataSet* in, vtkDataSet* input, int filterOutDuplicateCells);
199 
203  vtkIdList** GetCellIdsForProcess(int proc, int* nlists);
204 
209  void SetUpPairWiseExchange();
210 
212 
215  void FreeIntArrays(vtkIdTypeArray** ar);
216  static void FreeIdLists(vtkIdList** lists, int nlists);
217  static vtkIdType GetIdListSize(vtkIdList** lists, int nlists);
219 
221 
224  vtkIdTypeArray* ExchangeCounts(vtkIdType myCount, int tag);
225  vtkIdTypeArray* ExchangeCountsLean(vtkIdType myCount, int tag);
226  vtkIdTypeArray* ExchangeCountsFast(vtkIdType myCount, int tag);
228 
230 
233  vtkIdTypeArray** ExchangeIdArrays(vtkIdTypeArray** arIn, int deleteSendArrays, int tag);
234  vtkIdTypeArray** ExchangeIdArraysLean(vtkIdTypeArray** arIn, int deleteSendArrays, int tag);
235  vtkIdTypeArray** ExchangeIdArraysFast(vtkIdTypeArray** arIn, int deleteSendArrays, int tag);
237 
239 
242  vtkFloatArray** ExchangeFloatArrays(vtkFloatArray** myArray, int deleteSendArrays, int tag);
243  vtkFloatArray** ExchangeFloatArraysLean(vtkFloatArray** myArray, int deleteSendArrays, int tag);
244  vtkFloatArray** ExchangeFloatArraysFast(vtkFloatArray** myArray, int deleteSendArrays, int tag);
246 
248 
251  vtkUnstructuredGrid* ExchangeMergeSubGrids(vtkIdList** cellIds, int deleteCellIds,
252  vtkDataSet* myGrid, int deleteMyGrid, int filterOutDuplicateCells, int ghostCellFlag, int tag);
253  vtkUnstructuredGrid* ExchangeMergeSubGrids(vtkIdList*** cellIds, int* numLists, int deleteCellIds,
254  vtkDataSet* myGrid, int deleteMyGrid, int filterOutDuplicateCells, int ghostCellFlag, int tag);
255  vtkUnstructuredGrid* ExchangeMergeSubGridsLean(vtkIdList*** cellIds, int* numLists,
256  int deleteCellIds, vtkDataSet* myGrid, int deleteMyGrid, int filterOutDuplicateCells,
257  int ghostCellFlag, int tag);
258  vtkUnstructuredGrid* ExchangeMergeSubGridsFast(vtkIdList*** cellIds, int* numLists,
259  int deleteCellIds, vtkDataSet* myGrid, int deleteMyGrid, int filterOutDuplicateCells,
260  int ghostCellFlag, int tag);
262 
264 
267  char* MarshallDataSet(vtkUnstructuredGrid* extractedGrid, vtkIdType& size);
268  vtkUnstructuredGrid* UnMarshallDataSet(char* buf, vtkIdType size);
270 
272 
275  void ClipCellsToSpatialRegion(vtkUnstructuredGrid* grid);
276 #if 0
277  void ClipWithVtkClipDataSet(vtkUnstructuredGrid *grid, double *bounds,
278  vtkUnstructuredGrid **outside, vtkUnstructuredGrid **inside);
279 #endif
281 
282  void ClipWithBoxClipDataSet(vtkUnstructuredGrid* grid, double* bounds,
283  vtkUnstructuredGrid** outside, vtkUnstructuredGrid** inside);
284 
286 
292  vtkIdTypeArray* GetGlobalNodeIdArray(vtkDataSet* set);
293  vtkIdType* GetGlobalNodeIds(vtkDataSet* set);
294  vtkIdTypeArray* GetGlobalElementIdArray(vtkDataSet* set);
295  vtkIdType* GetGlobalElementIds(vtkDataSet* set);
296  int AssignGlobalNodeIds(vtkUnstructuredGrid* grid);
297  int AssignGlobalElementIds(vtkDataSet* in);
298  vtkIdTypeArray** FindGlobalPointIds(vtkFloatArray** ptarray, vtkIdTypeArray* ids,
299  vtkUnstructuredGrid* grid, vtkIdType& numUniqueMissingPoints);
301 
305  vtkIdTypeArray** MakeProcessLists(
306  vtkIdTypeArray** pointIds, vtkPDistributedDataFilterSTLCloak* procs);
307 
311  vtkIdList** BuildRequestedGrids(vtkIdTypeArray** globalPtIds, vtkUnstructuredGrid* grid,
312  vtkPDistributedDataFilterSTLCloak* ptIdMap);
313 
315 
318  int InMySpatialRegion(float x, float y, float z);
319  int InMySpatialRegion(double x, double y, double z);
320  int StrictlyInsideMyBounds(float x, float y, float z);
321  int StrictlyInsideMyBounds(double x, double y, double z);
323 
325 
328  vtkIdTypeArray** GetGhostPointIds(
329  int ghostLevel, vtkUnstructuredGrid* grid, int AddCellsIAlreadyHave);
330  vtkUnstructuredGrid* AddGhostCellsUniqueCellAssignment(
331  vtkUnstructuredGrid* myGrid, vtkPDistributedDataFilterSTLCloak* globalToLocalMap);
332  vtkUnstructuredGrid* AddGhostCellsDuplicateCellAssignment(
333  vtkUnstructuredGrid* myGrid, vtkPDistributedDataFilterSTLCloak* globalToLocalMap);
334  vtkUnstructuredGrid* SetMergeGhostGrid(vtkUnstructuredGrid* ghostCellGrid,
335  vtkUnstructuredGrid* incomingGhostCells, int ghostLevel,
336  vtkPDistributedDataFilterSTLCloak* idMap);
338 
340 
343  vtkUnstructuredGrid* ExtractCells(vtkIdList* list, int deleteCellLists, vtkDataSet* in);
344  vtkUnstructuredGrid* ExtractCells(
345  vtkIdList** lists, int nlists, int deleteCellLists, vtkDataSet* in);
346  vtkUnstructuredGrid* ExtractZeroCellGrid(vtkDataSet* in);
348 
350 
353  static int GlobalPointIdIsUsed(
354  vtkUnstructuredGrid* grid, int ptId, vtkPDistributedDataFilterSTLCloak* globalToLocal);
355  static int LocalPointIdIsUsed(vtkUnstructuredGrid* grid, int ptId);
356  static vtkIdType FindId(vtkIdTypeArray* ids, vtkIdType gid, vtkIdType startLoc);
358 
362  static vtkIdTypeArray* AddPointAndCells(vtkIdType gid, vtkIdType localId,
363  vtkUnstructuredGrid* grid, vtkIdType* gidCells, vtkIdTypeArray* ids);
364 
366 
369  static void AddConstantUnsignedCharPointArray(
370  vtkUnstructuredGrid* grid, const char* arrayName, unsigned char val);
371  static void AddConstantUnsignedCharCellArray(
372  vtkUnstructuredGrid* grid, const char* arrayName, unsigned char val);
374 
378  static void RemoveRemoteCellsFromList(
379  vtkIdList* cellList, vtkIdType* gidCells, vtkIdType* remoteCells, vtkIdType nRemoteCells);
380 
384  static vtkUnstructuredGrid* MergeGrids(vtkDataSet** sets, int nsets, int deleteDataSets,
385  int useGlobalNodeIds, float pointMergeTolerance, int useGlobalCellIds);
386 
387 private:
389  void operator=(const vtkPDistributedDataFilter&) = delete;
390 };
391 #endif
This class represents an axis-aligned Binary Spatial Partitioning of a 3D space.
Definition: vtkBSPCuts.h:45
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:50
abstract class to specify dataset behavior
Definition: vtkDataSet.h:57
Serial stand-in for parallel filter that distributes data among processors.
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:36
list of point or cell ids
Definition: vtkIdList.h:31
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition: vtkIndent.h:34
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:40
Multiprocessing communication superclass.
Distribute data among processors.
void SingleProcessExecute(vtkDataSet *input, vtkUnstructuredGrid *output)
int RequestDataInternal(vtkDataSet *input, vtkUnstructuredGrid *output)
Implementation for request data.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Build a vtkUnstructuredGrid for a spatial region from the data distributed across processes.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkPDistributedDataFilter * New()
~vtkPDistributedDataFilter() override
Build a k-d tree decomposition of a list of points.
Definition: vtkPKdTree.h:58
dataset represents arbitrary combinations of all possible cell types
@ size
Definition: vtkX3D.h:259
int vtkIdType
Definition: vtkType.h:338