vtkGridConnectivity.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkGridConnectivity.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 =========================================================================*/
28 #ifndef vtkGridConnectivity_h
29 #define vtkGridConnectivity_h
30 
32 #include "vtkPVVTKExtensionsFiltersGeneralModule.h" //needed for exports
33 #include "vtkSmartPointer.h" // For ivars
34 #include <vector> // For ivars
35 
36 class vtkCell;
37 class vtkPoints;
38 class vtkDoubleArray;
39 class vtkIdList;
40 class vtkInformation;
43 class vtkGridConnectivityFaceHash;
44 class vtkEquivalenceSet;
46 class vtkPolyData;
47 
50 {
51 public:
53  void PrintSelf(ostream& os, vtkIndent indent) override;
54  static vtkGridConnectivity* New();
55 
56  // Public so templated function can access this method.
57  void IntegrateCellVolume(
58  vtkCell* cell, int fragmentId, vtkUnstructuredGrid* input, vtkIdType cellIndex);
59 
60 protected:
62  ~vtkGridConnectivity() override;
63 
65 
66  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
67  vtkInformationVector* outputVector) override;
68 
69  // I had to make this templated for global pointIds.
70  // void ExecuteProcess(vtkUnstructuredGrid* inputs[],
71  // int numberOfInputs);
72 
73  void GenerateOutput(vtkPolyData* output, vtkUnstructuredGrid* inputs[]);
74 
75  // Create a default executive.
77 
78  int FillInputPortInformation(int, vtkInformation*) override;
79 
80  // This method returns 1 if the input has the necessary arrays for this filter.
81  int CheckInput(vtkUnstructuredGrid* grid);
82 
83  // Find the maximum global point id and allocate the hash.
84  void InitializeFaceHash(vtkUnstructuredGrid** inputs, int numberOfInputs);
85  vtkGridConnectivityFaceHash* FaceHash;
86 
87  void InitializeIntegrationArrays(vtkUnstructuredGrid** inputs, int numberOfInputs);
88 
91 
92  std::vector<vtkSmartPointer<vtkDoubleArray> > CellAttributesIntegration;
93  std::vector<vtkSmartPointer<vtkDoubleArray> > PointAttributesIntegration;
94 
95  // Temporary structures to help integration.
98  double IntegrateTetrahedron(vtkCell* tetra, vtkUnstructuredGrid* input, int fragmentId);
99  double IntegrateHex(vtkCell* hex, vtkUnstructuredGrid* input, int fragmentId);
100  double IntegrateVoxel(vtkCell* voxel, vtkUnstructuredGrid* input, int fragmentId);
101  double IntegrateGeneral3DCell(vtkCell* cell, vtkUnstructuredGrid* input, int fragmentId);
102  double ComputeTetrahedronVolume(double* pts0, double* pts1, double* pts2, double* pts3);
103  void ComputePointIntegration(vtkUnstructuredGrid* input, vtkIdType pt0Id, vtkIdType pt1Id,
104  vtkIdType pt2Id, vtkIdType pt3Id, double volume, int fragmentId);
105 
106  void ResolveIntegrationArrays();
107  void ResolveFaceFragmentIds();
108 
109  short ProcessId;
111 
112  void ResolveEquivalentFragments();
113  void ResolveProcessesFaces();
114  void CollectFacesAndArraysToRootProcess(int* fragmentIdMap, int* fragmentNumFaces);
115 
116 private:
117  vtkGridConnectivity(const vtkGridConnectivity&) = delete;
118  void operator=(const vtkGridConnectivity&) = delete;
119 };
120 
121 #endif
int vtkIdType
vtkEquivalenceSet * EquivalenceSet
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
static vtkMultiBlockDataSetAlgorithm * New()
std::vector< vtkSmartPointer< vtkDoubleArray > > CellAttributesIntegration
Integrates lines, surfaces and volume.
#define VTKPVVTKEXTENSIONSFILTERSGENERAL_EXPORT
vtkDoubleArray * FragmentVolumes
virtual int FillInputPortInformation(int port, vtkInformation *info)
std::vector< vtkSmartPointer< vtkDoubleArray > > PointAttributesIntegration
vtkGridConnectivityFaceHash * FaceHash
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
void operator=(const vtkObjectBase &)
records groups of integers that are equivalent.
virtual vtkExecutive * CreateDefaultExecutive()
vtkMultiProcessController * Controller