# Diff of /trunk/finley/test/python/SimpleSolve.py

revision 104 by jgs, Fri Dec 17 07:43:12 2004 UTC revision 108 by jgs, Thu Jan 27 06:21:59 2005 UTC
# Line 47  x=e.getX() Line 47  x=e.getX()
47  print "norm_u_ex=u_ex.Lsup():"  print "norm_u_ex=u_ex.Lsup():"
48  norm_u_ex=u_ex.Lsup()  norm_u_ex=u_ex.Lsup()
49
50    print "\nGenerate a test solution (1)"
51    print "----------------------------"
52
53  print "mypde=LinearPDE( A=[[1.,0.8],[0.4,1.]], D=alpha, Y=alpha, domain=mydomain)"  print "mypde=LinearPDE( A=[[1.,0.8],[0.4,1.]], D=alpha, Y=alpha, domain=mydomain)"
54  mypde=LinearPDE(mydomain)  mypde=LinearPDE(mydomain)
55  mypde.setDebugOn()  mypde.setDebugOn()
56  mypde.setValue(A=[[1.,0.8],[0.4,1.]],D=alpha,Y=alpha)  mypde.setValue(A=[[1.,0.8],[0.4,1.]],D=alpha,Y=alpha)
mypde.getOperator().saveMM("t.msh")
57
58  # generate a test solution 1  print "mypde.checkSymmetry()"
59    print mypde.checkSymmetry()
print "\nGenerate a test solution (1)"
print "----------------------------"
60
61  print "\nIterative Solver (1)=>"  print "\nIterative Solver (1)=>"

62  u_i=mypde.getSolution()  u_i=mypde.getSolution()
63
64  print "\nDirect Solver (1)=>"  print "\nDirect Solver (1)=>"

65  mypde.setSolverMethod(DIRECT)  mypde.setSolverMethod(DIRECT)
66  u_d=mypde.getSolution()  u_d=mypde.getSolution()
67
# Line 88  msk=x[0].whereZero()+(x[0]-1.).whereZero Line 86  msk=x[0].whereZero()+(x[0]-1.).whereZero
86
87  print "mypde=LinearPDE(A=[[1.,0.],[0.,1.]],q=msk,r=u_ex)"  print "mypde=LinearPDE(A=[[1.,0.],[0.,1.]],q=msk,r=u_ex)"
88  mypde=LinearPDE(mydomain)  mypde=LinearPDE(mydomain)
mypde.setValue(A=[[1.,0.],[0.,1.]],q=msk,r=u_ex)
89  mypde.setDebugOn()  mypde.setDebugOn()
90    mypde.setValue(A=[[1.,0.],[0.,1.]],q=msk,r=u_ex)
91
92    print "mypde.checkSymmetry()"
93    print mypde.checkSymmetry()
94
95  # generate a test solution 2  # generate a test solution 2
96
# Line 104  u_d=mypde.getSolution() Line 105  u_d=mypde.getSolution()
105
106  print "\nIterative Solver (2)=>"  print "\nIterative Solver (2)=>"
107
108  #mypde.setSymmetryOn()  mypde.setSymmetryOn()
109  mypde.setSolverMethod(DEFAULT_METHOD)  mypde.setSolverMethod(DEFAULT_METHOD)
110  u_i=mypde.getSolution()  u_i=mypde.getSolution()
111

Legend:
 Removed from v.104 changed lines Added in v.108