1 /*=========================================================================
3 Program: Visualization Toolkit
4 Module: vtkPVUnstructuredGridGhostCellsGenerator.h
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
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.
14 =========================================================================*/
16 // .NAME vtkPVUnstructuredGridGhostCellsGenerator - Builds ghost cells for a
17 // distributed unstructured grid dataset.
19 // .SECTION Description
20 // This filter generate ghost cells for distributed a unstructured grid in
21 // parallel - using MPI asynchronous communcations.
22 // The filter can take benefit of the input grid point global ids to perform.
26 // <li> A step of 'all reduce' (each processor send/receive data to/from
27 // all other processors.
28 // <li> The code currently assumes one grid per rank. </li>
29 // <li> PointData and CellData must match across partitions/processes. </li>
33 // vtkDistributedDataFilter vtkPUnstructuredGridGhostDataGenerator
36 // This filter has been developed by Joachim Pouderoux, Kitware SAS 2015.
38 #ifndef vtkPVUnstructuredGridGhostCellsGenerator_h
39 #define vtkPVUnstructuredGridGhostCellsGenerator_h
41 #include "vtkUnstructuredGridAlgorithm.h"
43 class vtkMultiProcessController;
44 class vtkUnstructuredGrid;
46 class vtkPVUnstructuredGridGhostCellsGenerator:
47 public vtkUnstructuredGridAlgorithm
49 vtkTypeMacro(vtkPVUnstructuredGridGhostCellsGenerator, vtkUnstructuredGridAlgorithm);
52 void PrintSelf(ostream& os, vtkIndent indent);
54 static vtkPVUnstructuredGridGhostCellsGenerator *New();
57 // Set/Get the MPI multi process controller object.
58 void SetController(vtkMultiProcessController *c);
59 vtkGetObjectMacro(Controller, vtkMultiProcessController);
62 // Specify if the filter must take benefit of global point ids if they exist.
63 // If false, point coordinates are used. Default is TRUE.
64 vtkSetMacro(UseGlobalPointIds, bool);
65 vtkGetMacro(UseGlobalPointIds, bool);
66 vtkBooleanMacro(UseGlobalPointIds, bool);
69 // Specify the name of the global point ids data array if the GlobalIds
70 // attribute array is not set. Default is "GlobalNodeIds".
71 vtkSetStringMacro(GlobalPointIdsArrayName);
72 vtkGetStringMacro(GlobalPointIdsArrayName);
75 vtkPVUnstructuredGridGhostCellsGenerator();
76 ~vtkPVUnstructuredGridGhostCellsGenerator();
78 virtual int RequestData(vtkInformation *, vtkInformationVector **,
79 vtkInformationVector *);
81 vtkMultiProcessController *Controller;
82 char* GlobalPointIdsArrayName;
83 bool UseGlobalPointIds;
87 vtkPVUnstructuredGridGhostCellsGenerator(const vtkPVUnstructuredGridGhostCellsGenerator&); // Not implemented
88 void operator=(const vtkPVUnstructuredGridGhostCellsGenerator&); // Not implemented