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 
47 class VTKPVVTKEXTENSIONSAMR_EXPORT vtkAMRDualContour : public vtkMultiBlockDataSetAlgorithm
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
vtkPoints
vtkAMRDualContour::EnableMultiProcessCommunication
int EnableMultiProcessCommunication
Definition: vtkAMRDualContour.h:118
vtkObjectBase::operator=
void operator=(const vtkObjectBase &)
vtkAMRDualContour::TemperatureArray
vtkFloatArray * TemperatureArray
Definition: vtkAMRDualContour.h:175
vtkAMRDualContour::Helper
vtkAMRDualGridHelper * Helper
Definition: vtkAMRDualContour.h:178
vtkAMRDualGridHelper
Tools for processing AMR as a dual grid.
Definition: vtkAMRDualGridHelper.h:37
vtkAMRDualContour::Faces
vtkCellArray * Faces
Definition: vtkAMRDualContour.h:181
vtkIdType
int vtkIdType
vtkAMRDualContour::EnableMergePoints
int EnableMergePoints
Definition: vtkAMRDualContour.h:119
vtkFloatArray
vtkInformationVector
vtkAMRDualContour::BlockLocator
vtkAMRDualContourEdgeLocator * BlockLocator
Definition: vtkAMRDualContour.h:190
vtkAMRDualContour::TriangulateCap
int TriangulateCap
Definition: vtkAMRDualContour.h:120
vtkAMRDualContour::MessageBufferLength
int * MessageBufferLength
Definition: vtkAMRDualContour.h:188
vtkMultiBlockDataSetAlgorithm::New
static vtkMultiBlockDataSetAlgorithm * New()
vtkMultiBlockDataSetAlgorithm::FillOutputPortInformation
virtual int FillOutputPortInformation(int port, vtkInformation *info)
vtkDataArray
vtkAMRDualContour::BlockIdCellArray
vtkIntArray * BlockIdCellArray
Definition: vtkAMRDualContour.h:174
vtkMultiBlockDataSet
vtkMultiBlockDataSetAlgorithm::RequestData
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkAMRDualGridHelperFace
Definition: vtkAMRDualGridHelper.h:310
vtkDataArraySelection
vtkAMRDualContour::IsoValue
double IsoValue
Definition: vtkAMRDualContour.h:113
vtkAMRDualContour::EnableDegenerateCells
int EnableDegenerateCells
Definition: vtkAMRDualContour.h:116
vtkAMRDualContour::EnableCapping
int EnableCapping
Definition: vtkAMRDualContour.h:117
vtkMultiProcessController
vtkAMRDualContour
Extract particles and analyse them.
Definition: vtkAMRDualContour.h:47
vtkCellData
vtkImageData
vtkIndent
vtkCellArray
vtkIntArray
vtkAMRDualContour::SkipGhostCopy
int SkipGhostCopy
Definition: vtkAMRDualContour.h:121
vtkAMRDualContour::Controller
vtkMultiProcessController * Controller
Definition: vtkAMRDualContour.h:183
vtkMultiBlockDataSetAlgorithm.h
vtkAMRDualContour::Points
vtkPoints * Points
Definition: vtkAMRDualContour.h:180
vtkDataSet
vtkInformation
vtkMultiBlockDataSetAlgorithm::FillInputPortInformation
virtual int FillInputPortInformation(int port, vtkInformation *info)
vtkPolyData
vtkCallbackCommand
vtkDoubleArray
vtkAMRDualGridHelperBlock
Definition: vtkAMRDualGridHelper.h:226
vtkMultiBlockDataSetAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
vtkAMRDualContour::MessageBuffer
int * MessageBuffer
Definition: vtkAMRDualContour.h:187
vtkAMRDualContour::Mesh
vtkPolyData * Mesh
Definition: vtkAMRDualContour.h:179
vtkNonOverlappingAMR
vtkMultiBlockDataSetAlgorithm