vtkAMRDualContour.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
22 #ifndef vtkAMRDualContour_h
23 #define vtkAMRDualContour_h
24 
26 #include "vtkPVVTKExtensionsAMRModule.h" //needed for exports
27 
28 class vtkDataSet;
29 class vtkImageData;
30 class vtkPolyData;
32 class vtkPoints;
33 class vtkDoubleArray;
34 class vtkCellArray;
35 class vtkCellData;
36 class vtkIntArray;
37 class vtkFloatArray;
40 class vtkCallbackCommand;
41 
45 class vtkAMRDualContourEdgeLocator;
46 
48 {
49 public:
50  static vtkAMRDualContour* New();
52  void PrintSelf(ostream& os, vtkIndent indent) override;
53 
54  vtkSetMacro(IsoValue, double);
55  vtkGetMacro(IsoValue, double);
56 
58 
63  vtkSetMacro(EnableCapping, int);
64  vtkGetMacro(EnableCapping, int);
65  vtkBooleanMacro(EnableCapping, int);
66  vtkSetMacro(EnableDegenerateCells, int);
67  vtkGetMacro(EnableDegenerateCells, int);
68  vtkBooleanMacro(EnableDegenerateCells, int);
69  vtkSetMacro(EnableMultiProcessCommunication, int);
70  vtkGetMacro(EnableMultiProcessCommunication, int);
71  vtkBooleanMacro(EnableMultiProcessCommunication, int);
73 
75 
80  vtkSetMacro(EnableMergePoints, int);
81  vtkGetMacro(EnableMergePoints, int);
82  vtkBooleanMacro(EnableMergePoints, int);
84 
86 
89  vtkSetMacro(TriangulateCap, int);
90  vtkGetMacro(TriangulateCap, int);
91  vtkBooleanMacro(TriangulateCap, int);
93 
95 
101  vtkSetMacro(SkipGhostCopy, int);
102  vtkGetMacro(SkipGhostCopy, int);
103  vtkBooleanMacro(SkipGhostCopy, int);
105 
106  vtkGetObjectMacro(Controller, vtkMultiProcessController);
107  virtual void SetController(vtkMultiProcessController*);
108 
109 protected:
111  ~vtkAMRDualContour() override;
112 
113  double IsoValue;
114 
115  // Algorithm options that may improve performance.
122 
124 
128  void InitializeRequest(vtkNonOverlappingAMR* input);
129 
133  void FinalizeRequest();
134 
139  vtkMultiBlockDataSet* DoRequestData(vtkNonOverlappingAMR* input, const char* arrayNameToProcess);
140 
141  int FillInputPortInformation(int port, vtkInformation* info) override;
142  int FillOutputPortInformation(int port, vtkInformation* info) override;
143 
144  void ShareBlockLocatorWithNeighbors(vtkAMRDualGridHelperBlock* block);
145 
146  void ProcessBlock(vtkAMRDualGridHelperBlock* block, int blockId, const char* arrayName);
147 
148  void ProcessDualCell(vtkAMRDualGridHelperBlock* block, int blockId, int x, int y, int z,
149  vtkIdType cornerOffsets[8], vtkDataArray* volumeFractionArray);
150 
151  void AddCapPolygon(int ptCount, vtkIdType* pointIds, int blockId);
152 
153  // This method is getting too many arguments!
154  // Capping was an after thought...
155  void CapCell(
156  // block coordinates
157  int cellX, int cellY, int cellZ,
158  // Which cell faces need to be capped.
159  unsigned char cubeBoundaryBits,
160  // Marching cubes case for this cell
161  int cubeCase,
162  // Ids of the point created on edges for the internal surface
163  vtkIdType edgePtIds[12],
164  // Locations of 8 corners. (xyz4xyz4...) 4th value is not used.
165  double cornerPoints[32],
166  // The id order is VTK from marching cube cases. Different than axis ordered "cornerPoints".
167  vtkIdType cornerOffsets[8],
168  // For block id array (for debugging). I should just make this an ivar.
169  int blockId,
170  // For passing attributes to output mesh
171  vtkDataSet* inData);
172 
173  // Stuff exclusively for debugging.
176 
177  // Ivars used to reduce method parrameters.
182 
184 
185  // I made these ivars to avoid allocating multiple times.
186  // The buffer is not used too many times, but ...
189 
190  vtkAMRDualContourEdgeLocator* BlockLocator;
191 
192  // Stuff for passing cell attributes to point attributes.
193  void InitializeCopyAttributes(vtkNonOverlappingAMR* hbdsInput, vtkDataSet* mesh);
194  void InterpolateAttributes(vtkDataSet* uGrid, vtkIdType offset0, vtkIdType offset1, double k,
195  vtkDataSet* mesh, vtkIdType outId);
196  void CopyAttributes(vtkDataSet* uGrid, vtkIdType inId, vtkDataSet* mesh, vtkIdType outId);
197  void FinalizeCopyAttributes(vtkDataSet* mesh);
198 
199 private:
200  vtkAMRDualContour(const vtkAMRDualContour&) = delete;
201  void operator=(const vtkAMRDualContour&) = delete;
202 };
203 
204 #endif
vtkMultiProcessController * Controller
int vtkIdType
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkAMRDualGridHelper * Helper
Extract particles and analyse them.
static vtkMultiBlockDataSetAlgorithm * New()
vtkCellArray * Faces
virtual int FillOutputPortInformation(int port, vtkInformation *info)
vtkFloatArray * TemperatureArray
vtkAMRDualContourEdgeLocator * BlockLocator
#define VTKPVVTKEXTENSIONSAMR_EXPORT
Tools for processing AMR as a dual grid.
virtual int FillInputPortInformation(int port, vtkInformation *info)
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
vtkIntArray * BlockIdCellArray
void operator=(const vtkObjectBase &)