Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

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

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

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

revision 4248, Fri Jul 22 13:26:01 2016 UTC revision 4250, Fri Jul 22 23:31:15 2016 UTC
# Line 82  Line 82 
82  def fn_negation(exp):  def fn_negation(exp):
83      return -1*exp      return -1*exp
84    
 # negation  of field  
 def fn_negation(exp):  
     return -1*exp  
   
   
 #evaluate cross product  
85  def fn_cross(fld1, fld2):  def fn_cross(fld1, fld2):
86      exp1 = field.get_data(fld1)      exp1 = field.get_data(fld1)
87      ityp1 = field.get_ty(fld1)      ityp1 = field.get_ty(fld1)
# Line 183  Line 177 
177          for i in es:          for i in es:
178              sum+=i*i              sum+=i*i
179          #print "\nsum",sum          #print "\nsum",sum
180          rtn  = (sum)**0.5          rtn  = sqrt(sum)
181          #print "\nrtn",rtn          #print "\nrtn",rtn
182          return rtn          return rtn
183      if(field.is_Scalar(fld)):      if(field.is_Scalar(fld)):
# Line 614  Line 608 
608          return  exp          return  exp
609      elif(op_negation==fn_name): #negation      elif(op_negation==fn_name): #negation
610          return fn_negation(exp)          return fn_negation(exp)
611      elif(op_gradient==fn_name): #gradient      elif(op_cosine==fn_name): #cosine
612          return fn_grad(exp, dim)          return cos(exp)
613        elif(op_sine==fn_name): #sine
614            return sin(exp)
615        elif(op_tangent==fn_name): # tangent
616            return tan(exp)
617        elif(op_asine==fn_name): #asine
618            return asin(exp)
619        elif(op_acosine==fn_name): #acos
620            return acos(exp)
621        elif(op_atangent==fn_name): #atan
622            return atan(exp)
623        elif(op_sqrt==fn_name): #sqrt
624            return sqrt(exp)
625      else:      else:
626          raise Exception("unsupported unary operator on scalar field:"+ fn_name.name)          raise Exception("unsupported unary operator on scalar field:"+ fn_name.name)
627    

Legend:
Removed from v.4248  
changed lines
  Added in v.4250

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0