/[escript]/trunk/modellib/py_src/crustal/mines.py
ViewVC logotype

Diff of /trunk/modellib/py_src/crustal/mines.py

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

revision 996 by gross, Tue Feb 20 06:18:52 2007 UTC revision 997 by gross, Mon Feb 26 06:31:45 2007 UTC
# Line 283  class Mine(BoxInTheCrust): Line 283  class Mine(BoxInTheCrust):
283            else:            else:
284               raise ValueError("empty record of %s mine."%self.getName())               raise ValueError("empty record of %s mine."%self.getName())
285       def getMassChanges(self,t):       def getMassChanges(self,t):
286           m0=0.           m0=None
287           t0=self.getStartOfRecords()           t0=self.getStartOfRecords()
288           if t<=t0:           if t<=t0:
289              return 0.              return 0.
290           for y, e in self.__record:           for y, e in self.__record:
291                 return sum(e.values())               m=sum(e.values())
292           return 0.               if t<=y:
293                      if m0==None:
294                         return m
295                      else:
296                         return (m-m0)/(y-t0)*(t-t0)+m0
297                 else:
298                   t0,m0=y,m
299             return m0
300       def getNextTimeMarker(self,t):       def getNextTimeMarker(self,t):
301           for y, e in self.__record:           for y, e in self.__record:
302             if y>t: return y             if y>t: return y
# Line 499  if __name__ == "__main__": Line 506  if __name__ == "__main__":
506      print dsgn.getCommandString()      print dsgn.getCommandString()
507      print "mesh in gmsh format is written to ",dsgn.getMeshHandler()      print "mesh in gmsh format is written to ",dsgn.getMeshHandler()
508      if not options.tagfile == None:      if not options.tagfile == None:
509          dsgn.getVolumeTagMap().writeXML(open(options.tagfile,"w"))          dsgn.getTagMap().writeXML(open(options.tagfile,"w"))
510          print "volume tag map written to %s."%options.tagfile          print "tag map written to %s."%options.tagfile

Legend:
Removed from v.996  
changed lines
  Added in v.997

  ViewVC Help
Powered by ViewVC 1.1.26