Home My Page Projects Code Snippets Project Openings diderot

# SCM Repository

[diderot] Diff of /branches/ein16/synth/d2/test_eval.py
 [diderot] / branches / ein16 / synth / d2 / test_eval.py

# Diff of /branches/ein16/synth/d2/test_eval.py

revision 4187, Mon Jul 11 16:52:52 2016 UTC revision 4188, Mon Jul 11 23:21:11 2016 UTC
# Line 4  Line 4
4  x,y,z =symbols('x y z')  x,y,z =symbols('x y z')
5  import sys  import sys
6  import re  import re
7    import math
8  from obj_ty import *  from obj_ty import *
9  from obj_apply import *  from obj_apply import *
10  from obj_operator import *  from obj_operator import *
# Line 176  Line 176
176          sum = 0          sum = 0
177          for i in es:          for i in es:
178              sum+=i*i              sum+=i*i
179          return sqrt(sum)          print "\nsum",sum
180            rtn  = (sum)**0.5
181            print "\nrtn",rtn
182            return rtn
183      if(field.is_Scalar(fld)):      if(field.is_Scalar(fld)):
184          [] = fty.get_shape(ityp)          [] = fty.get_shape(ityp)
185          return exp          return exp
# Line 929  Line 932
932      # print "inside eval exp:", field.toStr(app.exp[0])      # print "inside eval exp:", field.toStr(app.exp[0])
933      #apply.toStr(app)      #apply.toStr(app)
934      (otyp1, ortn) = sort(app) #apply operations to expressions      (otyp1, ortn) = sort(app) #apply operations to expressions
935      #print "ortn",ortn      print "ortn",ortn
936      return probeField(otyp1, pos, ortn) #evaluate expression at positions      rtn = probeField(otyp1, pos, ortn) #evaluate expression at positions
937        print "rtn", rtn
938        return rtn

Legend:
 Removed from v.4187 changed lines Added in v.4188