/[escript]/trunk/speckley/src/lagrange_functions.h
ViewVC logotype

Contents of /trunk/speckley/src/lagrange_functions.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6112 - (show annotations)
Thu Mar 31 09:40:10 2016 UTC (3 years, 3 months ago) by jfenwick
File MIME type: text/plain
File size: 14654 byte(s)
Relicense all the things!


1
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2016 by The University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Apache License, version 2.0
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development 2012-2013 by School of Earth Sciences
13 * Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 *
15 *****************************************************************************/
16
17 namespace speckley {
18
19 inline double lagrange_degree2_0(double xi) {
20 return 0.5*xi*(xi - 1.0);
21 }
22
23 inline double lagrange_degree2_1(double xi) {
24 return -1.0*pow(xi, 2) + 1.0;
25 }
26
27 inline double lagrange_degree2_2(double xi) {
28 return 0.5*xi*(xi + 1.0);
29 }
30
31 inline double lagrange_degree3_0(double xi) {
32 return (-0.625*xi + 0.625)*(xi - 0.447213595499958)*(xi + 0.447213595499958);
33 }
34
35 inline double lagrange_degree3_1(double xi) {
36 return (xi - 0.447213595499958)*(xi + 1.0)*(1.39754248593737*xi - 1.39754248593737);
37 }
38
39 inline double lagrange_degree3_2(double xi) {
40 return (-1.39754248593737*xi + 1.39754248593737)*(xi + 0.447213595499958)*(xi + 1.0);
41 }
42
43 inline double lagrange_degree3_3(double xi) {
44 return (0.625*xi - 0.279508497187474)*(xi + 0.447213595499958)*(xi + 1.0);
45 }
46
47 inline double lagrange_degree4_0(double xi) {
48 return 0.874999999999998*xi*(xi - 1.0)*(xi - 0.654653670707977)*(xi + 0.654653670707977);
49 }
50
51 inline double lagrange_degree4_1(double xi) {
52 return -2.04166666666667*xi*(xi - 1.0)*(xi - 0.654653670707977)*(xi + 1.0);
53 }
54
55 inline double lagrange_degree4_2(double xi) {
56 return (xi - 0.654653670707977)*(xi + 0.654653670707977)*(xi + 1.0)*(2.33333333333333*xi - 2.33333333333333);
57 }
58
59 inline double lagrange_degree4_3(double xi) {
60 return -2.04166666666667*xi*(xi - 1.0)*(xi + 0.654653670707977)*(xi + 1.0);
61 }
62
63 inline double lagrange_degree4_4(double xi) {
64 return 0.875*xi*(xi - 0.654653670707977)*(xi + 0.654653670707977)*(xi + 1.0);
65 }
66
67 inline double lagrange_degree5_0(double xi) {
68 return (-1.31250000000001*xi + 1.31250000000001)*(xi - 0.765055323929464)*(xi - 0.285231516480645)*(xi + 0.285231516480645)*(xi + 0.765055323929466);
69 }
70
71 inline double lagrange_degree5_1(double xi) {
72 return (xi - 0.765055323929464)*(xi - 0.285231516480645)*(xi + 0.285231516480645)*(xi + 1.0)*(3.12725658269744*xi - 3.12725658269744);
73 }
74
75 inline double lagrange_degree5_2(double xi) {
76 return (-3.78648303389511*xi + 3.78648303389511)*(xi - 0.765055323929464)*(xi - 0.285231516480645)*(xi + 0.765055323929466)*(xi + 1.0);
77 }
78
79 inline double lagrange_degree5_3(double xi) {
80 return (xi - 0.765055323929464)*(xi + 0.285231516480645)*(xi + 0.765055323929466)*(xi + 1.0)*(3.78648303389512*xi - 3.78648303389512);
81 }
82
83 inline double lagrange_degree5_4(double xi) {
84 return (-3.12725658269744*xi + 3.12725658269744)*(xi - 0.285231516480645)*(xi + 0.285231516480645)*(xi + 0.765055323929466)*(xi + 1.0);
85 }
86
87 inline double lagrange_degree5_5(double xi) {
88 return (xi - 0.285231516480645)*(xi + 0.285231516480645)*(xi + 0.765055323929466)*(xi + 1.0)*(1.3125*xi - 1.00413511265742);
89 }
90
91 inline double lagrange_degree6_0(double xi) {
92 return 2.06249999999999*xi*(xi - 1.0)*(xi - 0.830223896278565)*(xi - 0.468848793470715)*(xi + 0.468848793470714)*(xi + 0.830223896278566);
93 }
94
95 inline double lagrange_degree6_1(double xi) {
96 return -4.97286970608696*xi*(xi - 1.0)*(xi - 0.830223896278565)*(xi - 0.468848793470715)*(xi + 0.468848793470714)*(xi + 1.0);
97 }
98
99 inline double lagrange_degree6_2(double xi) {
100 return 6.21036970608698*xi*(xi - 1.0)*(xi - 0.830223896278565)*(xi - 0.468848793470715)*(xi + 0.830223896278566)*(xi + 1.0);
101 }
102
103 inline double lagrange_degree6_3(double xi) {
104 return -6.6*pow(xi, 6) + 12.6*pow(xi, 4) - 7.0*pow(xi, 2) + 1.46549439250521e-15*xi + 1.0;
105 }
106
107 inline double lagrange_degree6_4(double xi) {
108 return 6.21036970608699*xi*(xi - 1.0)*(xi - 0.830223896278565)*(xi + 0.468848793470714)*(xi + 0.830223896278566)*(xi + 1.0);
109 }
110
111 inline double lagrange_degree6_5(double xi) {
112 return -4.97286970608697*xi*(xi - 1.0)*(xi - 0.468848793470715)*(xi + 0.468848793470714)*(xi + 0.830223896278566)*(xi + 1.0);
113 }
114
115 inline double lagrange_degree6_6(double xi) {
116 return 2.06249999999999*xi*(xi - 0.830223896278565)*(xi - 0.468848793470715)*(xi + 0.468848793470714)*(xi + 0.830223896278566)*(xi + 1.0);
117 }
118
119 inline double lagrange_degree7_0(double xi) {
120 return (-3.35156249999998*xi + 3.35156249999997)*(xi - 0.871740148509608)*(xi - 0.591700181433143)*(xi - 0.209299217902479)*(xi + 0.209299217902479)*(xi + 0.591700181433142)*(xi + 0.871740148509606);
121 }
122
123 inline double lagrange_degree7_1(double xi) {
124 return (xi - 0.871740148509608)*(xi - 0.591700181433143)*(xi - 0.209299217902479)*(xi + 0.209299217902479)*(xi + 0.591700181433142)*(xi + 1.0)*(8.14072271825386*xi - 8.14072271825384);
125 }
126
127 inline double lagrange_degree7_2(double xi) {
128 return (-10.3581368289505*xi + 10.3581368289505)*(xi - 0.871740148509608)*(xi - 0.591700181433143)*(xi - 0.209299217902479)*(xi + 0.209299217902479)*(xi + 0.871740148509606)*(xi + 1.0);
129 }
130
131 inline double lagrange_degree7_3(double xi) {
132 return (xi - 0.871740148509608)*(xi - 0.591700181433143)*(xi - 0.209299217902479)*(xi + 0.591700181433142)*(xi + 0.871740148509606)*(xi + 1.0)*(11.3898137484866*xi - 11.3898137484866);
133 }
134
135 inline double lagrange_degree7_4(double xi) {
136 return (-11.3898137484866*xi + 11.3898137484866)*(xi - 0.871740148509608)*(xi - 0.591700181433143)*(xi + 0.209299217902479)*(xi + 0.591700181433142)*(xi + 0.871740148509606)*(xi + 1.0);
137 }
138
139 inline double lagrange_degree7_5(double xi) {
140 return (xi - 0.871740148509608)*(xi - 0.209299217902479)*(xi + 0.209299217902479)*(xi + 0.591700181433142)*(xi + 0.871740148509606)*(xi + 1.0)*(10.3581368289505*xi - 10.3581368289505);
141 }
142
143 inline double lagrange_degree7_6(double xi) {
144 return (-8.140722718254*xi + 8.14072271825398)*(xi - 0.591700181433143)*(xi - 0.209299217902479)*(xi + 0.209299217902479)*(xi + 0.591700181433142)*(xi + 0.871740148509606)*(xi + 1.0);
145 }
146
147 inline double lagrange_degree7_7(double xi) {
148 return (xi - 0.591700181433143)*(xi - 0.209299217902479)*(xi + 0.209299217902479)*(xi + 0.591700181433142)*(xi + 0.871740148509606)*(xi + 1.0)*(3.35156250000011*xi - 2.92169159148933);
149 }
150
151 inline double lagrange_degree8_0(double xi) {
152 return 5.58593750000054*xi*(xi - 1.0)*(xi - 0.899757995411458)*(xi - 0.677186279510736)*(xi - 0.363117463826179)*(xi + 0.363117463826178)*(xi + 0.677186279510735)*(xi + 0.899757995411471);
153 }
154
155 inline double lagrange_degree8_1(double xi) {
156 return -13.63453200049*xi*(xi - 1.0)*(xi - 0.899757995411458)*(xi - 0.677186279510736)*(xi - 0.363117463826179)*(xi + 0.363117463826178)*(xi + 0.677186279510735)*(xi + 1.0);
157 }
158
159 inline double lagrange_degree8_2(double xi) {
160 return 17.5609949844529*xi*(xi - 1.0)*(xi - 0.899757995411458)*(xi - 0.677186279510736)*(xi - 0.363117463826179)*(xi + 0.363117463826178)*(xi + 0.899757995411471)*(xi + 1.0);
161 }
162
163 inline double lagrange_degree8_3(double xi) {
164 return -19.7266861982491*xi*(xi - 1.0)*(xi - 0.899757995411458)*(xi - 0.677186279510736)*(xi - 0.363117463826179)*(xi + 0.677186279510735)*(xi + 0.899757995411471)*(xi + 1.0);
165 }
166
167 inline double lagrange_degree8_4(double xi) {
168 return (xi - 0.899757995411458)*(xi - 0.677186279510736)*(xi - 0.363117463826179)*(xi + 0.363117463826178)*(xi + 0.677186279510735)*(xi + 0.899757995411471)*(xi + 1.0)*(20.4285714285713*xi - 20.4285714285713);
169 }
170
171 inline double lagrange_degree8_5(double xi) {
172 return -19.7266861982493*xi*(xi - 1.0)*(xi - 0.899757995411458)*(xi - 0.677186279510736)*(xi + 0.363117463826178)*(xi + 0.677186279510735)*(xi + 0.899757995411471)*(xi + 1.0);
173 }
174
175 inline double lagrange_degree8_6(double xi) {
176 return 17.5609949844536*xi*(xi - 1.0)*(xi - 0.899757995411458)*(xi - 0.363117463826179)*(xi + 0.363117463826178)*(xi + 0.677186279510735)*(xi + 0.899757995411471)*(xi + 1.0);
177 }
178
179 inline double lagrange_degree8_7(double xi) {
180 return -13.6345320004894*xi*(xi - 1.0)*(xi - 0.677186279510736)*(xi - 0.363117463826179)*(xi + 0.363117463826178)*(xi + 0.677186279510735)*(xi + 0.899757995411471)*(xi + 1.0);
181 }
182
183 inline double lagrange_degree8_8(double xi) {
184 return 5.58593749999947*xi*(xi - 0.899757995411458)*(xi - 0.677186279510736)*(xi - 0.363117463826179)*(xi + 0.363117463826178)*(xi + 0.677186279510735)*(xi + 0.899757995411471)*(xi + 1.0);
185 }
186
187 inline double lagrange_degree9_0(double xi) {
188 return (-9.49609374999916*xi + 9.49609374999925)*(xi - 0.919533908166451)*(xi - 0.738773865105506)*(xi - 0.477924949810445)*(xi - 0.165278957666387)*(xi + 0.165278957666387)*(xi + 0.477924949810445)*(xi + 0.738773865105507)*(xi + 0.919533908166451);
189 }
190
191 inline double lagrange_degree9_1(double xi) {
192 return (xi - 0.919533908166451)*(xi - 0.738773865105506)*(xi - 0.477924949810445)*(xi - 0.165278957666387)*(xi + 0.165278957666387)*(xi + 0.477924949810445)*(xi + 0.738773865105507)*(xi + 1.0)*(23.2581991069278*xi - 23.258199106928);
193 }
194
195 inline double lagrange_degree9_2(double xi) {
196 return (-30.2089539641755*xi + 30.2089539641758)*(xi - 0.919533908166451)*(xi - 0.738773865105506)*(xi - 0.477924949810445)*(xi - 0.165278957666387)*(xi + 0.165278957666387)*(xi + 0.477924949810445)*(xi + 0.919533908166451)*(xi + 1.0);
197 }
198
199 inline double lagrange_degree9_3(double xi) {
200 return (xi - 0.919533908166451)*(xi - 0.738773865105506)*(xi - 0.477924949810445)*(xi - 0.165278957666387)*(xi + 0.165278957666387)*(xi + 0.738773865105507)*(xi + 0.919533908166451)*(xi + 1.0)*(34.4250370034967*xi - 34.425037003497);
201 }
202
203 inline double lagrange_degree9_4(double xi) {
204 return (-36.4571961125312*xi + 36.4571961125316)*(xi - 0.919533908166451)*(xi - 0.738773865105506)*(xi - 0.477924949810445)*(xi - 0.165278957666387)*(xi + 0.477924949810445)*(xi + 0.738773865105507)*(xi + 0.919533908166451)*(xi + 1.0);
205 }
206
207 inline double lagrange_degree9_5(double xi) {
208 return (xi - 0.919533908166451)*(xi - 0.738773865105506)*(xi - 0.477924949810445)*(xi + 0.165278957666387)*(xi + 0.477924949810445)*(xi + 0.738773865105507)*(xi + 0.919533908166451)*(xi + 1.0)*(36.4571961125312*xi - 36.4571961125316);
209 }
210
211 inline double lagrange_degree9_6(double xi) {
212 return (-34.4250370034965*xi + 34.4250370034968)*(xi - 0.919533908166451)*(xi - 0.738773865105506)*(xi - 0.165278957666387)*(xi + 0.165278957666387)*(xi + 0.477924949810445)*(xi + 0.738773865105507)*(xi + 0.919533908166451)*(xi + 1.0);
213 }
214
215 inline double lagrange_degree9_7(double xi) {
216 return (xi - 0.919533908166451)*(xi - 0.477924949810445)*(xi - 0.165278957666387)*(xi + 0.165278957666387)*(xi + 0.477924949810445)*(xi + 0.738773865105507)*(xi + 0.919533908166451)*(xi + 1.0)*(30.2089539641749*xi - 30.2089539641752);
217 }
218
219 inline double lagrange_degree9_8(double xi) {
220 return (-23.2581991069258*xi + 23.258199106926)*(xi - 0.738773865105506)*(xi - 0.477924949810445)*(xi - 0.165278957666387)*(xi + 0.165278957666387)*(xi + 0.477924949810445)*(xi + 0.738773865105507)*(xi + 0.919533908166451)*(xi + 1.0);
221 }
222
223 inline double lagrange_degree9_9(double xi) {
224 return (xi - 0.738773865105506)*(xi - 0.477924949810445)*(xi - 0.165278957666387)*(xi + 0.165278957666387)*(xi + 0.477924949810445)*(xi + 0.738773865105507)*(xi + 0.919533908166451)*(xi + 1.0)*(9.49609374999766*xi - 8.73198019825036);
225 }
226
227 inline double lagrange_degree10_0(double xi) {
228 return 16.4023437499897*xi*(xi - 1.00000000000002)*(xi - 0.934001430408021)*(xi - 0.784483473663165)*(xi - 0.565235326996199)*(xi - 0.29575813558694)*(xi + 0.295758135586939)*(xi + 0.565235326996199)*(xi + 0.784483473663166)*(xi + 0.934001430408012);
229 }
230
231 inline double lagrange_degree10_1(double xi) {
232 return -40.2732656174519*xi*(xi - 1.00000000000002)*(xi - 0.934001430408021)*(xi - 0.784483473663165)*(xi - 0.565235326996199)*(xi - 0.29575813558694)*(xi + 0.295758135586939)*(xi + 0.565235326996199)*(xi + 0.784483473663166)*(xi + 1.0);
233 }
234
235 inline double lagrange_degree10_2(double xi) {
236 return 52.62659082067*xi*(xi - 1.00000000000002)*(xi - 0.934001430408021)*(xi - 0.784483473663165)*(xi - 0.565235326996199)*(xi - 0.29575813558694)*(xi + 0.295758135586939)*(xi + 0.565235326996199)*(xi + 0.934001430408012)*(xi + 1.0);
237 }
238
239 inline double lagrange_degree10_3(double xi) {
240 return -60.5836186612294*xi*(xi - 1.00000000000002)*(xi - 0.934001430408021)*(xi - 0.784483473663165)*(xi - 0.565235326996199)*(xi - 0.29575813558694)*(xi + 0.295758135586939)*(xi + 0.784483473663166)*(xi + 0.934001430408012)*(xi + 1.0);
241 }
242
243 inline double lagrange_degree10_4(double xi) {
244 return 65.1533465334198*xi*(xi - 1.00000000000002)*(xi - 0.934001430408021)*(xi - 0.784483473663165)*(xi - 0.565235326996199)*(xi - 0.29575813558694)*(xi + 0.565235326996199)*(xi + 0.784483473663166)*(xi + 0.934001430408012)*(xi + 1.0);
245 }
246
247 inline double lagrange_degree10_5(double xi) {
248 return (-66.650793650796*xi + 66.6507936507973)*(xi - 0.934001430408021)*(xi - 0.784483473663165)*(xi - 0.565235326996199)*(xi - 0.29575813558694)*(xi + 0.295758135586939)*(xi + 0.565235326996199)*(xi + 0.784483473663166)*(xi + 0.934001430408012)*(xi + 1.0);
249 }
250
251 inline double lagrange_degree10_6(double xi) {
252 return 65.1533465334186*xi*(xi - 1.00000000000002)*(xi - 0.934001430408021)*(xi - 0.784483473663165)*(xi - 0.565235326996199)*(xi + 0.295758135586939)*(xi + 0.565235326996199)*(xi + 0.784483473663166)*(xi + 0.934001430408012)*(xi + 1.0);
253 }
254
255 inline double lagrange_degree10_7(double xi) {
256 return -60.5836186612267*xi*(xi - 1.00000000000002)*(xi - 0.934001430408021)*(xi - 0.784483473663165)*(xi - 0.29575813558694)*(xi + 0.295758135586939)*(xi + 0.565235326996199)*(xi + 0.784483473663166)*(xi + 0.934001430408012)*(xi + 1.0);
257 }
258
259 inline double lagrange_degree10_8(double xi) {
260 return 52.6265908206628*xi*(xi - 1.00000000000002)*(xi - 0.934001430408021)*(xi - 0.565235326996199)*(xi - 0.29575813558694)*(xi + 0.295758135586939)*(xi + 0.565235326996199)*(xi + 0.784483473663166)*(xi + 0.934001430408012)*(xi + 1.0);
261 }
262
263 inline double lagrange_degree10_9(double xi) {
264 return -40.2732656174398*xi*(xi - 1.00000000000002)*(xi - 0.784483473663165)*(xi - 0.565235326996199)*(xi - 0.29575813558694)*(xi + 0.295758135586939)*(xi + 0.565235326996199)*(xi + 0.784483473663166)*(xi + 0.934001430408012)*(xi + 1.0);
265 }
266
267 inline double lagrange_degree10_10(double xi) {
268 return 16.402343749983*xi*(xi - 0.934001430408021)*(xi - 0.784483473663165)*(xi - 0.565235326996199)*(xi - 0.29575813558694)*(xi + 0.295758135586939)*(xi + 0.565235326996199)*(xi + 0.784483473663166)*(xi + 0.934001430408012)*(xi + 1.0);
269 }
270
271 } //namespace speckley
272

  ViewVC Help
Powered by ViewVC 1.1.26