/[escript]/trunk/escript/py_src/pdetools.py
ViewVC logotype

Diff of /trunk/escript/py_src/pdetools.py

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

revision 2947 by jfenwick, Thu Jan 28 02:03:15 2010 UTC revision 2948 by gross, Thu Feb 25 04:54:30 2010 UTC
# Line 340  class Locator: Line 340  class Locator:
340         iterative=False         iterative=False
341         if isinstance(x, list):         if isinstance(x, list):
342             if len(x)==0:             if len(x)==0:
343                raise "ValueError", "At least one point must be given."                raise ValueError, "At least one point must be given."
344             try:             try:
345               iter(x[0])               iter(x[0])
346               iterative=True               iterative=True
# Line 348  class Locator: Line 348  class Locator:
348               iterative=False               iterative=False
349         if iterative:         if iterative:
350             self.__id=[]             self.__id=[]
351               xxx=self.__function_space.getX()
352             for p in x:             for p in x:
353                self.__id.append(util.length(self.__function_space.getX()-p[:self.__function_space.getDim()]).minGlobalDataPoint())                self.__id.append(util.length(xxx-p[:self.__function_space.getDim()]).minGlobalDataPoint())
354         else:         else:
355             self.__id=util.length(self.__function_space.getX()-x[:self.__function_space.getDim()]).minGlobalDataPoint()             self.__id=util.length(xxx-x[:self.__function_space.getDim()]).minGlobalDataPoint()
356    
357       def __str__(self):       def __str__(self):
358         """         """

Legend:
Removed from v.2947  
changed lines
  Added in v.2948

  ViewVC Help
Powered by ViewVC 1.1.26