ParaView
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 
31 #include "vtkMultiBlockDataSetAlgorithm.h"
32 #include "vtkPVVTKExtensionsDefaultModule.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;
41 class vtkInformationVector;
42 class vtkMultiProcessController;
43 class vtkGridConnectivityFaceHash;
44 class vtkEquivalenceSet;
45 class vtkUnstructuredGrid;
46 class vtkPolyData;
47 
48 class VTKPVVTKEXTENSIONSDEFAULT_EXPORT vtkGridConnectivity : public vtkMultiBlockDataSetAlgorithm
49 {
50 public:
51  vtkTypeMacro(vtkGridConnectivity, vtkMultiBlockDataSetAlgorithm);
52  void PrintSelf(ostream& os, vtkIndent indent);
53  static vtkGridConnectivity* New();
54 
55  // Public so templated function can access this method.
56  void IntegrateCellVolume(
57  vtkCell* cell, int fragmentId, vtkUnstructuredGrid* input, vtkIdType cellIndex);
58 
59 protected:
62 
63  vtkMultiProcessController* Controller;
64 
65  virtual int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
66  vtkInformationVector* outputVector);
67 
68  // I had to make this templated for global pointIds.
69  // void ExecuteProcess(vtkUnstructuredGrid* inputs[],
70  // int numberOfInputs);
71 
72  void GenerateOutput(vtkPolyData* output, vtkUnstructuredGrid* inputs[]);
73 
74  // Create a default executive.
75  virtual vtkExecutive* CreateDefaultExecutive();
76 
77  virtual int FillInputPortInformation(int, vtkInformation*);
78 
79  // This method returns 1 if the input has the necessary arrays for this filter.
80  int CheckInput(vtkUnstructuredGrid* grid);
81 
82  // Find the maximum global point id and allocate the hash.
83  void InitializeFaceHash(vtkUnstructuredGrid** inputs, int numberOfInputs);
84  vtkGridConnectivityFaceHash* FaceHash;
85 
86  void InitializeIntegrationArrays(vtkUnstructuredGrid** inputs, int numberOfInputs);
87 
89  vtkDoubleArray* FragmentVolumes;
90 
91  std::vector<vtkSmartPointer<vtkDoubleArray> > CellAttributesIntegration;
92  std::vector<vtkSmartPointer<vtkDoubleArray> > PointAttributesIntegration;
93 
94  // Temporary structures to help integration.
95  vtkPoints* CellPoints;
96  vtkIdList* CellPointIds;
97  double IntegrateTetrahedron(vtkCell* tetra, vtkUnstructuredGrid* input, int fragmentId);
98  double IntegrateHex(vtkCell* hex, vtkUnstructuredGrid* input, int fragmentId);
99  double IntegrateVoxel(vtkCell* voxel, vtkUnstructuredGrid* input, int fragmentId);
100  double IntegrateGeneral3DCell(vtkCell* cell, vtkUnstructuredGrid* input, int fragmentId);
101  double ComputeTetrahedronVolume(double* pts0, double* pts1, double* pts2, double* pts3);
102  void ComputePointIntegration(vtkUnstructuredGrid* input, vtkIdType pt0Id, vtkIdType pt1Id,
103  vtkIdType pt2Id, vtkIdType pt3Id, double volume, int fragmentId);
104 
105  void ResolveIntegrationArrays();
106  void ResolveFaceFragmentIds();
107 
108  short ProcessId;
110 
111  void ResolveEquivalentFragments();
112  void ResolveProcessesFaces();
113  void CollectFacesAndArraysToRootProcess(int* fragmentIdMap, int* fragmentNumFaces);
114 
115 private:
116  vtkGridConnectivity(const vtkGridConnectivity&) VTK_DELETE_FUNCTION;
117  void operator=(const vtkGridConnectivity&) VTK_DELETE_FUNCTION;
118 };
119 
120 #endif
vtkEquivalenceSet * EquivalenceSet
std::vector< vtkSmartPointer< vtkDoubleArray > > CellAttributesIntegration
Integrates lines, surfaces and volume.
vtkDoubleArray * FragmentVolumes
std::vector< vtkSmartPointer< vtkDoubleArray > > PointAttributesIntegration
vtkGridConnectivityFaceHash * FaceHash
records groups of integers that are equivalent.
vtkMultiProcessController * Controller