/[escript]/branches/3.4.1/modellib/py_src/input.py
ViewVC logotype

Diff of /branches/3.4.1/modellib/py_src/input.py

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

revision 819 by gross, Sun Aug 27 23:07:51 2006 UTC revision 820 by gross, Mon Aug 28 06:55:36 2006 UTC
# Line 128  class InterpolateOverBox(ParameterSet): Line 128  class InterpolateOverBox(ParameterSet):
128          if self.domain.getDim() == 2:          if self.domain.getDim() == 2:
129              x0,x1=x[0],x[1]              x0,x1=x[0],x[1]
130              left_bottom_front0,right_top_back0=inf(x0),sup(x0)              left_bottom_front0,right_top_back0=inf(x0),sup(x0)
131              left_bottom_front1,right_top_back1=inf(x[1]),sup(x[1])              left_bottom_front1,right_top_back1=inf(x1),sup(x1)
132              f_right = (x[0] - self.left_bottom_front0)/\              f_right = (x0 - left_bottom_front0)/(right_top_back0 -left_bottom_front0)
          (self.right_top_back0 - self.left_bottom_front0)  
133              f_left = 1. - f_right              f_left = 1. - f_right
134              f_top = (x[1] - self.left_bottom_front1)/\              f_top = (x1 - left_bottom_front1)/(right_top_back1 - left_bottom_front1)
          (self.right_top_back1 - self.left_bottom_front1)  
135              f_bottom = 1. - f_top              f_bottom = 1. - f_top
136              out = f_left * f_bottom * self.value_left_bottom_front \              out = f_left * f_bottom * self.value_left_bottom_front \
137                  + f_right * f_bottom * self.value_right_bottom_front \                  + f_right * f_bottom * self.value_right_bottom_front \
# Line 142  class InterpolateOverBox(ParameterSet): Line 140  class InterpolateOverBox(ParameterSet):
140          else:          else:
141              x0,x1,x2=x[0],x[1],x[2]              x0,x1,x2=x[0],x[1],x[2]
142              left_bottom_front0,right_top_back0=inf(x0),sup(x0)              left_bottom_front0,right_top_back0=inf(x0),sup(x0)
143              left_bottom_front1,right_top_back1=inf(x[1]),sup(x[1])              left_bottom_front1,right_top_back1=inf(x1),sup(x1)
144              left_bottom_front2,right_top_back2=inf(x[2]),sup(x[2])              left_bottom_front2,right_top_back2=inf(x2),sup(x2)
145              f_right = (x[0] - self.left_bottom_front0)/\              f_right = (x0 - left_bottom_front0)/(right_top_back0 - left_bottom_front0)
                     (self.right_top_back0 - self.left_bottom_front0)  
146              f_left = 1. - f_right              f_left = 1. - f_right
147              f_top = (x[1] - self.left_bottom_front1)/\              f_top = (x1 - left_bottom_front1)/(right_top_back1 - left_bottom_front1)
                     (self.right_top_back1 - self.left_bottom_front1)  
148              f_bottom = 1. - f_top              f_bottom = 1. - f_top
149              f_back = (x[2] - self.left_bottom_front1)/\              f_back = (x2 - left_bottom_front1)/(right_top_back2 - left_bottom_front2)
                     (self.right_top_back2 - self.left_bottom_front2)  
150              f_front = 1. - f_back              f_front = 1. - f_back
151              out = f_left * f_bottom * f_front * self.value_left_bottom_front\              out = f_left * f_bottom * f_front * self.value_left_bottom_front\
152                  + f_right * f_bottom * f_front * self.value_right_bottom_front\                  + f_right * f_bottom * f_front * self.value_right_bottom_front\

Legend:
Removed from v.819  
changed lines
  Added in v.820

  ViewVC Help
Powered by ViewVC 1.1.26