/[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 2344 by jfenwick, Mon Mar 30 02:13:58 2009 UTC revision 2534 by caltinay, Thu Jul 16 06:49:19 2009 UTC
# Line 475  class LevelSet2(object): Line 475  class LevelSet2(object):
475          #==============================================          #==============================================
476          TVD=integrate(length(grad_phi))          TVD=integrate(length(grad_phi))
477          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
478          # saveVTK("test.%s.xml"%c,l=length(grad(self.__phi,fs))-1,s=s,phi=self.__phi)          # saveVTK("test.%s.vtu"%c,l=length(grad(self.__phi,fs))-1,s=s,phi=self.__phi)
479    
480          dtau=f*inf(h/abs(s))          dtau=f*inf(h/abs(s))
481          while c < self.__reinit_max: # and abs(diff) >= 0.01:          while c < self.__reinit_max: # and abs(diff) >= 0.01:
# Line 504  class LevelSet2(object): Line 504  class LevelSet2(object):
504            r=Lsup(length(grad(self.__phi))-1.)            r=Lsup(length(grad(self.__phi))-1.)
505            TVD=integrate(length(grad(self.__phi,fs)))            TVD=integrate(length(grad(self.__phi,fs)))
506            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
507            # saveVTK("test.%s.xml"%(c+1),l=length(grad(self.__phi,fs)),s=s,phi=self.__phi,v=grad(self.__phi,fs))            # saveVTK("test.%s.vtu"%(c+1),l=length(grad(self.__phi,fs)),s=s,phi=self.__phi,v=grad(self.__phi,fs))
508            c += 1            c += 1
509          return          return
510          #==============================================          #==============================================
# Line 538  class LevelSet2(object): Line 538  class LevelSet2(object):
538          vol,vol_old=self.getVolumeOfNegativeDomain(),vol          vol,vol_old=self.getVolumeOfNegativeDomain(),vol
539          diff=(vol-vol_old)/vol          diff=(vol-vol_old)/vol
540          print "iteration :", inf(self.__phi),sup(self.__phi),r,diff          print "iteration :", inf(self.__phi),sup(self.__phi),r,diff
541          # saveVTK("test.%s.xml"%0,l=length(grad(self.__phi,fs)),s=s,phi=self.__phi,v=grad(self.__phi,fs),s2=s2)          # saveVTK("test.%s.vtu"%0,l=length(grad(self.__phi,fs)),s=s,phi=self.__phi,v=grad(self.__phi,fs),s2=s2)
542          return          return
543          #=============================================          #=============================================
544    

Legend:
Removed from v.2344  
changed lines
  Added in v.2534

  ViewVC Help
Powered by ViewVC 1.1.26