/[escript]/trunk/escript/py_src/mountains.py
ViewVC logotype

Diff of /trunk/escript/py_src/mountains.py

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

revision 2861 by gross, Mon Jan 18 07:44:42 2010 UTC revision 2862 by gross, Thu Jan 21 04:45:39 2010 UTC
# Line 68  class Mountains: Line 68  class Mountains:
68      A=kronecker(domain)*eps*0      A=kronecker(domain)*eps*0
69      A[self.__DIM-1,self.__DIM-1]=(0.3*(sup(z)-inf(z))/log(2.))**2      A[self.__DIM-1,self.__DIM-1]=(0.3*(sup(z)-inf(z))/log(2.))**2
70      # A[self.__DIM-1,self.__DIM-1]=(sup(FunctionOnBoundary(self.__domain).getSize())/log(2.))**2      # A[self.__DIM-1,self.__DIM-1]=(sup(FunctionOnBoundary(self.__domain).getSize())/log(2.))**2
71      self.__PDE_W.setValue(D=1, A=A, q=whereZero(sup(z)-z))      self.__PDE_W.setValue(D=1, A=A, q=whereZero(sup(z)-z)+whereZero(inf(z)-z))
72    
73      self.__PDE_H = LinearPDE(domain)      self.__PDE_H = LinearPDE(domain)
74      self.__PDE_H.setSymmetryOn()      self.__PDE_H.setSymmetryOn()
75      if reduced: self.__PDE_H.setReducedOrderOn()      if reduced: self.__PDE_H.setReducedOrderOn()
76      # A=kronecker(domain)*0      # A=kronecker(domain)*0
77      # A[self.__DIM-1,self.__DIM-1]=0.1      # A[self.__DIM-1,self.__DIM-1]=0.1
78      self.__PDE_H.setValue(D=1.0)      self.__PDE_H.setValue(D=1.0, q=whereZero(inf(z)-z))
79      # self.__PDE_H.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)      # self.__PDE_H.getSolverOptions().setSolverMethod(SolverOptions.LUMPING)
80    
81      self.setVelocity()      self.setVelocity()
# Line 107  class Mountains: Line 107  class Mountains:
107        self.__dt=None        self.__dt=None
108        self.__v=Vector(0.,Solution(self.getDomain()))        self.__v=Vector(0.,Solution(self.getDomain()))
109        if not v == None:        if not v == None:
110            xi=self.getDomain().getX()[self.getDomain().getDim()-1]
111            v=(xi-inf(xi))/(sup(xi)-inf(xi))*v
112          for d in range(self.__DIM):          for d in range(self.__DIM):
113             self.__PDE_W.setValue(r=v[d])             self.__PDE_W.setValue(r=v[d])
114             self.__v[d]=self.__PDE_W.getSolution()             self.__v[d]=self.__PDE_W.getSolution()
# Line 174  class Mountains: Line 176  class Mountains:
176        w_tilda=1.*w        w_tilda=1.*w
177        w_tilda[self.__DIM-1]=0        w_tilda[self.__DIM-1]=0
178        w_z=w[self.__DIM-1]        w_z=w[self.__DIM-1]
179          V=vol(self.__PDE_H.getDomain())
180    
181        t=0        t=0
182        for i in range(n):        for i in range(n):
183           L=integrate(w_z*dt+H)/vol(self.__PDE_H.getDomain())           # L=integrate(w_z*dt+H)/vol(self.__PDE_H.getDomain())
184           self.__PDE_H.setValue(X=(inner(w_tilda,grad(H))*dt/2+H)*w_tilda*dt, Y=w_z*dt+H-L)           # self.__PDE_H.setValue(X=(inner(w_tilda,grad(H))*dt/2+H)*w_tilda*dt, Y=w_z*dt+H-L)
185             # H=self.__PDE_H.getSolution()
186             L=integrate(w_z*dt+H)/V
187             self.__PDE_H.setValue(X=w_tilda*H*(dt/2), Y=w_z*(dt/2)+H-L)
188             Hhalf=self.__PDE_H.getSolution()
189             self.__PDE_H.setValue(X=w_tilda*Hhalf*dt, Y=w_z*dt+H-L)
190           H=self.__PDE_H.getSolution()           H=self.__PDE_H.getSolution()
191           print "DDD : ava = ",integrate(H)           print "DDD : ava = ",integrate(H)
192           t+=dt           t+=dt

Legend:
Removed from v.2861  
changed lines
  Added in v.2862

  ViewVC Help
Powered by ViewVC 1.1.26