v0.9.0
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,
172 };
173 
174 #define QUAD_2D_TABLE_SIZE 29
175 static QUAD * const QUAD_2D_TABLE[] = { QUAD_2D_P1,
184 };
185 
186 #define QUAD_3D_TABLE_SIZE 14
187 static QUAD * const QUAD_3D_TABLE[] = { QUAD_3D_P1,
192 };
193 
194 #define PHG_QUAD_H
195 #endif
QUAD QUAD_2D_P8_
Definition: quad.c:500
struct QUAD_ QUAD
double * points
Definition: quad.h:30
char id
Definition: quad.h:32
QUAD QUAD_1D_P3_
Definition: quad.c:62
#define QUAD_2D_P20
Definition: quad.h:111
static QUAD *const QUAD_1D_TABLE[]
Definition: quad.h:164
QUAD QUAD_3D_P4_
Definition: quad.c:1854
QUAD QUAD_3D_P12_
Definition: quad.c:2183
QUAD QUAD_3D_P8_
Definition: quad.c:1986
#define QUAD_1D_P14
Definition: quad.h:59
QUAD QUAD_1D_P19_
Definition: quad.c:235
#define QUAD_3D_P5
Definition: quad.h:141
char * name
Definition: quad.h:26
QUAD QUAD_2D_P2_
Definition: quad.c:295
QUAD QUAD_3D_P14_
Definition: quad.c:2280
#define QUAD_2D_P25
Definition: quad.h:121
#define QUAD_1D_P10
Definition: quad.h:53
#define QUAD_3D_P7
Definition: quad.h:145
#define QUAD_3D_P6
Definition: quad.h:143
QUAD QUAD_2D_P6_
Definition: quad.c:436
#define QUAD_1D_P15
Definition: quad.h:60
int npoints
Definition: quad.h:29
QUAD QUAD_2D_P29_
Definition: quad.c:1745
#define QUAD_3D_P8
Definition: quad.h:147
#define QUAD_2D_P9
Definition: quad.h:89
#define QUAD_1D_P11
Definition: quad.h:54
#define QUAD_2D_P26
Definition: quad.h:123
#define QUAD_1D_P2
Definition: quad.h:41
#define QUAD_2D_P21
Definition: quad.h:113
#define QUAD_2D_P17
Definition: quad.h:105
int dim
Definition: quad.h:27
QUAD QUAD_2D_P15_
Definition: quad.c:767
QUAD QUAD_3D_P5_
Definition: quad.c:1905
QUAD QUAD_2D_P24_
Definition: quad.c:1295
#define QUAD_2D_P10
Definition: quad.h:91
#define QUAD_1D_P18
Definition: quad.h:65
#define QUAD_2D_P19
Definition: quad.h:109
#define QUAD_2D_P2
Definition: quad.h:75
QUAD QUAD_1D_P5_
Definition: quad.c:81
QUAD QUAD_2D_P18_
Definition: quad.c:924
#define QUAD_1D_P5
Definition: quad.h:45
#define QUAD_1D_P21
Definition: quad.h:69
#define QUAD_3D_P13
Definition: quad.h:157
QUAD QUAD_1D_P1_
Definition: quad.c:45
QUAD QUAD_2D_P16_
Definition: quad.c:813
QUAD QUAD_2D_P28_
Definition: quad.c:1642
#define QUAD_2D_P14
Definition: quad.h:99
static QUAD *const QUAD_2D_TABLE[]
Definition: quad.h:175
#define QUAD_2D_P6
Definition: quad.h:83
#define QUAD_2D_P27
Definition: quad.h:125
QUAD QUAD_3D_P1_
Definition: quad.c:1763
#define QUAD_2D_P12
Definition: quad.h:95
#define QUAD_3D_P2
Definition: quad.h:135
QUAD QUAD_2D_P1_
Definition: quad.c:279
#define QUAD_2D_P28
Definition: quad.h:127
QUAD QUAD_2D_P23_
Definition: quad.c:1228
QUAD QUAD_2D_P26_
Definition: quad.c:1451
#define QUAD_2D_P8
Definition: quad.h:87
QUAD QUAD_2D_P14_
Definition: quad.c:722
QUAD QUAD_1D_P7_
Definition: quad.c:101
#define QUAD_2D_P16
Definition: quad.h:103
QUAD QUAD_3D_P7_
Definition: quad.c:1956
QUAD QUAD_2D_P11_
Definition: quad.c:615
QUAD QUAD_1D_P11_
Definition: quad.c:143
QUAD QUAD_2D_P3_
Definition: quad.c:326
#define QUAD_2D_P1
Definition: quad.h:73
QUAD QUAD_3D_P10_
Definition: quad.c:2052
QUAD QUAD_3D_P6_
Definition: quad.c:1930
#define QUAD_1D_P13
Definition: quad.h:57
#define QUAD_1D_P9
Definition: quad.h:51
#define QUAD_2D_P5
Definition: quad.h:81
QUAD QUAD_2D_P7_
Definition: quad.c:475
#define QUAD_2D_P18
Definition: quad.h:107
QUAD QUAD_2D_P21_
Definition: quad.c:1104
QUAD QUAD_2D_P20_
Definition: quad.c:1047
#define QUAD_2D_P4
Definition: quad.h:79
#define QUAD_1D_P16
Definition: quad.h:62
#define QUAD_1D_P8
Definition: quad.h:50
#define QUAD_2D_P22
Definition: quad.h:115
QUAD QUAD_1D_P13_
Definition: quad.c:165
#define QUAD_3D_P12
Definition: quad.h:155
QUAD QUAD_2D_P17_
Definition: quad.c:867
double * weights
Definition: quad.h:31
QUAD QUAD_2D_P4_
Definition: quad.c:348
#define QUAD_1D_P17
Definition: quad.h:63
#define QUAD_2D_P13
Definition: quad.h:97
#define QUAD_3D_P14
Definition: quad.h:159
#define QUAD_2D_P29
Definition: quad.h:129
#define QUAD_3D_P11
Definition: quad.h:153
QUAD QUAD_2D_P9_
Definition: quad.c:552
Definition: quad.h:25
QUAD QUAD_2D_P13_
Definition: quad.c:684
int order
Definition: quad.h:28
QUAD QUAD_3D_P3_
Definition: quad.c:1813
#define QUAD_1D_P3
Definition: quad.h:42
#define QUAD_3D_P10
Definition: quad.h:151
QUAD QUAD_3D_P9_
Definition: quad.c:2018
QUAD QUAD_2D_P12_
Definition: quad.c:648
QUAD QUAD_3D_P13_
Definition: quad.c:2230
QUAD QUAD_1D_P17_
Definition: quad.c:211
QUAD QUAD_2D_P19_
Definition: quad.c:984
QUAD QUAD_3D_P11_
Definition: quad.c:2092
QUAD QUAD_1D_P9_
Definition: quad.c:123
QUAD QUAD_2D_P27_
Definition: quad.c:1544
#define QUAD_1D_P19
Definition: quad.h:66
QUAD QUAD_2D_P10_
Definition: quad.c:583
#define QUAD_3D_P1
Definition: quad.h:133
#define QUAD_2D_P7
Definition: quad.h:85
#define QUAD_1D_P4
Definition: quad.h:44
#define QUAD_1D_P1
Definition: quad.h:39
#define QUAD_2D_P23
Definition: quad.h:117
#define QUAD_1D_P12
Definition: quad.h:56
#define QUAD_2D_P11
Definition: quad.h:93
#define QUAD_2D_P24
Definition: quad.h:119
#define QUAD_2D_P15
Definition: quad.h:101
QUAD QUAD_2D_P5_
Definition: quad.c:373
QUAD QUAD_2D_P25_
Definition: quad.c:1365
#define QUAD_1D_P20
Definition: quad.h:68
#define QUAD_2D_P3
Definition: quad.h:77
#define QUAD_1D_P7
Definition: quad.h:48
#define QUAD_3D_P4
Definition: quad.h:139
QUAD QUAD_3D_P2_
Definition: quad.c:1780
#define QUAD_3D_P9
Definition: quad.h:149
static QUAD *const QUAD_3D_TABLE[]
Definition: quad.h:187
QUAD QUAD_1D_P15_
Definition: quad.c:187
#define QUAD_3D_P3
Definition: quad.h:137
QUAD QUAD_2D_P22_
Definition: quad.c:1165
#define QUAD_1D_P6
Definition: quad.h:47
QUAD QUAD_1D_P21_
Definition: quad.c:261