GaussianQuadrature_tri.h
Go to the documentation of this file.
1 //
2 // This file is part of the FFEA simulation package
3 //
4 // Copyright (c) by the Theory and Development FFEA teams,
5 // as they appear in the README.md file.
6 //
7 // FFEA is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // FFEA is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with FFEA. If not, see <http://www.gnu.org/licenses/>.
19 //
20 // To help us fund FFEA development, we humbly ask that you cite
21 // the research papers on the package.
22 //
23 
24 #ifndef GAUSSIANQUADRATURE_TRI_H_INCLUDED
25 #define GAUSSIANQUADRATURE_TRI_H_INCLUDED
26 
27 #include "mat_vec_types.h"
28 #include "Face.h"
29 
30 typedef struct {
31  int index, num_points;
33 
34 typedef struct {
37 
39 
40  scalar zeta_0, zeta_1, zeta_2;
43 
44 
46  // 1 point - precision 1
47  {1.0, 1.0 / 3.0, 1.0 / 3.0, 1.0 / 3.0},
48 
49  // 3 point - precision 2
50  {1.0 / 3.0, 2.0 / 3.0, 1.0 / 6.0, 1.0 / 6.0},
51  {1.0 / 3.0, 1.0 / 6.0, 2.0 / 3.0, 1.0 / 6.0},
52  {1.0 / 3.0, 1.0 / 6.0, 1.0 / 6.0, 2.0 / 3.0},
53 
54  // 4 point - precision 3
55  {-0.562500000000000, 1.0 / 3.0, 1.0 / 3.0, 1.0 / 3.0},
56 
57  {0.520833333333333, .6, .2, .2},
58  {0.520833333333333, .2, .6, .2},
59  {0.520833333333333, .2, .2, .6},
60 
61  // 6 point - precision 4
62  {0.109951743655322, 0.816847572980459, 0.091576213509771, 0.091576213509771},
63  {0.109951743655322, 0.091576213509771, 0.816847572980459, 0.091576213509771},
64  {0.109951743655322, 0.091576213509771, 0.091576213509771, 0.816847572980459},
65 
66  {0.223381589678011, 0.108103018168070, 0.445948490915965, 0.445948490915965},
67  {0.223381589678011, 0.445948490915965, 0.108103018168070, 0.445948490915965},
68  {0.223381589678011, 0.445948490915965, 0.445948490915965, 0.108103018168070},
69 
70  // 7 point - precision 5
71  {0.225000000000000, 1.0 / 3.0, 1.0 / 3.0, 1.0 / 3.0},
72 
73  {0.125939180544827, 0.797426985353087, 0.101286507323456, 0.101286507323456},
74  {0.125939180544827, 0.101286507323456, 0.797426985353087, 0.101286507323456},
75  {0.125939180544827, 0.101286507323456, 0.101286507323456, 0.797426985353087},
76 
77  {0.132394152788506, 0.059715871789770, 0.470142064105115, 0.470142064105115},
78  {0.132394152788506, 0.470142064105115, 0.059715871789770, 0.470142064105115},
79  {0.132394152788506, 0.470142064105115, 0.470142064105115, 0.059715871789770},
80 
81  // 12 point - precision 6
82  {0.050844906370207, 0.873821971016996, 0.063089014491502, 0.063089014491502},
83  {0.050844906370207, 0.063089014491502, 0.873821971016996, 0.063089014491502},
84  {0.050844906370207, 0.063089014491502, 0.063089014491502, 0.873821971016996},
85 
86  {0.116786275726379, 0.501426509658179, 0.249286745170910, 0.249286745170910},
87  {0.116786275726379, 0.249286745170910, 0.501426509658179, 0.249286745170910},
88  {0.116786275726379, 0.249286745170910, 0.249286745170910, 0.501426509658179},
89 
90  {0.082851075618374, 0.636502499121399, 0.310352451033785, 0.053145049844816},
91  {0.082851075618374, 0.310352451033785, 0.053145049844816, 0.636502499121399},
92  {0.082851075618374, 0.053145049844816, 0.636502499121399, 0.310352451033785},
93  {0.082851075618374, 0.636502499121399, 0.053145049844816, 0.310352451033785},
94  {0.082851075618374, 0.310352451033785, 0.636502499121399, 0.053145049844816},
95  {0.082851075618374, 0.053145049844816, 0.310352451033785, 0.636502499121399},
96 
97  // 13 point - precision 7
98  {-0.149570044467670, 1.0 / 3.0, 1.0 / 3.0, 1.0 / 3.0},
99 
100  {0.175615257433204, 0.479308067841923, 0.260345966079038, 0.260345966079038},
101  {0.175615257433204, 0.260345966079038, 0.479308067841923, 0.260345966079038},
102  {0.175615257433204, 0.260345966079038, 0.260345966079038, 0.479308067841923},
103 
104  {0.053347235608839, 0.869739794195568, 0.065130102902216, 0.065130102902216},
105  {0.053347235608839, 0.065130102902216, 0.869739794195568, 0.065130102902216},
106  {0.053347235608839, 0.065130102902216, 0.065130102902216, 0.869739794195568},
107 
108  {0.077113760890257, 0.638444188569809, 0.312865496004875, 0.048690315425316},
109  {0.077113760890257, 0.048690315425316, 0.638444188569809, 0.312865496004875},
110  {0.077113760890257, 0.312865496004875, 0.048690315425316, 0.638444188569809},
111  {0.077113760890257, 0.638444188569809, 0.048690315425316, 0.312865496004875},
112  {0.077113760890257, 0.312865496004875, 0.638444188569809, 0.048690315425316},
113  {0.077113760890257, 0.048690315425316, 0.312865496004875, 0.638444188569809}
114 };
115 
117  {0, 0}, // Ignore this line (no precision 0)
118  {0, 1}, // Precision 1: Starts at index 0, 1 point
119  {1, 3}, // Precision 2: Starts at index 1, 3 points
120  {4, 4}, // Precision 3: Starts at index 4, 4 points
121  {8, 6}, // Precision 4: Starts at index 8, 6 points
122  {14, 7}, // Precision 5: Starts at index 14, 7 points
123  {21, 12}, // Precision 6: Starts at index 21, 12 points
124  {33, 13} // Precision 6: Starts at index 33, 13 points
125 };
126 
128 public:
129 
131  }
132 
134  scalar integrate_point_to_face(scalar(*f)(vector3*, vector3*), vector3 *p, Face *face, int precision);
135 
137  scalar integrate_face_to_face(scalar(*f)(vector3*, vector3*), Face *f1, Face *f2, int precision);
138 
139 protected:
140  virtual scalar f_3d(vector3 *p, vector3 *q) = 0;
141 };
142 #endif
Definition: GaussianQuadrature_tri.h:34
Definition: GaussianQuadrature_tri.h:30
static precision_lookup gq_precision[]
Definition: GaussianQuadrature_tri.h:116
Definition: GaussianQuadrature_tri.h:127
scalar integrate_face_to_face(scalar(*f)(vector3 *, vector3 *), Face *f1, Face *f2, int precision)
Definition: GaussianQuadrature_tri.cpp:40
virtual scalar f_3d(vector3 *p, vector3 *q)=0
scalar zeta_2
Definition: GaussianQuadrature_tri.h:40
virtual ~GaussianQuadrature_tri()
Definition: GaussianQuadrature_tri.h:130
static barycentric_gq_point gq_triangle[]
Definition: GaussianQuadrature_tri.h:45
scalar W
Definition: GaussianQuadrature_tri.h:36
int num_points
Definition: GaussianQuadrature_tri.h:31
scalar integrate_point_to_face(scalar(*f)(vector3 *, vector3 *), vector3 *p, Face *face, int precision)
Definition: GaussianQuadrature_tri.cpp:27
Definition: mat_vec_types.h:90
double scalar
Definition: mat_vec_types.h:36
Definition: Face.h:38