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

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

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

revision 876 by gross, Mon Oct 16 04:07:33 2006 UTC revision 877 by gross, Wed Oct 25 03:06:58 2006 UTC
# Line 102  class StokesProblem(SaddlePointProblem): Line 102  class StokesProblem(SaddlePointProblem):
102           dp=self.__pde_p.getSolution()           dp=self.__pde_p.getSolution()
103           return  dp           return  dp
104    
105  NE=60  NE=1
106  dom=Rectangle(NE,NE,order=2)  dom=Rectangle(NE,NE,order=2)
107  # prop=SimpleStokesProblem(dom)  # prop=SimpleStokesProblem(dom)
108  prop=StokesProblem(dom)  prop=StokesProblem(dom)
# Line 110  x=dom.getX() Line 110  x=dom.getX()
110  mask=(whereZero(x[0])+whereZero(x[0]-1.)+whereZero(x[1]-1.))*unitVector(0,dom)+(whereZero(x[1]-1.)+whereZero(x[1]))*unitVector(1,dom)  mask=(whereZero(x[0])+whereZero(x[0]-1.)+whereZero(x[1]-1.))*unitVector(0,dom)+(whereZero(x[1]-1.)+whereZero(x[1]))*unitVector(1,dom)
111  u0=Vector(0.,Solution(dom))  u0=Vector(0.,Solution(dom))
112  u0[0]=x[1]*whereZero(x[1]-1.)  u0[0]=x[1]*whereZero(x[1]-1.)
113  p0=0.  p0=Scalar(0,ReducedSolution(dom))
114    # prop.initialize(fixed_u_mask=mask)
115  prop.initialize(fixed_u_mask=mask,eta=10.)  prop.initialize(fixed_u_mask=mask,eta=10.)
116  u,p=prop.solve(u0,p0,relaxation=1.,iter_max=50,tolerance=0.01)  u,p=prop.solve(u0,p0,tolerance=0.01)
117  saveVTK("stokes.xml",u=u,p=p,m=mask,u0=u0)  # saveVTK("stokes.xml",u=u,p=p,m=mask,u0=u0)
118    
119  eta=whereNegative(x[1]-0.5)*1.e6+whereNonNegative(x[1]-0.5)  eta=whereNegative(x[1]-0.5)*1.e6+whereNonNegative(x[1]-0.5)
120  prop.initialize(fixed_u_mask=mask,eta=eta)  prop.initialize(fixed_u_mask=mask,eta=eta)
121  u,p=prop.solve(u0,p0,relaxation=1.,iter_max=50,tolerance=0.01)  u,p=prop.solve(u0,p0,tolerance=0.01,tolerance_u=0.1,relaxation=1.)
122  saveVTK("stokes.xml",u=u,p=p,m=mask,u0=u0)  saveVTK("stokes.xml",u=u,p=p,m=mask,u0=u0)
123                        
124  # vim: expandtab shiftwidth=4:  # vim: expandtab shiftwidth=4:

Legend:
Removed from v.876  
changed lines
  Added in v.877

  ViewVC Help
Powered by ViewVC 1.1.26