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

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

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

revision 103 by jgs, Wed Dec 15 07:08:39 2004 UTC revision 104 by jgs, Fri Dec 17 07:43:12 2004 UTC
# Line 196  def length(arg): Line 196  def length(arg):
196      @param arg      @param arg
197      """      """
198      if isinstance(arg,escript.Data):      if isinstance(arg,escript.Data):
199         return arg.length()         if arg.getRank()==1:
200              sum=escript.Scalar(0,arg.getFunctionSpace())
201              for i in range(arg.getShape()[0]):
202                 sum+=arg[i]**2
203              return sqrt(sum)
204           else:
205              raise SystemError,"length is not been implemented yet"
206           # return arg.length()
207      else:      else:
208         return sqrt((arg**2).sum())         return sqrt((arg**2).sum())
209    
# Line 274  def dot(arg1,arg2): Line 281  def dot(arg1,arg2):
281         return arg2.dot(arg1)         return arg2.dot(arg1)
282      else:      else:
283         return numarray.dot(arg1,arg2)         return numarray.dot(arg1,arg2)
284    #
285    # $Log$
286    # Revision 1.6  2004/12/17 07:43:10  jgs
287    # *** empty log message ***
288    #
289    # Revision 1.2.2.5  2004/12/17 00:06:53  gross
290    # mk sets ESYS_ROOT is undefined
291    #
292    # Revision 1.2.2.4  2004/12/07 03:19:51  gross
293    # options for GMRES and PRES20 added
294    #
295    # Revision 1.2.2.3  2004/12/06 04:55:18  gross
296    # function wraper extended
297    #
298    # Revision 1.2.2.2  2004/11/22 05:44:07  gross
299    # a few more unitary functions have been added but not implemented in Data yet
300    #
301    # Revision 1.2.2.1  2004/11/12 06:58:15  gross
302    # a lot of changes to get the linearPDE class running: most important change is that there is no matrix format exposed to the user anymore. the format is chosen by the Domain according to the solver and symmetry
303    #
304    # Revision 1.2  2004/10/27 00:23:36  jgs
305    # fixed minor syntax error
306    #
307    # Revision 1.1.1.1  2004/10/26 06:53:56  jgs
308    # initial import of project esys2
309    #
310    # Revision 1.1.2.3  2004/10/26 06:43:48  jgs
311    # committing Lutz's and Paul's changes to brach jgs
312    #
313    # Revision 1.1.4.1  2004/10/20 05:32:51  cochrane
314    # Added incomplete Doxygen comments to files, or merely put the docstrings that already exist into Doxygen form.
315    #
316    # Revision 1.1  2004/08/05 03:58:27  gross
317    # Bug in Assemble_NodeCoordinates fixed
318    #
319    #

Legend:
Removed from v.103  
changed lines
  Added in v.104

  ViewVC Help
Powered by ViewVC 1.1.26