/[escript]/trunk/finley/test/python/SolveTest.py
ViewVC logotype

Diff of /trunk/finley/test/python/SolveTest.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 117 by jgs, Fri Apr 1 05:48:57 2005 UTC revision 147 by jgs, Fri Aug 12 01:45:47 2005 UTC
# Line 14  Line 14 
14    
15  """  """
16    
17  from esys.escript import *  # from esys.escript import *
18  from esys.linearPDEs import *  # from esys.linearPDEs import *
19  import esys.finley as pdelib  # import esys.finley as pdelib
20    from escript.escript import *
21    from escript.linearPDEs import *
22    import finley.finley as pdelib
23  from time import time  from time import time
24    
25  from numarray import *  from numarray import *
# Line 82  def solveVector(numDim, totalNumElem, le Line 85  def solveVector(numDim, totalNumElem, le
85      mypde=LinearPDE(mesh)      mypde=LinearPDE(mesh)
86      mypde.setValue(A = A, Y = - 2 * alpha * (meshDim - 1)*ones(meshDim), q = bndryMask, r = u)      mypde.setValue(A = A, Y = - 2 * alpha * (meshDim - 1)*ones(meshDim), q = bndryMask, r = u)
87      mypde.setSolverMethod(solver_method_id)      mypde.setSolverMethod(solver_method_id)
88        # mypde.getOperator().saveMM("g.mm")
89    
90      # Solve for Approximate Solution      # Solve for Approximate Solution
91      tm=time()      tm=time()
# Line 160  def solveScalar(numDim, totalNumElem, le Line 164  def solveScalar(numDim, totalNumElem, le
164  print "Test is started:"  print "Test is started:"
165  print "----------------"  print "----------------"
166  error=0.  error=0.
167  for numDim in [2,3]:  for numDim in [2, 3]:
168       # for totalNumElem in [51200]:
169     for totalNumElem in [100, 200, 400, 800, 1600, 3200, 6400, 12800, 25600, 51200, 102400,204800]:     for totalNumElem in [100, 200, 400, 800, 1600, 3200, 6400, 12800, 25600, 51200, 102400,204800]:
170        for problem in [solveScalar,solveVector]:        for problem in [solveScalar,solveVector]:
171           if totalNumElem*2**numDim*numDim< 200000: error=max([problem(numDim, totalNumElem, len_x0, alpha,"DIRECT",""),error])        #for problem in [solveVector]:
172           for solver_method in [ "PCG" ]:           error=max([problem(numDim, totalNumElem, len_x0, alpha,"PCG",""),error])
173              for prec in [ "JACOBI", "ILU0" ]:           error=max([problem(numDim, totalNumElem, len_x0, alpha,"DIRECT",""),error])
174                 error=max([problem(numDim, totalNumElem, len_x0, alpha, solver_method,prec),error])           #if totalNumElem*2**numDim*numDim< 200000: error=max([problem(numDim, totalNumElem, len_x0, alpha,"DIRECT",""),error])
175             # for solver_method in [ "PCG" ]:
176             #    for prec in [ "JACOBI", "ILU0" ]:
177             #       error=max([problem(numDim, totalNumElem, len_x0, alpha, solver_method,prec),error])
178  print "----------------"  print "----------------"
179  print "maximum error over all tests is ",error  print "maximum error over all tests is ",error
180  print "----------------"  print "----------------"

Legend:
Removed from v.117  
changed lines
  Added in v.147

  ViewVC Help
Powered by ViewVC 1.1.26