/[escript]/branches/numpy/modellib/py_src/geometry.py
ViewVC logotype

Diff of /branches/numpy/modellib/py_src/geometry.py

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

revision 2406 by jfenwick, Thu Apr 23 23:58:29 2009 UTC revision 2407 by jfenwick, Fri May 1 01:28:06 2009 UTC
# Line 237  class ConstrainerOverBox(Model): Line 237  class ConstrainerOverBox(Model):
237                  shape=()                  shape=()
238               elif isinstance(val, list) or isinstance(val, tuple) :               elif isinstance(val, list) or isinstance(val, tuple) :
239                  shape=(len(val),)                  shape=(len(val),)
240               elif isinstance(val, numarray.NumArray):               elif isinstance(val, numpy.ndarray):
241                   shape=val.shape                   shape=val.shape
242               elif val == None:               elif val == None:
243                    shape=()                    shape=()
# Line 486  class ConstrainerAtBoxVertex(Model): Line 486  class ConstrainerAtBoxVertex(Model):
486                  shape=()                  shape=()
487               elif isinstance(val, list) or isinstance(val, tuple) :               elif isinstance(val, list) or isinstance(val, tuple) :
488                  shape=(len(val),)                  shape=(len(val),)
489               elif isinstance(val, numarray.NumArray):               elif isinstance(val, numpy.ndarray):
490                   shape=val.shape                   shape=val.shape
491               elif val == None:               elif val == None:
492                    shape=()                    shape=()
# Line 496  class ConstrainerAtBoxVertex(Model): Line 496  class ConstrainerAtBoxVertex(Model):
496                     vertex=[inf(x[0]),inf(x[1]),inf(x[2])]                     vertex=[inf(x[0]),inf(x[1]),inf(x[2])]
497               else:               else:
498                     vertex=[inf(x[0]),inf(x[1])]                     vertex=[inf(x[0]),inf(x[1])]
499               self.__location_of_constraint=whereZero(length(x-vertex),self.tol)*numarray.ones(shape)               self.__location_of_constraint=whereZero(length(x-vertex),self.tol)*numpy.ones(shape)
500               if not self.value == None:               if not self.value == None:
501                     self.__value_of_constraint=self.__location_of_constraint*self.value                     self.__value_of_constraint=self.__location_of_constraint*self.value
502  class ScalarConstrainerAtBoxVertex(Model):  class ScalarConstrainerAtBoxVertex(Model):
# Line 594  class VectorConstrainerAtBoxVertex(Model Line 594  class VectorConstrainerAtBoxVertex(Model
594            self.__location_of_constraint=Vector(0,x.getFunctionSpace())            self.__location_of_constraint=Vector(0,x.getFunctionSpace())
595            if self.domain.getDim()==3:            if self.domain.getDim()==3:
596               vertex=[inf(x[0]),inf(x[1]),inf(x[2])]               vertex=[inf(x[0]),inf(x[1]),inf(x[2])]
597               msk=numarray.zeros((3,))               msk=numpy.zeros((3,))
598               if self.comp_mask[0]: msk[0]=1               if self.comp_mask[0]: msk[0]=1
599               if self.comp_mask[1]: msk[1]=1               if self.comp_mask[1]: msk[1]=1
600               if self.comp_mask[2]: msk[2]=1               if self.comp_mask[2]: msk[2]=1
601            else:            else:
602               vertex=[inf(x[0]),inf(x[1])]               vertex=[inf(x[0]),inf(x[1])]
603               msk=numarray.zeros((2,))               msk=numpy.zeros((2,))
604               if self.comp_mask[0]: msk[0]=1               if self.comp_mask[0]: msk[0]=1
605               if self.comp_mask[1]: msk[1]=1               if self.comp_mask[1]: msk[1]=1
606            self.__location_of_constraint=whereZero(length(x-vertex),self.tol)*numarray.ones(shape)            self.__location_of_constraint=whereZero(length(x-vertex),self.tol)*numpy.ones(shape)
607            if not self.value == None:            if not self.value == None:
608                  self.__value_of_constraint=self.__location_of_constraint*self.value                  self.__value_of_constraint=self.__location_of_constraint*self.value
609    

Legend:
Removed from v.2406  
changed lines
  Added in v.2407

  ViewVC Help
Powered by ViewVC 1.1.26