1 ! ********
This file generated from pmlUpdate.h
using pml.maple *****
3 c **
NOTE: run pml.maple to take
this file and generate
the pml.h file
4 c restart; read
"pml.maple";
5 c ====================================================================================================
7 c OPTION : fullUpdate or partialUpdate
8 c 2 : 2 or 3
space dimensions
9 c ====================================================================================================
10 #beginMacro update4x2d(va,wa, m,OPTION)
13 ! (
u(
n+1) - 2*
u +
u(
n-1))/dt^2 = u_tt + (dt^4/12)*u_tttt + ...
15 ! [
u(
n)-
u(
n-1)]/dt = u_t + (dt/2)*u_tt + O(dt^2)
17 ! u_tt = Delta
u - v_x - w
18 ! u_tttt = Delta u_tt - v_xtt - wtt
23 vxx = va xx42r(i1,i2,i3,
m)
24 vxxx= va xxx22r(i1,i2,i3,
m)
25 vxyy= va xyy22r(i1,i2,i3,
m)
28 wx = wa x42r(i1,i2,i3,
m)
29 wxx = wa xx42r(i1,i2,i3,
m)
32 uxx= uxx42r(i1,i2,i3,
m)
33 uxxx=uxxx22r(i1,i2,i3,
m)
34 uxyy=uxyy22r(i1,i2,i3,
m)
36 uxxxx=uxxxx22r(i1,i2,i3,
m)
37 uxxyy=uxxyy22r(i1,i2,i3,
m)
39 uLap = uLaplacian42r(i1,i2,i3,
m)
41 ! --- these change in 3
D ---
43 uyyyy=uyyyy22r(i1,i2,i3,
m)
44 uLapSq=uxxxx +2.*uxxyy +uyyyy
49 uLapSq=uLapSq23r(i1,i2,i3,
m)
50 uxxx=uxxx23r(i1,i2,i3,
m)
51 uxxxx=uxxx23r(i1,i2,i3,
m)
52 vxxx= va xxx23r(i1,i2,i3,
m)
54 uLapx = uxxx+uxyy+uxxx
55 uLapxx= uxxxx+uxxyy+uxxxx
61 ut = (
u(i1,i2,i3,
m)-um(i1,i2,i3,
m))/dt - (.5*dt*csq)*( uLap - vx - w )
62 uxt = (
ux-umx42r(i1,i2,i3,
m))/dt - (.5*dt*csq)*( uLapx - vxx - wx )
63 uxxt= (
uxx-umxx42r(i1,i2,i3,
m))/dt - (.5*dt*csq)*( uLapxx - vxxx - wxx )
64 ! *** uxxxt= (uxxx-umxxx42r(i1,i2,i3,
m))/dt ! only need to first
order in dt
65 ! *** uxyyt= (uxyy-umxyy42r(i1,i2,i3,
m))/dt ! only need to first
order in dt
66 ! *** uxxxxt= (uxxxx-umxxxx42r(i1,i2,i3,
m))/dt ! only need to first
order in dt
67 ! *** uxxyyt= (uxxyy-umxxyy42r(i1,i2,i3,
m))/dt ! only need to first
order in dt
69 vt = sigma1*( -
v +
ux )
70 vxt = sigma1*( -vx +
uxx ) + sigma1x*( -
v +
ux )
71 vxtt = sigma1*( -vxt + uxxt ) + sigma1x*( -
vt +
uxt )
73 wt = sigma1*( -w -vx +
uxx )
74 wtt = sigma1*( -wt -vxt + uxxt )
76 #If #OPTION == "fullUpdate"
77 un(i1,i2,i3,
m)=2.*
u(i1,i2,i3,
m)-um(i1,i2,i3,
m) \
78 + cdtsq*( uLap - vx -w ) \
79 + cdt4Over12*( uLapSq - vLapx - wa Laplacian42r(i1,i2,i3,
m) - vxtt - wtt )
80 #Elif #OPTION ==
"partialUpdate"
81 ! on an edge just add
the other terms
82 un(i1,i2,i3,
m)=un(i1,i2,i3,
m)\
84 + cdt4Over12*( - vLapx - wa Laplacian42r(i1,i2,i3,
m) - vxtt - wtt )
89 ! auxilliary variables
90 ! v_t = sigma1*( -
v + u_x )
91 ! (
v(
n+1)-
v(
n-1))/(2*dt) = v_t + (dt^2/3)*
vttt
92 !
vttt = sigma1*( -v_tt + u_xtt )
94 uxtt = csq*( uLapx - vxx -wx )
95 uxxtt = csq*( uLapxx - vxxx -wxx )
98 ! *** uxttt = csq*( uxxxt +uxyyt - vxxt -wxt )
99 ! *** uxxttt = csq*( uxxxxt+uxxyyt - vxxxt -wxxt )
103 vtttt = 0. ! *** sigma1*( -
vttt + uxttt)
106 ! va
n(i1,i2,i3,
m)=va
m(i1,i2,i3,
m)+(2.*dt)*(
vt + (dt**2/6.)*
vttt )
107 va
n(i1,i2,i3,
m)=va(i1,i2,i3,
m)+(dt)*(
vt + dt*( .5*
vtt + dt*( (1./6.)*
vttt + dt*( (1./24.)*vtttt ) ) ) )
108 ! write(*,'(" i1,i2=",2i3,"
vt,
vtt,
vttt=",3e10.2,"
v,
ux,
uxt,uxtt=",4e10.2)') i1,i2,vt,vtt,vttt,v,ux,uxt,uxtt
110 ! w_t = sigma1*( -w -vx +
uxx )
112 wttt = sigma1*( -wtt -vxtt + uxxtt )
113 wtttt = 0. ! **** sigma1*( -wttt -vxttt + uxxttt )
114 ! wan(i1,i2,i3,
m)=wam(i1,i2,i3,
m)+(2.*dt)*( wt + (dt**2/6.)*wttt )
115 wa
n(i1,i2,i3,
m)=wa(i1,i2,i3,
m)+(dt)*( wt + dt*( .5*wtt + dt*( (1./6.)*wttt + dt*( (1./24.)*wtttt ) ) ) )
120 ! ********
This file generated from pmlUpdate.h
using pml.maple *****
122 c **
NOTE: run pml.maple to take
this file and generate
the pml.h file
123 c restart; read
"pml.maple";
124 c ====================================================================================================
126 c OPTION : fullUpdate or partialUpdate
127 c 2 : 2 or 3
space dimensions
128 c ====================================================================================================
129 #beginMacro update4y2d(va,wa, m,OPTION)
132 ! (
u(
n+1) - 2*
u +
u(
n-1))/dt^2 = u_tt + (dt^4/12)*u_tttt + ...
134 ! [
u(
n)-
u(
n-1)]/dt = u_t + (dt/2)*u_tt + O(dt^2)
136 ! u_tt = Delta
u - v_y - w
137 ! u_tttt = Delta u_tt - v_ytt - wtt
141 vy = va y42r(i1,i2,i3,
m)
142 vyy = va yy42r(i1,i2,i3,
m)
143 vyyy= va yyy22r(i1,i2,i3,
m)
144 vxxy= va xxy22r(i1,i2,i3,
m)
147 wy = wa y42r(i1,i2,i3,
m)
148 wyy = wa yy42r(i1,i2,i3,
m)
150 uy= uy42r(i1,i2,i3,
m)
151 uyy= uyy42r(i1,i2,i3,
m)
152 uyyy=uyyy22r(i1,i2,i3,
m)
153 uxxy=uxxy22r(i1,i2,i3,
m)
155 uyyyy=uyyyy22r(i1,i2,i3,
m)
156 uxxyy=uxxyy22r(i1,i2,i3,
m)
158 uLap = uLaplacian42r(i1,i2,i3,
m)
160 ! --- these change in 3
D ---
162 uxxxx=uxxxx22r(i1,i2,i3,
m)
163 uLapSq=uyyyy +2.*uxxyy +uxxxx
168 uLapSq=uLapSq23r(i1,i2,i3,
m)
169 uyyy=uyyy23r(i1,i2,i3,
m)
170 uyyyy=uyyy23r(i1,i2,i3,
m)
171 vyyy= va yyy23r(i1,i2,i3,
m)
173 uLapy = uyyy+uxxy+uyyy
174 uLapyy= uyyyy+uxxyy+uyyyy
180 ut = (
u(i1,i2,i3,
m)-um(i1,i2,i3,
m))/dt - (.5*dt*csq)*( uLap - vy - w )
181 uyt = (
uy-umy42r(i1,i2,i3,
m))/dt - (.5*dt*csq)*( uLapy - vyy - wy )
182 uyyt= (uyy-umyy42r(i1,i2,i3,
m))/dt - (.5*dt*csq)*( uLapyy - vyyy - wyy )
183 ! *** uyyyt= (uyyy-umyyy42r(i1,i2,i3,
m))/dt ! onlx need to first
order in dt
184 ! *** uxxyt= (uxxy-umxxy42r(i1,i2,i3,
m))/dt ! onlx need to first
order in dt
185 ! *** uyyyyt= (uyyyy-umyyyy42r(i1,i2,i3,
m))/dt ! onlx need to first
order in dt
186 ! *** uxxyyt= (uxxyy-umxxyy42r(i1,i2,i3,
m))/dt ! onlx need to first
order in dt
188 vt = sigma2*( -v +
uy )
189 vyt = sigma2*( -vy + uyy ) + sigma2y*( -v +
uy )
190 vytt = sigma2*( -vyt + uyyt ) + sigma2y*( -vt +
uyt )
192 wt = sigma2*( -w -vy + uyy )
193 wtt = sigma2*( -wt -vyt + uyyt )
195 #If #OPTION == "fullUpdate"
196 un(i1,i2,i3,
m)=2.*
u(i1,i2,i3,
m)-um(i1,i2,i3,
m) \
197 + cdtsq*( uLap - vy -w ) \
198 + cdt4Over12*( uLapSq - vLapy - wa Laplacian42r(i1,i2,i3,
m) - vytt - wtt )
199 #Elif #OPTION ==
"partialUpdate"
200 ! on an edge just add
the other terms
201 un(i1,i2,i3,
m)=un(i1,i2,i3,
m)\
202 + cdtsq*( - vy -w ) \
203 + cdt4Over12*( - vLapy - wa Laplacian42r(i1,i2,i3,
m) - vytt - wtt )
208 ! auyilliarx variables
209 ! v_t = sigma2*( -v + u_y )
210 ! (
v(
n+1)-
v(
n-1))/(2*dt) = v_t + (dt^2/3)*vttt
211 ! vttt = sigma2*( -v_tt + u_ytt )
213 uytt = csq*( uLapy - vyy -wy )
214 uyytt = csq*( uLapyy - vyyy -wyy )
217 ! *** uyttt = csq*( uyyyt +uxxyt - vyyt -wyt )
218 ! *** uyyttt = csq*( uyyyyt+uxxyyt - vyyyt -wyyt )
220 vtt = sigma2*( -vt +
uyt )
221 vttt = sigma2*( -vtt + uytt )
222 vtttt = 0. ! *** sigma2*( -vttt + uyttt)
224 ! (v(
n+1)-v(
n-1))/(2dt) = vt + (dt^2/6)*vttt
225 ! va
n(i1,i2,i3,
m)=va
m(i1,i2,i3,
m)+(2.*dt)*( vt + (dt**2/6.)*vttt )
226 va
n(i1,i2,i3,
m)=va(i1,i2,i3,
m)+(dt)*( vt + dt*( .5*vtt + dt*( (1./6.)*vttt + dt*( (1./24.)*vtttt ) ) ) )
227 ! write(*,'(" i1,i2=",2i3," vt,vtt,vttt=",3e10.2," v,
uy,
uyt,uytt=",4e10.2)') i1,i2,vt,vtt,vttt,v,uy,uyt,uytt
229 ! w_t = sigma2*( -w -vy + uyy )
231 wttt = sigma2*( -wtt -vytt + uyytt )
232 wtttt = 0. ! **** sigma2*( -wttt -vyttt + uyyttt )
233 ! wan(i1,i2,i3,
m)=wam(i1,i2,i3,
m)+(2.*dt)*( wt + (dt**2/6.)*wttt )
234 wa
n(i1,i2,i3,
m)=wa(i1,i2,i3,
m)+(dt)*( wt + dt*( .5*wtt + dt*( (1./6.)*wttt + dt*( (1./24.)*wtttt ) ) ) )
239 ! ********
This file generated from pmlUpdate.h
using pml.maple *****
241 c **
NOTE: run pml.maple to take
this file and generate
the pml.h file
242 c restart; read
"pml.maple";
243 c ====================================================================================================
245 c OPTION : fullUpdate or partialUpdate
246 c 3 : 2 or 3
space dimensions
247 c ====================================================================================================
248 #beginMacro update4x3d(va,wa, m,OPTION)
251 ! (
u(
n+1) - 2*
u +
u(
n-1))/dt^2 = u_tt + (dt^4/12)*u_tttt + ...
253 ! [
u(
n)-
u(
n-1)]/dt = u_t + (dt/2)*u_tt + O(dt^2)
255 ! u_tt = Delta
u - v_x - w
256 ! u_tttt = Delta u_tt - v_xtt - wtt
260 vx = va x43r(i1,i2,i3,
m)
261 vxx = va xx43r(i1,i2,i3,
m)
262 vxxx= va xxx23r(i1,i2,i3,
m)
263 vxyy= va xyy23r(i1,i2,i3,
m)
266 wx = wa x43r(i1,i2,i3,
m)
267 wxx = wa xx43r(i1,i2,i3,
m)
269 ux= ux43r(i1,i2,i3,
m)
270 uxx= uxx43r(i1,i2,i3,
m)
271 uxxx=uxxx23r(i1,i2,i3,
m)
272 uxyy=uxyy23r(i1,i2,i3,
m)
274 uxxxx=uxxxx23r(i1,i2,i3,
m)
275 uxxyy=uxxyy23r(i1,i2,i3,
m)
277 uLap = uLaplacian43r(i1,i2,i3,
m)
279 ! --- these change in 3
D ---
281 uyyyy=uyyyy23r(i1,i2,i3,
m)
282 uLapSq=uxxxx +2.*uxxyy +uyyyy
287 uLapSq=uLapSq23r(i1,i2,i3,
m)
288 uxzz=uxzz23r(i1,i2,i3,
m)
289 uxxzz=uxzz23r(i1,i2,i3,
m)
290 vxzz= va xzz23r(i1,i2,i3,
m)
292 uLapx = uxxx+uxyy+uxzz
293 uLapxx= uxxxx+uxxyy+uxxzz
299 ut = (
u(i1,i2,i3,
m)-um(i1,i2,i3,
m))/dt - (.5*dt*csq)*( uLap - vx - w )
300 uxt = ( ux-umx43r(i1,i2,i3,
m))/dt - (.5*dt*csq)*( uLapx - vxx - wx )
301 uxxt= (
uxx-umxx43r(i1,i2,i3,
m))/dt - (.5*dt*csq)*( uLapxx - vxxx - wxx )
302 ! *** uxxxt= (uxxx-umxxx43r(i1,i2,i3,
m))/dt ! only need to first
order in dt
303 ! *** uxyyt= (uxyy-umxyy43r(i1,i2,i3,
m))/dt ! only need to first
order in dt
304 ! *** uxxxxt= (uxxxx-umxxxx43r(i1,i2,i3,
m))/dt ! only need to first
order in dt
305 ! *** uxxyyt= (uxxyy-umxxyy43r(i1,i2,i3,
m))/dt ! only need to first
order in dt
307 vt = sigma1*( -v + ux )
308 vxt = sigma1*( -vx +
uxx ) + sigma1x*( -v + ux )
309 vxtt = sigma1*( -vxt + uxxt ) + sigma1x*( -vt + uxt )
311 wt = sigma1*( -w -vx +
uxx )
312 wtt = sigma1*( -wt -vxt + uxxt )
314 #If #OPTION == "fullUpdate"
315 un(i1,i2,i3,
m)=2.*
u(i1,i2,i3,
m)-um(i1,i2,i3,
m) \
316 + cdtsq*( uLap - vx -w ) \
317 + cdt4Over12*( uLapSq - vLapx - wa Laplacian43r(i1,i2,i3,
m) - vxtt - wtt )
318 #Elif #OPTION ==
"partialUpdate"
319 ! on an edge just add
the other terms
320 un(i1,i2,i3,
m)=un(i1,i2,i3,
m)\
321 + cdtsq*( - vx -w ) \
322 + cdt4Over12*( - vLapx - wa Laplacian43r(i1,i2,i3,
m) - vxtt - wtt )
327 ! auxilliary variables
328 ! v_t = sigma1*( -v + u_x )
329 ! (
v(
n+1)-
v(
n-1))/(2*dt) = v_t + (dt^2/3)*vttt
330 ! vttt = sigma1*( -v_tt + u_xtt )
332 uxtt = csq*( uLapx - vxx -wx )
333 uxxtt = csq*( uLapxx - vxxx -wxx )
336 ! *** uxttt = csq*( uxxxt +uxyyt - vxxt -wxt )
337 ! *** uxxttt = csq*( uxxxxt+uxxyyt - vxxxt -wxxt )
339 vtt = sigma1*( -vt + uxt )
340 vttt = sigma1*( -vtt + uxtt )
341 vtttt = 0. ! *** sigma1*( -vttt + uxttt)
343 ! (v(
n+1)-v(
n-1))/(2dt) = vt + (dt^2/6)*vttt
344 ! va
n(i1,i2,i3,
m)=va
m(i1,i2,i3,
m)+(2.*dt)*( vt + (dt**2/6.)*vttt )
345 va
n(i1,i2,i3,
m)=va(i1,i2,i3,
m)+(dt)*( vt + dt*( .5*vtt + dt*( (1./6.)*vttt + dt*( (1./24.)*vtttt ) ) ) )
346 ! write(*,'(" i1,i2=",2i3," vt,vtt,vttt=",3e10.2," v,ux,uxt,uxtt=",4e10.2)') i1,i2,vt,vtt,vttt,v,ux,uxt,uxtt
348 ! w_t = sigma1*( -w -vx +
uxx )
350 wttt = sigma1*( -wtt -vxtt + uxxtt )
351 wtttt = 0. ! **** sigma1*( -wttt -vxttt + uxxttt )
352 ! wan(i1,i2,i3,
m)=wam(i1,i2,i3,
m)+(2.*dt)*( wt + (dt**2/6.)*wttt )
353 wa
n(i1,i2,i3,
m)=wa(i1,i2,i3,
m)+(dt)*( wt + dt*( .5*wtt + dt*( (1./6.)*wttt + dt*( (1./24.)*wtttt ) ) ) )
358 ! ********
This file generated from pmlUpdate.h
using pml.maple *****
360 c **
NOTE: run pml.maple to take
this file and generate
the pml.h file
361 c restart; read
"pml.maple";
362 c ====================================================================================================
364 c OPTION : fullUpdate or partialUpdate
365 c 3 : 2 or 3
space dimensions
366 c ====================================================================================================
367 #beginMacro update4y3d(va,wa, m,OPTION)
370 ! (
u(
n+1) - 2*
u +
u(
n-1))/dt^2 = u_tt + (dt^4/12)*u_tttt + ...
372 ! [
u(
n)-
u(
n-1)]/dt = u_t + (dt/2)*u_tt + O(dt^2)
374 ! u_tt = Delta
u - v_y - w
375 ! u_tttt = Delta u_tt - v_ytt - wtt
379 vy = va y43r(i1,i2,i3,
m)
380 vyy = va yy43r(i1,i2,i3,
m)
381 vyyy= va yyy23r(i1,i2,i3,
m)
382 vyzz= va yzz23r(i1,i2,i3,
m)
385 wy = wa y43r(i1,i2,i3,
m)
386 wyy = wa yy43r(i1,i2,i3,
m)
388 uy= uy43r(i1,i2,i3,
m)
389 uyy= uyy43r(i1,i2,i3,
m)
390 uyyy=uyyy23r(i1,i2,i3,
m)
391 uyzz=uyzz23r(i1,i2,i3,
m)
393 uyyyy=uyyyy23r(i1,i2,i3,
m)
394 uyyzz=uyyzz23r(i1,i2,i3,
m)
396 uLap = uLaplacian43r(i1,i2,i3,
m)
398 ! --- these change in 3
D ---
400 uzzzz=uzzzz23r(i1,i2,i3,
m)
401 uLapSq=uyyyy +2.*uyyzz +uzzzz
406 uLapSq=uLapSq23r(i1,i2,i3,
m)
407 uxxy=uxxy23r(i1,i2,i3,
m)
408 uxxyy=uxxy23r(i1,i2,i3,
m)
409 vxxy= va xxy23r(i1,i2,i3,
m)
411 uLapy = uyyy+uyzz+uxxy
412 uLapyy= uyyyy+uyyzz+uxxyy
418 ut = (
u(i1,i2,i3,
m)-um(i1,i2,i3,
m))/dt - (.5*dt*csq)*( uLap - vy - w )
419 uyt = ( uy-umy43r(i1,i2,i3,
m))/dt - (.5*dt*csq)*( uLapy - vyy - wy )
420 uyyt= (uyy-umyy43r(i1,i2,i3,
m))/dt - (.5*dt*csq)*( uLapyy - vyyy - wyy )
421 ! *** uyyyt= (uyyy-umyyy43r(i1,i2,i3,
m))/dt ! onlz need to first
order in dt
422 ! *** uyzzt= (uyzz-umyzz43r(i1,i2,i3,
m))/dt ! onlz need to first
order in dt
423 ! *** uyyyyt= (uyyyy-umyyyy43r(i1,i2,i3,
m))/dt ! onlz need to first
order in dt
424 ! *** uyyzzt= (uyyzz-umyyzz43r(i1,i2,i3,
m))/dt ! onlz need to first
order in dt
426 vt = sigma2*( -v + uy )
427 vyt = sigma2*( -vy + uyy ) + sigma2y*( -v + uy )
428 vytt = sigma2*( -vyt + uyyt ) + sigma2y*( -vt + uyt )
430 wt = sigma2*( -w -vy + uyy )
431 wtt = sigma2*( -wt -vyt + uyyt )
433 #If #OPTION == "fullUpdate"
434 un(i1,i2,i3,
m)=2.*
u(i1,i2,i3,
m)-um(i1,i2,i3,
m) \
435 + cdtsq*( uLap - vy -w ) \
436 + cdt4Over12*( uLapSq - vLapy - wa Laplacian43r(i1,i2,i3,
m) - vytt - wtt )
437 #Elif #OPTION ==
"partialUpdate"
438 ! on an edge just add
the other terms
439 un(i1,i2,i3,
m)=un(i1,i2,i3,
m)\
440 + cdtsq*( - vy -w ) \
441 + cdt4Over12*( - vLapy - wa Laplacian43r(i1,i2,i3,
m) - vytt - wtt )
446 ! auyilliarz variables
447 ! v_t = sigma2*( -v + u_y )
448 ! (
v(
n+1)-
v(
n-1))/(2*dt) = v_t + (dt^2/3)*vttt
449 ! vttt = sigma2*( -v_tt + u_ytt )
451 uytt = csq*( uLapy - vyy -wy )
452 uyytt = csq*( uLapyy - vyyy -wyy )
455 ! *** uyttt = csq*( uyyyt +uyzzt - vyyt -wyt )
456 ! *** uyyttt = csq*( uyyyyt+uyyzzt - vyyyt -wyyt )
458 vtt = sigma2*( -vt + uyt )
459 vttt = sigma2*( -vtt + uytt )
460 vtttt = 0. ! *** sigma2*( -vttt + uyttt)
462 ! (v(
n+1)-v(
n-1))/(2dt) = vt + (dt^2/6)*vttt
463 ! va
n(i1,i2,i3,
m)=va
m(i1,i2,i3,
m)+(2.*dt)*( vt + (dt**2/6.)*vttt )
464 va
n(i1,i2,i3,
m)=va(i1,i2,i3,
m)+(dt)*( vt + dt*( .5*vtt + dt*( (1./6.)*vttt + dt*( (1./24.)*vtttt ) ) ) )
465 ! write(*,'(" i1,i2=",2i3," vt,vtt,vttt=",3e10.2," v,uy,uyt,uytt=",4e10.2)') i1,i2,vt,vtt,vttt,v,uy,uyt,uytt
467 ! w_t = sigma2*( -w -vy + uyy )
469 wttt = sigma2*( -wtt -vytt + uyytt )
470 wtttt = 0. ! **** sigma2*( -wttt -vyttt + uyyttt )
471 ! wan(i1,i2,i3,
m)=wam(i1,i2,i3,
m)+(2.*dt)*( wt + (dt**2/6.)*wttt )
472 wa
n(i1,i2,i3,
m)=wa(i1,i2,i3,
m)+(dt)*( wt + dt*( .5*wtt + dt*( (1./6.)*wttt + dt*( (1./24.)*wtttt ) ) ) )
477 ! ********
This file generated from pmlUpdate.h
using pml.maple *****
479 c **
NOTE: run pml.maple to take
this file and generate
the pml.h file
480 c restart; read
"pml.maple";
481 c ====================================================================================================
483 c OPTION : fullUpdate or partialUpdate
484 c 3 : 2 or 3
space dimensions
485 c ====================================================================================================
486 #beginMacro update4z3d(va,wa, m,OPTION)
489 ! (
u(
n+1) - 2*
u +
u(
n-1))/dt^2 = u_tt + (dt^4/12)*u_tttt + ...
491 ! [
u(
n)-
u(
n-1)]/dt = u_t + (dt/2)*u_tt + O(dt^2)
493 ! u_tt = Delta
u - v_z - w
494 ! u_tttt = Delta u_tt - v_ztt - wtt
498 vz = va z43r(i1,i2,i3,
m)
499 vzz = va zz43r(i1,i2,i3,
m)
500 vzzz= va zzz23r(i1,i2,i3,
m)
501 vxxz= va xxz23r(i1,i2,i3,
m)
504 wz = wa z43r(i1,i2,i3,
m)
505 wzz = wa zz43r(i1,i2,i3,
m)
507 uz= uz43r(i1,i2,i3,
m)
508 uzz= uzz43r(i1,i2,i3,
m)
509 uzzz=uzzz23r(i1,i2,i3,
m)
510 uxxz=uxxz23r(i1,i2,i3,
m)
512 uzzzz=uzzzz23r(i1,i2,i3,
m)
513 uxxzz=uxxzz23r(i1,i2,i3,
m)
515 uLap = uLaplacian43r(i1,i2,i3,
m)
517 ! --- these change in 3
D ---
519 uxxxx=uxxxx23r(i1,i2,i3,
m)
520 uLapSq=uzzzz +2.*uxxzz +uxxxx
525 uLapSq=uLapSq23r(i1,i2,i3,
m)
526 uyyz=uyyz23r(i1,i2,i3,
m)
527 uyyzz=uyyz23r(i1,i2,i3,
m)
528 vyyz= va yyz23r(i1,i2,i3,
m)
530 uLapz = uzzz+uxxz+uyyz
531 uLapzz= uzzzz+uxxzz+uyyzz
537 ut = (
u(i1,i2,i3,
m)-um(i1,i2,i3,
m))/dt - (.5*dt*csq)*( uLap - vz - w )
538 uzt = (
uz-umz43r(i1,i2,i3,
m))/dt - (.5*dt*csq)*( uLapz - vzz - wz )
539 uzzt= (uzz-umzz43r(i1,i2,i3,
m))/dt - (.5*dt*csq)*( uLapzz - vzzz - wzz )
540 ! *** uzzzt= (uzzz-umzzz43r(i1,i2,i3,
m))/dt ! onlx need to first
order in dt
541 ! *** uxxzt= (uxxz-umxxz43r(i1,i2,i3,
m))/dt ! onlx need to first
order in dt
542 ! *** uzzzzt= (uzzzz-umzzzz43r(i1,i2,i3,
m))/dt ! onlx need to first
order in dt
543 ! *** uxxzzt= (uxxzz-umxxzz43r(i1,i2,i3,
m))/dt ! onlx need to first
order in dt
545 vt = sigma3*( -v +
uz )
546 vzt = sigma3*( -vz + uzz ) + sigma3z*( -v +
uz )
547 vztt = sigma3*( -vzt + uzzt ) + sigma3z*( -vt +
uzt )
549 wt = sigma3*( -w -vz + uzz )
550 wtt = sigma3*( -wt -vzt + uzzt )
552 #If #OPTION == "fullUpdate"
553 un(i1,i2,i3,
m)=2.*
u(i1,i2,i3,
m)-um(i1,i2,i3,
m) \
554 + cdtsq*( uLap - vz -w ) \
555 + cdt4Over12*( uLapSq - vLapz - wa Laplacian43r(i1,i2,i3,
m) - vztt - wtt )
556 #Elif #OPTION ==
"partialUpdate"
557 ! on an edge just add
the other terms
558 un(i1,i2,i3,
m)=un(i1,i2,i3,
m)\
559 + cdtsq*( - vz -w ) \
560 + cdt4Over12*( - vLapz - wa Laplacian43r(i1,i2,i3,
m) - vztt - wtt )
565 ! auzilliarx variables
566 ! v_t = sigma3*( -v + u_z )
567 ! (
v(
n+1)-
v(
n-1))/(2*dt) = v_t + (dt^2/3)*vttt
568 ! vttt = sigma3*( -v_tt + u_ztt )
570 uztt = csq*( uLapz - vzz -wz )
571 uzztt = csq*( uLapzz - vzzz -wzz )
574 ! *** uzttt = csq*( uzzzt +uxxzt - vzzt -wzt )
575 ! *** uzzttt = csq*( uzzzzt+uxxzzt - vzzzt -wzzt )
577 vtt = sigma3*( -vt +
uzt )
578 vttt = sigma3*( -vtt + uztt )
579 vtttt = 0. ! *** sigma3*( -vttt + uzttt)
581 ! (v(
n+1)-v(
n-1))/(2dt) = vt + (dt^2/6)*vttt
582 ! va
n(i1,i2,i3,
m)=va
m(i1,i2,i3,
m)+(2.*dt)*( vt + (dt**2/6.)*vttt )
583 va
n(i1,i2,i3,
m)=va(i1,i2,i3,
m)+(dt)*( vt + dt*( .5*vtt + dt*( (1./6.)*vttt + dt*( (1./24.)*vtttt ) ) ) )
584 ! write(*,'(" i1,i2=",2i3," vt,vtt,vttt=",3e10.2," v,
uz,
uzt,uztt=",4e10.2)') i1,i2,vt,vtt,vttt,v,uz,uzt,uztt
586 ! w_t = sigma3*( -w -vz + uzz )
588 wttt = sigma3*( -wtt -vztt + uzztt )
589 wtttt = 0. ! **** sigma3*( -wttt -vzttt + uzzttt )
590 ! wan(i1,i2,i3,
m)=wam(i1,i2,i3,
m)+(2.*dt)*( wt + (dt**2/6.)*wttt )
591 wa
n(i1,i2,i3,
m)=wa(i1,i2,i3,
m)+(dt)*( wt + dt*( .5*wtt + dt*( (1./6.)*wttt + dt*( (1./24.)*wtttt ) ) ) )