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

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

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

revision 4113 by jfenwick, Thu Dec 13 03:30:23 2012 UTC revision 4114 by caltinay, Fri Dec 14 04:24:46 2012 UTC
# Line 20  __license__="""Licensed under the Open S Line 20  __license__="""Licensed under the Open S
20  http://www.opensource.org/licenses/osl-3.0.php"""  http://www.opensource.org/licenses/osl-3.0.php"""
21  __url__="https://launchpad.net/escript-finley"  __url__="https://launchpad.net/escript-finley"
22    
 #from esys.escript import *  
23  from esys.escript.linearPDEs import LinearPDE, SingleTransportPDE  from esys.escript.linearPDEs import LinearPDE, SingleTransportPDE
24  from esys.escript.pdetools import Projector  from esys.escript.pdetools import Projector
   
25  import math  import math
26    
27  USE_OLD_VERSION=False  USE_OLD_VERSION=False
# Line 492  class LevelSet2(object): Line 490  class LevelSet2(object):
490          #==============================================          #==============================================
491          TVD=integrate(length(grad_phi))          TVD=integrate(length(grad_phi))
492          print(("initial range ",inf(self.__phi),sup(self.__phi),"error:",Lsup(1.-len_grad_phi),"volume =",vol,TVD))          print(("initial range ",inf(self.__phi),sup(self.__phi),"error:",Lsup(1.-len_grad_phi),"volume =",vol,TVD))
         # saveVTK("test.%s.vtu"%c,l=length(grad(self.__phi,fs))-1,s=s,phi=self.__phi)  
493    
494          dtau=f*inf(h/abs(s))          dtau=f*inf(h/abs(s))
495          while c < self.__reinit_max: # and abs(diff) >= 0.01:          while c < self.__reinit_max: # and abs(diff) >= 0.01:
# Line 521  class LevelSet2(object): Line 518  class LevelSet2(object):
518            r=Lsup(length(grad(self.__phi))-1.)            r=Lsup(length(grad(self.__phi))-1.)
519            TVD=integrate(length(grad(self.__phi,fs)))            TVD=integrate(length(grad(self.__phi,fs)))
520            print(("iteration :", c, "range ",inf(self.__phi),sup(self.__phi),"error :",r,"volume change:",diff,TVD))            print(("iteration :", c, "range ",inf(self.__phi),sup(self.__phi),"error :",r,"volume change:",diff,TVD))
           # saveVTK("test.%s.vtu"%(c+1),l=length(grad(self.__phi,fs)),s=s,phi=self.__phi,v=grad(self.__phi,fs))  
521            c += 1            c += 1
522          return          return
523          #==============================================          #==============================================
# Line 555  class LevelSet2(object): Line 551  class LevelSet2(object):
551          vol,vol_old=self.getVolumeOfNegativeDomain(),vol          vol,vol_old=self.getVolumeOfNegativeDomain(),vol
552          diff=(vol-vol_old)/vol          diff=(vol-vol_old)/vol
553          print(("iteration :", inf(self.__phi),sup(self.__phi),r,diff))          print(("iteration :", inf(self.__phi),sup(self.__phi),r,diff))
         # saveVTK("test.%s.vtu"%0,l=length(grad(self.__phi,fs)),s=s,phi=self.__phi,v=grad(self.__phi,fs),s2=s2)  
         return  
         #=============================================  
   
554          #============          #============
555    
   
556       def getVolumeOfNegativeDomain(self):       def getVolumeOfNegativeDomain(self):
557           """           """
558           Returns the current volume of domain with phi<0.           Returns the current volume of domain with phi<0.

Legend:
Removed from v.4113  
changed lines
  Added in v.4114

  ViewVC Help
Powered by ViewVC 1.1.26