1 psi0 =
lambda x: 0.5 * x * ( x - 1.0 )
2 psi1 =
lambda x: ( 1.0 - x ) * ( 1.0 + x )
3 psi2 =
lambda x: 0.5 * x * ( 1.0 + x )
6 dpsi0 =
lambda x: x - 0.5
7 dpsi1 =
lambda x: -2.0 * x
8 dpsi2 =
lambda x: x + 0.5
9 dpsi = [dpsi0,dpsi1,dpsi2]
11 ddpsi0 =
lambda x: 1.0
12 ddpsi1 =
lambda x: -2.0
13 ddpsi2 =
lambda x: 1.0
14 ddpsi = [ddpsi0, ddpsi1, ddpsi2]
16 xs = [ -1.0 , 0.0 , 1.0 ]
17 pts = [ (xs[i],xs[j],xs[k])
for k
in range(3)
for j
in range(3)
for i
in range(3) ]
85 print ddpsi[i](pt[0])*ddpsi[j](pt[1])*psi[k](pt[2])
87 print ddpsi[i](pt[0])*dpsi[j](pt[1])*dpsi[k](pt[2])
89 print ddpsi[i](pt[0])*psi[j](pt[1])*ddpsi[k](pt[2])
93 print dpsi[i](pt[0])*ddpsi[j](pt[1])*dpsi[k](pt[2])
95 print dpsi[i](pt[0])*dpsi[j](pt[1])*ddpsi[k](pt[2])
103 print psi[i](pt[0])*ddpsi[j](pt[1])*ddpsi[k](pt[2])