GaussLegendreQuadrature.h
Go to the documentation of this file.
1 // This file is a part of the OpenSurgSim project.
2 // Copyright 2012-2013, SimQuest Solutions Inc.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 
19 
20 #ifndef SURGSIM_MATH_GAUSSLEGENDREQUADRATURE_H
21 #define SURGSIM_MATH_GAUSSLEGENDREQUADRATURE_H
22 
23 #include <array>
24 #include <utility>
25 
26 namespace SurgSim
27 {
28 namespace Math
29 {
30 
33 {
34  gaussQuadraturePoint(double p, double w) : point(p), weight(w){}
35 
36  const double point;
37  const double weight;
38 };
39 
44 {
45  gaussQuadratureTrianglePoint(double xi, double eta, double w) : coordinateXi(xi), coordinateEta(eta), weight(w){}
46 
47  const double coordinateXi;
48  const double coordinateEta;
49  const double weight;
50 };
51 
59 extern const std::array<gaussQuadraturePoint, 1> gaussQuadrature1Point;
60 
68 extern const std::array<gaussQuadraturePoint, 2> gaussQuadrature2Points;
69 
77 extern const std::array<gaussQuadraturePoint, 3> gaussQuadrature3Points;
78 
86 extern const std::array<gaussQuadraturePoint, 4> gaussQuadrature4Points;
87 
95 extern const std::array<gaussQuadraturePoint, 5> gaussQuadrature5Points;
96 
104 extern const std::array<gaussQuadraturePoint, 100> gaussQuadrature100Points;
105 
106 // http://math2.uncc.edu/~shaodeng/TEACHING/math5172/Lectures/Lect_15.PDF
107 // "Quadrature Formulas in Two Dimensions"
108 // \int_0^1 \int_0^{1-eta} f(xi, eta) dxi deta = 1/2 sum_i w[i] f(xi[i], eta[i])
109 
118 extern const std::array<gaussQuadratureTrianglePoint, 3> gaussQuadrature2DTriangle3Points;
119 
128 extern const std::array<gaussQuadratureTrianglePoint, 6> gaussQuadrature2DTriangle6Points;
129 
138 extern const std::array<gaussQuadratureTrianglePoint, 12> gaussQuadrature2DTriangle12Points;
139 
140 }; // namespace Math
141 }; // namespace SurgSim
142 
143 #endif // SURGSIM_MATH_GAUSSLEGENDREQUADRATURE_H
SurgSim::Math::gaussQuadraturePoint::point
const double point
Definition: GaussLegendreQuadrature.h:36
SurgSim::Math::gaussQuadrature2DTriangle3Points
const std::array< gaussQuadratureTrianglePoint, 3 > gaussQuadrature2DTriangle3Points
2D triangle Gauss-Legendre quadrature 3-points
Definition: GaussLegendreQuadrature.cpp:164
SurgSim::Math::gaussQuadrature5Points
const std::array< gaussQuadraturePoint, 5 > gaussQuadrature5Points
1D 5-points Gauss-Legendre quadrature
Definition: GaussLegendreQuadrature.cpp:51
SurgSim::Math::gaussQuadraturePoint
1D Gauss-Legendre quadrature
Definition: GaussLegendreQuadrature.h:33
SurgSim::Math::gaussQuadraturePoint::weight
const double weight
Definition: GaussLegendreQuadrature.h:37
SurgSim::Math::gaussQuadraturePoint::gaussQuadraturePoint
gaussQuadraturePoint(double p, double w)
Definition: GaussLegendreQuadrature.h:34
SurgSim::Math::gaussQuadrature3Points
const std::array< gaussQuadraturePoint, 3 > gaussQuadrature3Points
1D 3-points Gauss-Legendre quadrature
Definition: GaussLegendreQuadrature.cpp:36
SurgSim::Math::gaussQuadratureTrianglePoint
2D Gauss-Legendre quadrature on a triangle
Definition: GaussLegendreQuadrature.h:44
SurgSim
Definition: CompoundShapeToGraphics.cpp:30
SurgSim::Math::gaussQuadratureTrianglePoint::coordinateEta
const double coordinateEta
, must verify
Definition: GaussLegendreQuadrature.h:48
SurgSim::Math::gaussQuadratureTrianglePoint::weight
const double weight
Definition: GaussLegendreQuadrature.h:49
SurgSim::Math::gaussQuadratureTrianglePoint::coordinateXi
const double coordinateXi
, must verify
Definition: GaussLegendreQuadrature.h:47
SurgSim::Math::gaussQuadratureTrianglePoint::gaussQuadratureTrianglePoint
gaussQuadratureTrianglePoint(double xi, double eta, double w)
Definition: GaussLegendreQuadrature.h:45
SurgSim::Math::gaussQuadrature2Points
const std::array< gaussQuadraturePoint, 2 > gaussQuadrature2Points
1D 2-points Gauss-Legendre quadrature
Definition: GaussLegendreQuadrature.cpp:30
SurgSim::Math::gaussQuadrature2DTriangle6Points
const std::array< gaussQuadratureTrianglePoint, 6 > gaussQuadrature2DTriangle6Points
2D triangle Gauss-Legendre quadrature 6-points
Definition: GaussLegendreQuadrature.cpp:171
SurgSim::Math::gaussQuadrature100Points
const std::array< gaussQuadraturePoint, 100 > gaussQuadrature100Points
1D 100-points Gauss-Legendre quadrature
Definition: GaussLegendreQuadrature.cpp:60
SurgSim::Math::gaussQuadrature1Point
const std::array< gaussQuadraturePoint, 1 > gaussQuadrature1Point
1D 1-point Gauss-Legendre quadrature
Definition: GaussLegendreQuadrature.cpp:25
SurgSim::Math::gaussQuadrature2DTriangle12Points
const std::array< gaussQuadratureTrianglePoint, 12 > gaussQuadrature2DTriangle12Points
2D triangle Gauss-Legendre quadrature 12-points
Definition: GaussLegendreQuadrature.cpp:181
SurgSim::Math::gaussQuadrature4Points
const std::array< gaussQuadraturePoint, 4 > gaussQuadrature4Points
1D 4-points Gauss-Legendre quadrature
Definition: GaussLegendreQuadrature.cpp:43