1 /*=========================================================================
2 
3  Program:   Visualization Toolkit
4  Module:    vtkStructuredGridGhostDataGenerator.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  * @class   vtkStructuredGridGhostDataGenerator
17  *
18  *
19  *  A concrete implementation of vtkDataSetGhostGenerator for generating ghost
20  *  data on partitioned structured grids on a singled process. For a distributed
21  *  data-set see vtkPStructuredGridGhostDataGenerator.
22  *
23  * @warning
24  * <ol>
25  *   <li>
26  *    The input multi-block dataset must:
27  *    <ul>
28  *      <li> Have the whole-extent set </li>
29  *      <li> Each block must be an instance of vtkStructuredGrid </li>
30  *      <li> Each block must have its corresponding global extent set in the
31  *           meta-data using the PIECE_EXTENT() key </li>
32  *      <li> All blocks must have the same fields loaded </li>
33  *    </ul>
34  *   </li>
35  *   <li>
36  *    The code currently does not handle the following cases:
37  *    <ul>
38  *      <li>Ghost cells along Periodic boundaries</li>
39  *      <li>Growing ghost layers beyond the extents of the neighboring grid</li>
40  *    </ul>
41  *   </li>
42  * </ol>
43  *
44  * @sa
45  * vtkDataSetGhostGenerator, vtkPStructuredGridGhostDataGenerator
46 */
47 
48 #ifndef vtkStructuredGridGhostDataGenerator_h
49 #define vtkStructuredGridGhostDataGenerator_h
50 
51 #include "vtkFiltersGeometryModule.h" // For export macro
52 #include "vtkDataSetGhostGenerator.h"
53 
54 // Forward declarations
55 class vtkMultiBlockDataSet;
56 class vtkIndent;
57 class vtkStructuredGridConnectivity;
58 
59 class VTKFILTERSGEOMETRY_EXPORT vtkStructuredGridGhostDataGenerator :
60   public vtkDataSetGhostGenerator
61 {
62 public:
63   static vtkStructuredGridGhostDataGenerator* New();
64   vtkTypeMacro(vtkStructuredGridGhostDataGenerator,vtkDataSetGhostGenerator);
65   void PrintSelf(ostream &os, vtkIndent indent) override;
66 
67 protected:
68   vtkStructuredGridGhostDataGenerator();
69   ~vtkStructuredGridGhostDataGenerator() override;
70 
71   /**
72    * Registers the grid associated with this instance of multi-block.
73    */
74   void RegisterGrids(vtkMultiBlockDataSet *in);
75 
76   /**
77    * Creates the output.
78    */
79   void CreateGhostedDataSet(
80       vtkMultiBlockDataSet *in,
81       vtkMultiBlockDataSet *out );
82 
83   /**
84    * Generates ghost layers.
85    */
86   void GenerateGhostLayers(
87       vtkMultiBlockDataSet *in, vtkMultiBlockDataSet *out) override;
88 
89   vtkStructuredGridConnectivity *GridConnectivity;
90 private:
91   vtkStructuredGridGhostDataGenerator(const vtkStructuredGridGhostDataGenerator&) = delete;
92   void operator=(const vtkStructuredGridGhostDataGenerator&) = delete;
93 };
94 
95 #endif /* vtkStructuredGridGhostDataGenerator_h */
96