v0.14.0
third_party
phg-quadrule
quad.h
Go to the documentation of this file.
1
/* Parallel Hierarchical Grid -- an adaptive finite element library.
2
*
3
* Copyright (C) 2005-2010 State Key Laboratory of Scientific and
4
* Engineering Computing, Chinese Academy of Sciences. */
5
6
/* This library is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU Lesser General Public
8
* License as published by the Free Software Foundation; either
9
* version 2.1 of the License, or (at your option) any later version.
10
*
11
* This library is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* Lesser General Public License for more details.
15
*
16
* You should have received a copy of the GNU Lesser General Public
17
* License along with this library; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
* MA 02110-1301 USA */
20
21
/* $Id: quad.h,v 1.5 2014/10/21 03:00:08 zlb Exp $ */
22
23
#ifndef PHG_QUAD_H
24
25
typedef
struct
QUAD_
{
26
char
*
name
;
/* name of the quadrature formulae */
27
int
dim
;
/* dimension, 1: edge, 2: face, 3: tetra */
28
int
order
;
/* exact for polynomials of order 'order' */
29
int
npoints
;
/* number of points */
30
double
*
points
;
/* barycentric coordinates of quad. points */
31
double
*
weights
;
/* weights */
32
char
id
;
/* id (for use with reference count) */
33
}
QUAD
;
34
35
#define QUAD_DEFAULT -1
36
37
/* 1D quadrature rules */
38
extern
QUAD
QUAD_1D_P1_
;
39
#define QUAD_1D_P1 (&QUAD_1D_P1_)
40
extern
QUAD
QUAD_1D_P3_
;
41
#define QUAD_1D_P2 (&QUAD_1D_P3_)
42
#define QUAD_1D_P3 (&QUAD_1D_P3_)
43
extern
QUAD
QUAD_1D_P5_
;
44
#define QUAD_1D_P4 (&QUAD_1D_P5_)
45
#define QUAD_1D_P5 (&QUAD_1D_P5_)
46
extern
QUAD
QUAD_1D_P7_
;
47
#define QUAD_1D_P6 (&QUAD_1D_P7_)
48
#define QUAD_1D_P7 (&QUAD_1D_P7_)
49
extern
QUAD
QUAD_1D_P9_
;
50
#define QUAD_1D_P8 (&QUAD_1D_P9_)
51
#define QUAD_1D_P9 (&QUAD_1D_P9_)
52
extern
QUAD
QUAD_1D_P11_
;
53
#define QUAD_1D_P10 (&QUAD_1D_P11_)
54
#define QUAD_1D_P11 (&QUAD_1D_P11_)
55
extern
QUAD
QUAD_1D_P13_
;
56
#define QUAD_1D_P12 (&QUAD_1D_P13_)
57
#define QUAD_1D_P13 (&QUAD_1D_P13_)
58
extern
QUAD
QUAD_1D_P15_
;
59
#define QUAD_1D_P14 (&QUAD_1D_P15_)
60
#define QUAD_1D_P15 (&QUAD_1D_P15_)
61
extern
QUAD
QUAD_1D_P17_
;
62
#define QUAD_1D_P16 (&QUAD_1D_P17_)
63
#define QUAD_1D_P17 (&QUAD_1D_P17_)
64
extern
QUAD
QUAD_1D_P19_
;
65
#define QUAD_1D_P18 (&QUAD_1D_P19_)
66
#define QUAD_1D_P19 (&QUAD_1D_P19_)
67
extern
QUAD
QUAD_1D_P21_
;
68
#define QUAD_1D_P20 (&QUAD_1D_P21_)
69
#define QUAD_1D_P21 (&QUAD_1D_P21_)
70
71
/* 2D quadrature rules */
72
extern
QUAD
QUAD_2D_P1_
;
73
#define QUAD_2D_P1 (&QUAD_2D_P1_)
74
extern
QUAD
QUAD_2D_P2_
;
75
#define QUAD_2D_P2 (&QUAD_2D_P2_)
76
extern
QUAD
QUAD_2D_P3_
;
77
#define QUAD_2D_P3 (&QUAD_2D_P3_)
78
extern
QUAD
QUAD_2D_P4_
;
79
#define QUAD_2D_P4 (&QUAD_2D_P4_)
80
extern
QUAD
QUAD_2D_P5_
;
81
#define QUAD_2D_P5 (&QUAD_2D_P5_)
82
extern
QUAD
QUAD_2D_P6_
;
83
#define QUAD_2D_P6 (&QUAD_2D_P6_)
84
extern
QUAD
QUAD_2D_P7_
;
85
#define QUAD_2D_P7 (&QUAD_2D_P7_)
86
extern
QUAD
QUAD_2D_P8_
;
87
#define QUAD_2D_P8 (&QUAD_2D_P8_)
88
extern
QUAD
QUAD_2D_P9_
;
89
#define QUAD_2D_P9 (&QUAD_2D_P9_)
90
extern
QUAD
QUAD_2D_P10_
;
91
#define QUAD_2D_P10 (&QUAD_2D_P10_)
92
extern
QUAD
QUAD_2D_P11_
;
93
#define QUAD_2D_P11 (&QUAD_2D_P11_)
94
extern
QUAD
QUAD_2D_P12_
;
95
#define QUAD_2D_P12 (&QUAD_2D_P12_)
96
extern
QUAD
QUAD_2D_P13_
;
97
#define QUAD_2D_P13 (&QUAD_2D_P13_)
98
extern
QUAD
QUAD_2D_P14_
;
99
#define QUAD_2D_P14 (&QUAD_2D_P14_)
100
extern
QUAD
QUAD_2D_P15_
;
101
#define QUAD_2D_P15 (&QUAD_2D_P15_)
102
extern
QUAD
QUAD_2D_P16_
;
103
#define QUAD_2D_P16 (&QUAD_2D_P16_)
104
extern
QUAD
QUAD_2D_P17_
;
105
#define QUAD_2D_P17 (&QUAD_2D_P17_)
106
extern
QUAD
QUAD_2D_P18_
;
107
#define QUAD_2D_P18 (&QUAD_2D_P18_)
108
extern
QUAD
QUAD_2D_P19_
;
109
#define QUAD_2D_P19 (&QUAD_2D_P19_)
110
extern
QUAD
QUAD_2D_P20_
;
111
#define QUAD_2D_P20 (&QUAD_2D_P20_)
112
extern
QUAD
QUAD_2D_P21_
;
113
#define QUAD_2D_P21 (&QUAD_2D_P21_)
114
extern
QUAD
QUAD_2D_P22_
;
115
#define QUAD_2D_P22 (&QUAD_2D_P22_)
116
extern
QUAD
QUAD_2D_P23_
;
117
#define QUAD_2D_P23 (&QUAD_2D_P23_)
118
extern
QUAD
QUAD_2D_P24_
;
119
#define QUAD_2D_P24 (&QUAD_2D_P24_)
120
extern
QUAD
QUAD_2D_P25_
;
121
#define QUAD_2D_P25 (&QUAD_2D_P25_)
122
extern
QUAD
QUAD_2D_P26_
;
123
#define QUAD_2D_P26 (&QUAD_2D_P26_)
124
extern
QUAD
QUAD_2D_P27_
;
125
#define QUAD_2D_P27 (&QUAD_2D_P27_)
126
extern
QUAD
QUAD_2D_P28_
;
127
#define QUAD_2D_P28 (&QUAD_2D_P28_)
128
extern
QUAD
QUAD_2D_P29_
;
129
#define QUAD_2D_P29 (&QUAD_2D_P29_)
130
131
/* 3D quadrature rules */
132
extern
QUAD
QUAD_3D_P1_
;
133
#define QUAD_3D_P1 (&QUAD_3D_P1_)
134
extern
QUAD
QUAD_3D_P2_
;
135
#define QUAD_3D_P2 (&QUAD_3D_P2_)
136
extern
QUAD
QUAD_3D_P3_
;
137
#define QUAD_3D_P3 (&QUAD_3D_P3_)
138
extern
QUAD
QUAD_3D_P4_
;
139
#define QUAD_3D_P4 (&QUAD_3D_P4_)
140
extern
QUAD
QUAD_3D_P5_
;
141
#define QUAD_3D_P5 (&QUAD_3D_P5_)
142
extern
QUAD
QUAD_3D_P6_
;
143
#define QUAD_3D_P6 (&QUAD_3D_P6_)
144
extern
QUAD
QUAD_3D_P7_
;
145
#define QUAD_3D_P7 (&QUAD_3D_P7_)
146
extern
QUAD
QUAD_3D_P8_
;
147
#define QUAD_3D_P8 (&QUAD_3D_P8_)
148
extern
QUAD
QUAD_3D_P9_
;
149
#define QUAD_3D_P9 (&QUAD_3D_P9_)
150
extern
QUAD
QUAD_3D_P10_
;
151
#define QUAD_3D_P10 (&QUAD_3D_P10_)
152
extern
QUAD
QUAD_3D_P11_
;
153
#define QUAD_3D_P11 (&QUAD_3D_P11_)
154
extern
QUAD
QUAD_3D_P12_
;
155
#define QUAD_3D_P12 (&QUAD_3D_P12_)
156
extern
QUAD
QUAD_3D_P13_
;
157
#define QUAD_3D_P13 (&QUAD_3D_P13_)
158
extern
QUAD
QUAD_3D_P14_
;
159
#define QUAD_3D_P14 (&QUAD_3D_P14_)
160
161
// Tables
162
163
#define QUAD_1D_TABLE_SIZE 21
164
static
QUAD
*
const
QUAD_1D_TABLE
[] = {
QUAD_1D_P1
,
165
QUAD_1D_P1
,
QUAD_1D_P2
,
QUAD_1D_P3
,
166
QUAD_1D_P4
,
QUAD_1D_P5
,
QUAD_1D_P6
,
167
QUAD_1D_P7
,
QUAD_1D_P8
,
QUAD_1D_P9
,
168
QUAD_1D_P10
,
QUAD_1D_P11
,
QUAD_1D_P12
,
169
QUAD_1D_P13
,
QUAD_1D_P14
,
QUAD_1D_P15
,
170
QUAD_1D_P16
,
QUAD_1D_P17
,
QUAD_1D_P18
,
171
QUAD_1D_P19
,
QUAD_1D_P20
,
QUAD_1D_P21
172
};
173
174
#define QUAD_2D_TABLE_SIZE 29
175
static
QUAD
*
const
QUAD_2D_TABLE
[] = {
QUAD_2D_P1
,
176
QUAD_2D_P1
,
QUAD_2D_P2
,
QUAD_2D_P3
,
QUAD_2D_P4
,
177
QUAD_2D_P5
,
QUAD_2D_P6
,
QUAD_2D_P7
,
QUAD_2D_P8
,
178
QUAD_2D_P9
,
QUAD_2D_P10
,
QUAD_2D_P11
,
QUAD_2D_P12
,
179
QUAD_2D_P13
,
QUAD_2D_P14
,
QUAD_2D_P15
,
QUAD_2D_P16
,
180
QUAD_2D_P17
,
QUAD_2D_P18
,
QUAD_2D_P19
,
QUAD_2D_P20
,
181
QUAD_2D_P21
,
QUAD_2D_P22
,
QUAD_2D_P23
,
QUAD_2D_P24
,
182
QUAD_2D_P25
,
QUAD_2D_P26
,
QUAD_2D_P27
,
QUAD_2D_P28
,
183
QUAD_2D_P29
184
};
185
186
#define QUAD_3D_TABLE_SIZE 14
187
static
QUAD
*
const
QUAD_3D_TABLE
[] = {
QUAD_3D_P1
,
188
QUAD_3D_P1
,
QUAD_3D_P2
,
QUAD_3D_P3
,
QUAD_3D_P4
,
189
QUAD_3D_P5
,
QUAD_3D_P6
,
QUAD_3D_P7
,
QUAD_3D_P8
,
190
QUAD_3D_P9
,
QUAD_3D_P10
,
QUAD_3D_P11
,
QUAD_3D_P12
,
191
QUAD_3D_P13
,
QUAD_3D_P14
192
};
193
194
#define PHG_QUAD_H
195
#endif
QUAD_2D_P17
#define QUAD_2D_P17
Definition:
quad.h:105
QUAD_2D_P7
#define QUAD_2D_P7
Definition:
quad.h:85
QUAD_2D_P10
#define QUAD_2D_P10
Definition:
quad.h:91
QUAD_1D_P12
#define QUAD_1D_P12
Definition:
quad.h:56
QUAD_2D_P12_
QUAD QUAD_2D_P12_
Definition:
quad.c:648
QUAD_2D_P15
#define QUAD_2D_P15
Definition:
quad.h:101
QUAD_1D_P3
#define QUAD_1D_P3
Definition:
quad.h:42
QUAD_2D_P5_
QUAD QUAD_2D_P5_
Definition:
quad.c:373
QUAD_1D_P5_
QUAD QUAD_1D_P5_
Definition:
quad.c:81
QUAD_2D_P4_
QUAD QUAD_2D_P4_
Definition:
quad.c:348
QUAD_3D_P8
#define QUAD_3D_P8
Definition:
quad.h:147
QUAD_1D_P20
#define QUAD_1D_P20
Definition:
quad.h:68
QUAD_2D_P3
#define QUAD_2D_P3
Definition:
quad.h:77
QUAD_3D_P14
#define QUAD_3D_P14
Definition:
quad.h:159
QUAD_
Definition:
quad.h:25
QUAD_1D_P19
#define QUAD_1D_P19
Definition:
quad.h:66
QUAD_2D_P6
#define QUAD_2D_P6
Definition:
quad.h:83
QUAD_1D_P11_
QUAD QUAD_1D_P11_
Definition:
quad.c:143
QUAD_1D_P6
#define QUAD_1D_P6
Definition:
quad.h:47
QUAD_3D_P1_
QUAD QUAD_3D_P1_
Definition:
quad.c:1763
QUAD_2D_P19
#define QUAD_2D_P19
Definition:
quad.h:109
QUAD_::id
char id
Definition:
quad.h:32
QUAD_2D_P14
#define QUAD_2D_P14
Definition:
quad.h:99
QUAD_3D_P10
#define QUAD_3D_P10
Definition:
quad.h:151
QUAD_2D_TABLE
static QUAD *const QUAD_2D_TABLE[]
Definition:
quad.h:175
QUAD_2D_P8_
QUAD QUAD_2D_P8_
Definition:
quad.c:500
QUAD_1D_P13
#define QUAD_1D_P13
Definition:
quad.h:57
QUAD_3D_P4
#define QUAD_3D_P4
Definition:
quad.h:139
QUAD_2D_P23_
QUAD QUAD_2D_P23_
Definition:
quad.c:1228
QUAD_1D_P15_
QUAD QUAD_1D_P15_
Definition:
quad.c:187
QUAD_2D_P12
#define QUAD_2D_P12
Definition:
quad.h:95
QUAD_3D_P11_
QUAD QUAD_3D_P11_
Definition:
quad.c:2092
QUAD_3D_P2
#define QUAD_3D_P2
Definition:
quad.h:135
QUAD_2D_P18
#define QUAD_2D_P18
Definition:
quad.h:107
QUAD_::order
int order
Definition:
quad.h:28
QUAD_1D_P1_
QUAD QUAD_1D_P1_
Definition:
quad.c:45
QUAD_1D_P8
#define QUAD_1D_P8
Definition:
quad.h:50
QUAD_2D_P16_
QUAD QUAD_2D_P16_
Definition:
quad.c:813
QUAD_2D_P28_
QUAD QUAD_2D_P28_
Definition:
quad.c:1642
QUAD_2D_P1
#define QUAD_2D_P1
Definition:
quad.h:73
QUAD_1D_P1
#define QUAD_1D_P1
Definition:
quad.h:39
QUAD_3D_P4_
QUAD QUAD_3D_P4_
Definition:
quad.c:1854
QUAD_3D_P12_
QUAD QUAD_3D_P12_
Definition:
quad.c:2183
QUAD_2D_P23
#define QUAD_2D_P23
Definition:
quad.h:117
QUAD_2D_P27
#define QUAD_2D_P27
Definition:
quad.h:125
QUAD_2D_P24
#define QUAD_2D_P24
Definition:
quad.h:119
QUAD_3D_P14_
QUAD QUAD_3D_P14_
Definition:
quad.c:2280
QUAD_3D_P7
#define QUAD_3D_P7
Definition:
quad.h:145
QUAD_2D_P20_
QUAD QUAD_2D_P20_
Definition:
quad.c:1047
QUAD_1D_P16
#define QUAD_1D_P16
Definition:
quad.h:62
QUAD_2D_P7_
QUAD QUAD_2D_P7_
Definition:
quad.c:475
QUAD_1D_P7_
QUAD QUAD_1D_P7_
Definition:
quad.c:101
QUAD_1D_TABLE
static QUAD *const QUAD_1D_TABLE[]
Definition:
quad.h:164
QUAD_3D_P7_
QUAD QUAD_3D_P7_
Definition:
quad.c:1956
QUAD_2D_P29_
QUAD QUAD_2D_P29_
Definition:
quad.c:1745
QUAD_1D_P14
#define QUAD_1D_P14
Definition:
quad.h:59
QUAD_3D_P9_
QUAD QUAD_3D_P9_
Definition:
quad.c:2018
QUAD_3D_P5
#define QUAD_3D_P5
Definition:
quad.h:141
QUAD_1D_P2
#define QUAD_1D_P2
Definition:
quad.h:41
QUAD_2D_P13
#define QUAD_2D_P13
Definition:
quad.h:97
QUAD_2D_P9_
QUAD QUAD_2D_P9_
Definition:
quad.c:552
QUAD_2D_P24_
QUAD QUAD_2D_P24_
Definition:
quad.c:1295
QUAD_2D_P4
#define QUAD_2D_P4
Definition:
quad.h:79
QUAD_1D_P4
#define QUAD_1D_P4
Definition:
quad.h:44
QUAD_2D_P2
#define QUAD_2D_P2
Definition:
quad.h:75
QUAD_2D_P13_
QUAD QUAD_2D_P13_
Definition:
quad.c:684
QUAD_1D_P5
#define QUAD_1D_P5
Definition:
quad.h:45
QUAD_2D_P25_
QUAD QUAD_2D_P25_
Definition:
quad.c:1365
QUAD_2D_P19_
QUAD QUAD_2D_P19_
Definition:
quad.c:984
QUAD
struct QUAD_ QUAD
QUAD_3D_P8_
QUAD QUAD_3D_P8_
Definition:
quad.c:1986
QUAD_2D_P15_
QUAD QUAD_2D_P15_
Definition:
quad.c:767
QUAD_3D_P13
#define QUAD_3D_P13
Definition:
quad.h:157
QUAD_3D_P9
#define QUAD_3D_P9
Definition:
quad.h:149
QUAD_2D_P2_
QUAD QUAD_2D_P2_
Definition:
quad.c:295
QUAD_1D_P17_
QUAD QUAD_1D_P17_
Definition:
quad.c:211
QUAD_::npoints
int npoints
Definition:
quad.h:29
QUAD_3D_P11
#define QUAD_3D_P11
Definition:
quad.h:153
QUAD_::points
double * points
Definition:
quad.h:30
QUAD_3D_P3_
QUAD QUAD_3D_P3_
Definition:
quad.c:1813
QUAD_2D_P1_
QUAD QUAD_2D_P1_
Definition:
quad.c:279
QUAD_2D_P9
#define QUAD_2D_P9
Definition:
quad.h:89
QUAD_2D_P28
#define QUAD_2D_P28
Definition:
quad.h:127
QUAD_2D_P11
#define QUAD_2D_P11
Definition:
quad.h:93
QUAD_3D_TABLE
static QUAD *const QUAD_3D_TABLE[]
Definition:
quad.h:187
QUAD_3D_P13_
QUAD QUAD_3D_P13_
Definition:
quad.c:2230
QUAD_2D_P14_
QUAD QUAD_2D_P14_
Definition:
quad.c:722
QUAD_1D_P9_
QUAD QUAD_1D_P9_
Definition:
quad.c:123
QUAD_2D_P27_
QUAD QUAD_2D_P27_
Definition:
quad.c:1544
QUAD_1D_P21
#define QUAD_1D_P21
Definition:
quad.h:69
QUAD_3D_P2_
QUAD QUAD_3D_P2_
Definition:
quad.c:1780
QUAD_2D_P22_
QUAD QUAD_2D_P22_
Definition:
quad.c:1165
QUAD_2D_P10_
QUAD QUAD_2D_P10_
Definition:
quad.c:583
QUAD_3D_P1
#define QUAD_3D_P1
Definition:
quad.h:133
QUAD_2D_P20
#define QUAD_2D_P20
Definition:
quad.h:111
QUAD_3D_P6_
QUAD QUAD_3D_P6_
Definition:
quad.c:1930
QUAD_1D_P21_
QUAD QUAD_1D_P21_
Definition:
quad.c:261
QUAD_1D_P7
#define QUAD_1D_P7
Definition:
quad.h:48
QUAD_2D_P16
#define QUAD_2D_P16
Definition:
quad.h:103
QUAD_::weights
double * weights
Definition:
quad.h:31
QUAD_2D_P8
#define QUAD_2D_P8
Definition:
quad.h:87
QUAD_2D_P22
#define QUAD_2D_P22
Definition:
quad.h:115
QUAD_3D_P3
#define QUAD_3D_P3
Definition:
quad.h:137
QUAD_1D_P15
#define QUAD_1D_P15
Definition:
quad.h:60
QUAD_::name
char * name
Definition:
quad.h:26
QUAD_1D_P11
#define QUAD_1D_P11
Definition:
quad.h:54
QUAD_1D_P9
#define QUAD_1D_P9
Definition:
quad.h:51
QUAD_2D_P5
#define QUAD_2D_P5
Definition:
quad.h:81
QUAD_1D_P10
#define QUAD_1D_P10
Definition:
quad.h:53
QUAD_2D_P26_
QUAD QUAD_2D_P26_
Definition:
quad.c:1451
QUAD_3D_P5_
QUAD QUAD_3D_P5_
Definition:
quad.c:1905
QUAD_3D_P6
#define QUAD_3D_P6
Definition:
quad.h:143
QUAD_2D_P6_
QUAD QUAD_2D_P6_
Definition:
quad.c:436
QUAD_2D_P25
#define QUAD_2D_P25
Definition:
quad.h:121
QUAD_3D_P12
#define QUAD_3D_P12
Definition:
quad.h:155
QUAD_2D_P17_
QUAD QUAD_2D_P17_
Definition:
quad.c:867
QUAD_::dim
int dim
Definition:
quad.h:27
QUAD_2D_P11_
QUAD QUAD_2D_P11_
Definition:
quad.c:615
QUAD_2D_P3_
QUAD QUAD_2D_P3_
Definition:
quad.c:326
QUAD_2D_P26
#define QUAD_2D_P26
Definition:
quad.h:123
QUAD_1D_P17
#define QUAD_1D_P17
Definition:
quad.h:63
QUAD_1D_P3_
QUAD QUAD_1D_P3_
Definition:
quad.c:62
QUAD_1D_P13_
QUAD QUAD_1D_P13_
Definition:
quad.c:165
QUAD_3D_P10_
QUAD QUAD_3D_P10_
Definition:
quad.c:2052
QUAD_2D_P18_
QUAD QUAD_2D_P18_
Definition:
quad.c:924
QUAD_2D_P29
#define QUAD_2D_P29
Definition:
quad.h:129
QUAD_1D_P19_
QUAD QUAD_1D_P19_
Definition:
quad.c:235
QUAD_2D_P21_
QUAD QUAD_2D_P21_
Definition:
quad.c:1104
QUAD_2D_P21
#define QUAD_2D_P21
Definition:
quad.h:113
QUAD_1D_P18
#define QUAD_1D_P18
Definition:
quad.h:65
Generated by
Doxygen
1.8.17 and hosted at