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

revision 102 by jgs, Wed Dec 15 07:08:39 2004 UTC revision 104 by jgs, Fri Dec 17 07:43:12 2004 UTC
# Line 14  Line 14
14
15  """  """
16
17  import sys  from esys.escript import *
18  import os  from esys.linearPDEs import *
19                                                                                                                                                        import esys.finley as pdelib
esys_root=os.getenv('ESYS_ROOT')
sys.path.append(esys_root+'/finley/lib')
sys.path.append(esys_root+'/escript/lib')
sys.path.append(esys_root+'/escript/py_src')

from escript import *
from util import *
from linearPDEs import *
from numarray import *
import finley as pdelib
20
21    from numarray import *
22
23  # these values are currently fixed:  # these values are currently fixed:
24  len_x0=1.  len_x0=1.
# Line 81  def solveVector(numDim, totalNumElem, le Line 72  def solveVector(numDim, totalNumElem, le
72          A[i,j,i,j] += alpha          A[i,j,i,j] += alpha
73
74      # Build the pdelib System Matrix and RHS      # Build the pdelib System Matrix and RHS
75      mypde=LinearPDE(domain=mesh, \      mypde=LinearPDE(mesh)
76                       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)
77      mypde.setSolverMethod(solver_method)      mypde.setSolverMethod(solver_method)
78
79      # Solve for Approximate Solution      # Solve for Approximate Solution
# Line 135  def solveScalar(numDim, totalNumElem, le Line 126  def solveScalar(numDim, totalNumElem, le
126          u += x[j] * x[j]          u += x[j] * x[j]
127
128      # Build the pdelib System Matrix and RHS      # Build the pdelib System Matrix and RHS
129      mypde=LinearPDE(domain=mesh, \      mypde=LinearPDE(mesh)
130                      A = identity(numDim), D = alpha, Y = alpha * u - 2 * meshDim, q = bndryMask, r = u)      mypde.setValue(A = identity(numDim), D = alpha, Y = alpha * u - 2 * meshDim, q = bndryMask, r = u)
131      mypde.setSolverMethod(solver_method)      mypde.setSolverMethod(solver_method)
132
133      # Solve for Approximate Solution      # Solve for Approximate Solution

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

 ViewVC Help Powered by ViewVC 1.1.26