Intrepid
http://trilinos.sandia.gov/packages/docs/r10.12/packages/intrepid/test/Discretization/Basis/HGRAD_HEX_Cn_FEM/testdata/maked.py
00001 psi0 = lambda x: 0.5 * x * ( x - 1.0 )
00002 psi1 = lambda x: ( 1.0 - x ) * ( 1.0 + x )
00003 psi2 = lambda x: 0.5 * x * ( 1.0 + x )
00004 psi = [psi0,psi1,psi2]
00005 
00006 dpsi0 = lambda x: x - 0.5
00007 dpsi1 = lambda x: -2.0 * x
00008 dpsi2 = lambda x: x + 0.5
00009 dpsi = [dpsi0,dpsi1,dpsi2]
00010 
00011 ddpsi0 = lambda x: 1.0
00012 ddpsi1 = lambda x: -2.0
00013 ddpsi2 = lambda x: 1.0
00014 ddpsi = [ddpsi0, ddpsi1, ddpsi2]
00015 
00016 xs = [ -1.0 , 0.0 , 1.0 ]
00017 pts = [ (xs[i],xs[j],xs[k]) for k in range(3) for j in range(3) for i in range(3) ]
00018 
00019 
00020 # This is D1
00021 #for k in range(3):
00022 #    for j in range(3):
00023 #        for i in range(3):
00024 #            for pt in pts:
00025 #                print dpsi[i](pt[0])*psi[j](pt[1])*psi[k](pt[2])
00026 #                print psi[i](pt[0])*dpsi[j](pt[1])*psi[k](pt[2])
00027 #                print psi[i](pt[0])*psi[j](pt[1])*dpsi[k](pt[2])
00028 
00029 # This is for D2
00030 #for k in range(3):
00031 #    for j in range(3):
00032 #        for i in range(3):
00033 #            for pt in pts:
00034 #                # (2,0,0)
00035 #                print ddpsi[i](pt[0])*psi[j](pt[1])*psi[k](pt[2])
00036 #                # (1,1,0)
00037 #                print dpsi[i](pt[0])*dpsi[j](pt[1])*psi[k](pt[2])
00038 #                # (1,0,1)
00039 #                print dpsi[i](pt[0])*psi[j](pt[1])*dpsi[k](pt[2])
00040 #                # (0,2,0)
00041 #                print psi[i](pt[0])*ddpsi[j](pt[1])*psi[k](pt[2])
00042 #                # (0,1,1)
00043 #                print psi[i](pt[0])*dpsi[j](pt[1])*dpsi[k](pt[2])
00044 #                # (0,0,2)
00045 #                print psi[i](pt[0])*psi[j](pt[1])*ddpsi[k](pt[2])
00046 
00047 # This is for D3
00048 #for k in range(3):
00049 #    for j in range(3):
00050 #        for i in range(3):
00051 #            for pt in pts:
00052 #                # (3,0,0)
00053 #                print 0.0
00054 #                # (2,1,0)
00055 #                print ddpsi[i](pt[0])*dpsi[j](pt[1])*psi[k](pt[2])
00056 #                # (2,0,1)
00057 #                print ddpsi[i](pt[0])*psi[j](pt[1])*dpsi[k](pt[2])
00058 #                # (1,2,0)
00059 #                print dpsi[i](pt[0])*ddpsi[j](pt[1])*psi[k](pt[2])
00060 #                # (1,1,1)
00061 #                print dpsi[i](pt[0])*dpsi[j](pt[1])*dpsi[k](pt[2])
00062 #                # (1,0,2)
00063 #                print dpsi[i](pt[0])*psi[j](pt[1])*ddpsi[k](pt[2])
00064 #                # (0,3,0)
00065 #                print 0.0
00066 #                # (0,2,1)
00067 #                print psi[i](pt[0])*ddpsi[j](pt[1])*dpsi[k](pt[2])
00068 #                # (0,1,2)
00069 #                print psi[i](pt[0])*dpsi[j](pt[1])*ddpsi[k](pt[2])
00070 #                # (0,0,3)
00071 #                print 0.0
00072                 
00073 # This is for D4                                
00074 for k in range(3):
00075     for j in range(3):
00076         for i in range(3):
00077             for pt in pts:
00078                 # (4,0,0)
00079                 print 0.0
00080                 # (3,1,0)
00081                 print 0.0
00082                 # (3,0,1)
00083                 print 0.0
00084                 # (2,2,0)
00085                 print ddpsi[i](pt[0])*ddpsi[j](pt[1])*psi[k](pt[2])
00086                 # (2,1,1)
00087                 print ddpsi[i](pt[0])*dpsi[j](pt[1])*dpsi[k](pt[2])
00088                 # (2,0,2)
00089                 print ddpsi[i](pt[0])*psi[j](pt[1])*ddpsi[k](pt[2])
00090                 # (1,3,0)
00091                 print 0.0
00092                 # (1,2,1)
00093                 print dpsi[i](pt[0])*ddpsi[j](pt[1])*dpsi[k](pt[2])
00094                 # (1,1,2)
00095                 print dpsi[i](pt[0])*dpsi[j](pt[1])*ddpsi[k](pt[2])
00096                 # (1,0,3)
00097                 print 0.0
00098                 # (0,4,0)
00099                 print 0.0
00100                 # (0,3,1)
00101                 print 0.0
00102                 # (0,2,2)
00103                 print psi[i](pt[0])*ddpsi[j](pt[1])*ddpsi[k](pt[2])
00104                 # (0,1,3)
00105                 print 0.0
00106                 # (0,0,4)
00107                 print 0.0
00108                 
00109