VMTK
vtkvmtkGaussQuadrature.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: VMTK
4  Module: $RCSfile: vtkvmtkGaussQuadrature.h,v $
5  Language: C++
6 
7  Copyright (c) Luca Antiga, David Steinman. All rights reserved.
8  See LICENSE file for details.
9 
10  Portions of this code are covered under the VTK copyright.
11  See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm
12  for details.
13 
14  This software is distributed WITHOUT ANY WARRANTY; without even
15  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16  PURPOSE. See the above copyright notices for more information.
17 
18 =========================================================================*/
28 #ifndef __vtkvmtkGaussQuadrature_h
29 #define __vtkvmtkGaussQuadrature_h
30 
31 #include "vtkObject.h"
32 #include "vtkvmtkWin32Header.h"
33 
34 #include "vtkCell.h"
35 #include "vtkDoubleArray.h"
36 
37 class VTK_VMTK_DIFFERENTIAL_GEOMETRY_EXPORT vtkvmtkGaussQuadrature : public vtkObject
38 {
39 public:
40  vtkTypeMacro(vtkvmtkGaussQuadrature,vtkObject);
41  static vtkvmtkGaussQuadrature* New();
42 
43  vtkGetObjectMacro(QuadraturePoints,vtkDoubleArray);
44  vtkGetObjectMacro(QuadratureWeights,vtkDoubleArray);
45 
46  vtkSetMacro(Order,int);
47  vtkGetMacro(Order,int);
48 
50  {
51  return this->QuadraturePoints->GetNumberOfTuples();
52  }
53 
54  double* GetQuadraturePoint(vtkIdType id)
55  {
56  return this->QuadraturePoints->GetTuple(id);
57  }
58 
59  void GetQuadraturePoint(vtkIdType id, double* quadraturePoint)
60  {
61  this->QuadraturePoints->GetTuple(id,quadraturePoint);
62  }
63 
64  double GetQuadraturePoint(vtkIdType id, int c)
65  {
66  return this->QuadraturePoints->GetComponent(id,c);
67  }
68 
69  double GetQuadratureWeight(vtkIdType id)
70  {
71  return this->QuadratureWeights->GetValue(id);
72  }
73 
74  void Initialize(vtkIdType cellType);
75 
76  void Initialize(vtkCell* cell)
77  {
78  this->Initialize(cell->GetCellType());
79  }
80 
81  void Initialize1DGauss();
82  void Initialize1DJacobi(int alpha, int beta);
83  void ScaleTo01();
84 
85 protected:
88 
89  void TensorProductQuad(vtkvmtkGaussQuadrature* q1D);
90  void TensorProductTriangle(vtkvmtkGaussQuadrature* gauss1D, vtkvmtkGaussQuadrature* jacA1D);
91 
92  void TensorProductHexahedron(vtkvmtkGaussQuadrature* q1D);
93  void TensorProductWedge(vtkvmtkGaussQuadrature* q1D, vtkvmtkGaussQuadrature* q2D);
94  void TensorProductTetra(vtkvmtkGaussQuadrature* gauss1D, vtkvmtkGaussQuadrature* jacA1D, vtkvmtkGaussQuadrature* jacB1D);
95 
96  vtkDoubleArray* QuadraturePoints;
97  vtkDoubleArray* QuadratureWeights;
98 
99  int Order;
101  vtkIdType CellType;
103 
104 private:
105  vtkvmtkGaussQuadrature(const vtkvmtkGaussQuadrature&); // Not implemented.
106  void operator=(const vtkvmtkGaussQuadrature&); // Not implemented.
107 
108 };
109 
110 #endif
vtkDoubleArray * QuadraturePoints
void GetQuadraturePoint(vtkIdType id, double *quadraturePoint)
double * GetQuadraturePoint(vtkIdType id)
Finite element quadrature rule; Approximation of the definite integral of a function, as a weighted sum of function values at specified points.
vtkDoubleArray * QuadratureWeights
double GetQuadratureWeight(vtkIdType id)
double GetQuadraturePoint(vtkIdType id, int c)
void Initialize(vtkCell *cell)