1 /*=========================================================================
3 Program: Visualization Toolkit
4 Module: vtkStaticPUnstructuredGridGhostCellsGenerator.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 * @class vtkStaticPUnstructuredGridGhostCellsGenerator
17 * @brief StaticMesh aware GhostCellGenerator implementation
19 * This class specialize vtkPUnstructuredGridGhostCellGenerator
20 * This class improves it by making it static mesh aware.
21 * The first time this filter is executed it will store its output
22 * in a cache as well as a list of ghost and point ids to request from other rank
23 * On next execution, if the mesh is static, it will uses the list of ids to request
24 * only point and cell data for the ghost point and cell from other
25 * allowing to update the output without needing to recompute everything
28 * vtkPUnstructuredGridGhostCellsGenerator
31 #ifndef vtkStaticPUnstructuredGridGhostCellsGenerator_h
32 #define vtkStaticPUnstructuredGridGhostCellsGenerator_h
35 #include <vtkPUnstructuredGridGhostCellsGenerator.h>
39 #include "StaticMeshModuleModule.h"
42 class vtkUnstructuredGrid;
44 class STATICMESHMODULE_EXPORT vtkStaticPUnstructuredGridGhostCellsGenerator
45 : public vtkPUnstructuredGridGhostCellsGenerator
48 static vtkStaticPUnstructuredGridGhostCellsGenerator* New();
49 typedef vtkPUnstructuredGridGhostCellsGenerator
50 Superclass; // vtkTypeMacro can't be used with a factory built object
51 void PrintSelf(ostream& os, vtkIndent indent) override;
53 int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
56 vtkStaticPUnstructuredGridGhostCellsGenerator();
57 ~vtkStaticPUnstructuredGridGhostCellsGenerator() override = default;
60 * Check input for "ProcessId" and "Ids" point and cell array,
61 * If absent, compute and add them.
63 static void AddIdsArrays(vtkDataSet* input, vtkDataSet* output);
66 * Using the Cache, exchange and update ghost point and cell
69 virtual void ProcessGhostIds();
72 * Update cache with input and with ghost cells info
74 virtual void UpdateCacheData(vtkDataSet* input);
77 * Copy input point, cell and field data into cache
79 virtual void UpdateCacheDataWithInput(vtkDataSet* input);
82 * Using Cached ghost cell and points info
83 * Update ghost cell and point data in cache
84 * by sending input point and cell data to other ranks
86 virtual void UpdateCacheGhostCellAndPointData(vtkDataSet* input);
89 vtkStaticPUnstructuredGridGhostCellsGenerator(
90 const vtkStaticPUnstructuredGridGhostCellsGenerator&) = delete;
91 void operator=(const vtkStaticPUnstructuredGridGhostCellsGenerator&) = delete;
93 vtkNew<vtkUnstructuredGrid> Cache;
94 vtkMTimeType InputMeshTime = 0;
95 vtkMTimeType FilterMTime = 0;
97 std::vector<vtkNew<vtkIdList> > GhostCellsToReceive;
98 std::vector<vtkNew<vtkIdList> > GhostCellsToSend;
99 std::vector<vtkNew<vtkIdList> > GhostPointsToReceive;
100 std::vector<vtkNew<vtkIdList> > GhostPointsToSend;