aboutsummaryrefslogtreecommitdiff
path: root/src/input/d03faf.input.pamphlet
blob: 94b4ad325d2feef7fa056f3545c0c4ad5fa7f004 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
\documentclass{article}
\usepackage{axiom}
\begin{document}
\title{\$SPAD/src/input d03faf.input}
\author{The Axiom Team}
\maketitle
\begin{abstract}
\end{abstract}
\eject
\tableofcontents
\eject
\section{License}
<<license>>=
--Copyright The Numerical Algorithms Group Limited 1994.
@
<<*>>=
<<license>>
)cl all
showArrayValues true
showScalarValues true

xs := 0.0
xf := 1.0
l := 16
lbdcnd := 1
m := 32
n := 20
maxlm := 32
mdimf := m+1
ldimf := l+1
lwrk := 2*(n+1)*maxlm+3*l+3*m+4*n+6000
bdxs := new(mdimf,n+1,0.0)$Matrix DoubleFloat;
bdxf := new(mdimf,n+1,0.0)$Matrix DoubleFloat;
ys := 0.0
yf := 2*numeric(%pi)
mbdcnd := 0
bdys := new(ldimf,n+1,0.0)$Matrix DoubleFloat;
bdyf := new(ldimf,n+1,0.0)$Matrix DoubleFloat;
zs := 0.0
zf := numeric(%pi)/2
nbdcnd := 2
bdzs := new(ldimf,m+1,0.0)$Matrix DoubleFloat;
bdzf := new(ldimf,m+1,0.0)$Matrix DoubleFloat;
lambda := -2
ifail := 0

-- define grid points
dx := (xf-xs)/l
x := [[xs + (i-1)*dx for i in 1..l+1]] :: Matrix DoubleFloat;
dy := (yf-ys)/m
y := [[ys + (i-1)*dy for i in 1..m+1]] :: Matrix DoubleFloat;
dz := (zf-zs)/n
z := [[zs + (i-1)*dz for i in 1..n+1]] :: Matrix DoubleFloat;

f:=zeroMatrix(ldimf,mdimf,n+1)$M3D DFLOAT;
--speed up these loops by compiling
foo()==
 for k in 1..n+1 repeat
  for j in 1..m+1 repeat
    setelt!(f,1,j,k,sin(y(1,j))*cos(z(1,k)))
 for j in 1..m+1 repeat
  for i in 1..l+1 repeat
    setelt!(f,i,j,1,x(1,i)**4*sin(y(1,j)))
 for k in 2..n+1 repeat
  for j in 1..m+1 repeat
    for i in 2..l repeat
      setelt!(f,i,j,k,4*x(1,i)**2*(3-x(1,i)**2)*sin(y(1,j))*cos(z(1,k)))
 for j in 1..m+1 repeat
  for i in 1..l+1 repeat
    bdzf(i,j):=-x(1,i)**4*sin(y(1,j))
foo()
result:=d03faf(xs,xf,l,lbdcnd,bdxs,bdxf,ys,yf,m,mbdcnd,bdys,bdyf,_
zs,zf,n,nbdcnd,bdzs,bdzf,lambda,ldimf,mdimf,lwrk,f,ifail)
@
\eject
\begin{thebibliography}{99}
\bibitem{1} nothing
\end{thebibliography}
\end{document}