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

revision 82 by jgs, Tue Oct 26 06:53:54 2004 UTC revision 97 by jgs, Tue Dec 14 05:39:33 2004 UTC
# Line 13  sys.path.append(esys_root+'/escript/py_s Line 13  sys.path.append(esys_root+'/escript/py_s
13
14  from escript import *  from escript import *
15  from util import *  from util import *
16  from linearPDE import *  from linearPDEs import *
17
18  import finley  import finley
19  from math import *  from math import *
# Line 202  def TestSystem(numEqu,numComp,mydomain,r Line 202  def TestSystem(numEqu,numComp,mydomain,r
202                    c_A2=c_A                    c_A2=c_A
203                    text="A[%d,%d,%d,%d]"%(p,i,q,j)                    text="A[%d,%d,%d,%d]"%(p,i,q,j)
205                 mypde1=linearPDE(domain=mydomain,A=c_A2,X=eval(x,elem))                 mypde1=LinearPDE(domain=mydomain,A=c_A2,X=eval(x,elem))
206                 mypde1.setReducedOrderForSolutionsTo(reduce)                 mypde1.setReducedOrderForSolutionsTo(reduce)
207                 checkSystem(text+" const with X",mypde1.getOperator(),U,mypde1.getRightHandSide())                 checkSystem(text+" const with X",mypde1.getOperator(),U,mypde1.getRightHandSide())
208                 # check div( A grad(u) ) = Y                 # check div( A grad(u) ) = Y
209                 y=-algebraicDiv(x)                 y=-algebraicDiv(x)
210                 mypde2=linearPDE(domain=mydomain,Y=eval(y,elem),y=matmult(eval(x,face_elem),nrml))                 mypde2=LinearPDE(domain=mydomain,Y=eval(y,elem),y=matmult(eval(x,face_elem),nrml))
211                 mypde2.setReducedOrderForSolutionsTo(reduce)                 mypde2.setReducedOrderForSolutionsTo(reduce)
212                 checkSystem(text+" const with Y",mypde1.getOperator(),U,mypde2.getRightHandSide())                 checkSystem(text+" const with Y",mypde1.getOperator(),U,mypde2.getRightHandSide())
213
# Line 221  def TestSystem(numEqu,numComp,mydomain,r Line 221  def TestSystem(numEqu,numComp,mydomain,r
221                 c_B2=c_B                 c_B2=c_B
222                 text="B[%d,%d,%d]"%(p,i,q)                 text="B[%d,%d,%d]"%(p,i,q)
223              x=mult3_2(c_B,u)              x=mult3_2(c_B,u)
224              mypde1=linearPDE(domain=mydomain,B=c_B2,X=eval(x,elem))              mypde1=LinearPDE(domain=mydomain,B=c_B2,X=eval(x,elem))
225              mypde1.setReducedOrderForSolutionsTo(reduce)              mypde1.setReducedOrderForSolutionsTo(reduce)
226              checkSystem(text+" const with X",mypde1.getOperator(),U,mypde1.getRightHandSide())              checkSystem(text+" const with X",mypde1.getOperator(),U,mypde1.getRightHandSide())
227              # check div( B u ) = Y              # check div( B u ) = Y
228              y=-algebraicDiv(x)              y=-algebraicDiv(x)
229              mypde2=linearPDE(domain=mydomain,Y=eval(y,elem),y=matmult(eval(x,face_elem),nrml))              mypde2=LinearPDE(domain=mydomain,Y=eval(y,elem),y=matmult(eval(x,face_elem),nrml))
230              mypde2.setReducedOrderForSolutionsTo(reduce)              mypde2.setReducedOrderForSolutionsTo(reduce)
231              checkSystem(text+" const with Y",mypde1.getOperator(),U,mypde2.getRightHandSide())              checkSystem(text+" const with Y",mypde1.getOperator(),U,mypde2.getRightHandSide())
232
# Line 240  def TestSystem(numEqu,numComp,mydomain,r Line 240  def TestSystem(numEqu,numComp,mydomain,r
240                 c_C2=c_C                 c_C2=c_C
241                 text="C[%d,%d,%d]"%(p,q,i)                 text="C[%d,%d,%d]"%(p,q,i)
243              mypde1=linearPDE(domain=mydomain,C=c_C2,Y=eval(y,elem))              mypde1=LinearPDE(domain=mydomain,C=c_C2,Y=eval(y,elem))
244              mypde1.setReducedOrderForSolutionsTo(reduce)              mypde1.setReducedOrderForSolutionsTo(reduce)
245              checkSystem(text+" const with Y",mypde1.getOperator(),U,mypde1.getRightHandSide())              checkSystem(text+" const with Y",mypde1.getOperator(),U,mypde1.getRightHandSide())
246
# Line 255  def TestSystem(numEqu,numComp,mydomain,r Line 255  def TestSystem(numEqu,numComp,mydomain,r
255              c_D2=c_D              c_D2=c_D
256              text="D[%d,%d]"%(p,q)              text="D[%d,%d]"%(p,q)
257           y=mult2(c_D,u)           y=mult2(c_D,u)
258           mypde1=linearPDE(domain=mydomain,D=c_D2,Y=eval(y,elem))           mypde1=LinearPDE(domain=mydomain,D=c_D2,Y=eval(y,elem))
259           mypde1.setReducedOrderForSolutionsTo(reduce)           mypde1.setReducedOrderForSolutionsTo(reduce)
260           checkSystem(text+" const with Y",mypde1.getOperator(),U,mypde1.getRightHandSide())           checkSystem(text+" const with Y",mypde1.getOperator(),U,mypde1.getRightHandSide())
261

Legend:
 Removed from v.82 changed lines Added in v.97