/[escript]/branches/symbolic_from_3470/escript/py_src/nonlinearPDE.py
ViewVC logotype

Diff of /branches/symbolic_from_3470/escript/py_src/nonlinearPDE.py

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

revision 3863 by caltinay, Fri Mar 9 06:32:35 2012 UTC revision 3864 by caltinay, Mon Mar 12 05:18:16 2012 UTC
# Line 99  def concatenateRow(*args): Line 99  def concatenateRow(*args):
99              res[:lshape[0]]=args[0]              res[:lshape[0]]=args[0]
100              res[lshape[0]:]=args[1]              res[lshape[0]:]=args[1]
101    
102      return Symbol(res, dim=args[0].dim)      subs=args[0].getDataSubstitutions().copy()
103        subs.update(args[1].getDataSubstitutions())
104        return Symbol(res, dim=args[0].getDim(), subs=subs)
105    
106  class NonlinearPDE(object):  class NonlinearPDE(object):
107      """      """
# Line 791  class NonlinearPDE(object): Line 793  class NonlinearPDE(object):
793                            relevant_symbols['d'+name[1:]]=self._set_coeffs[name].diff(f)                            relevant_symbols['d'+name[1:]]=self._set_coeffs[name].diff(f)
794          res=ev.evaluate()          res=ev.evaluate()
795          if len(names)==1: res=[res]          if len(names)==1: res=[res]
796          self.trace3("RHS expressions evaluated in %f seconds."%(time()-ttt0))          self.trace3("RHS expressions evaluated in %f seconds."%(time()-T0))
797          for i in range(len(names)):          for i in range(len(names)):
798              self.trace3("util.Lsup(%s)=%s"%(names[i],util.Lsup(res[i])))              self.trace3("util.Lsup(%s)=%s"%(names[i],util.Lsup(res[i])))
799          coeffs_f=dict(zip(names,res))          coeffs_f=dict(zip(names,res))
# Line 936  class NonlinearPDE(object): Line 938  class NonlinearPDE(object):
938          if len(names)==0:          if len(names)==0:
939              return              return
940          self.trace3("Starting expression evaluation.")          self.trace3("Starting expression evaluation.")
941          ttt0=time()          T0=time()
942          ev.subs(**subs)          ev.subs(**subs)
943          res=ev.evaluate()          res=ev.evaluate()
944          if len(names)==1: res=[res]          if len(names)==1: res=[res]
945          self.trace3("RHS expressions evaluated in %f seconds."%(time()-ttt0))          self.trace3("RHS expressions evaluated in %f seconds."%(time()-T0))
946          for i in range(len(names)):          for i in range(len(names)):
947              self.trace3("util.Lsup(%s)=%s"%(names[i],util.Lsup(res[i])))              self.trace3("util.Lsup(%s)=%s"%(names[i],util.Lsup(res[i])))
948          args=dict(zip(names,res))          args=dict(zip(names,res))
# Line 962  class NonlinearPDE(object): Line 964  class NonlinearPDE(object):
964          if len(names)==0:          if len(names)==0:
965              return              return
966          self.trace3("Starting expression evaluation.")          self.trace3("Starting expression evaluation.")
967          ttt0=time()          T0=time()
968          ev.subs(**subs)          ev.subs(**subs)
969          res=ev.evaluate()          res=ev.evaluate()
970          if len(names)==1: res=[res]          if len(names)==1: res=[res]
971          self.trace3("Matrix expressions evaluated in %f seconds."%(time()-ttt0))          self.trace3("Matrix expressions evaluated in %f seconds."%(time()-T0))
972          for i in range(len(names)):          for i in range(len(names)):
973              self.trace3("util.Lsup(%s)=%s"%(names[i],util.Lsup(res[i])))              self.trace3("util.Lsup(%s)=%s"%(names[i],util.Lsup(res[i])))
974          self._lpde.setValue(**dict(zip(names,res)))          self._lpde.setValue(**dict(zip(names,res)))

Legend:
Removed from v.3863  
changed lines
  Added in v.3864

  ViewVC Help
Powered by ViewVC 1.1.26