/[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 437 by gross, Fri Jan 20 00:16:58 2006 UTC revision 441 by gross, Fri Jan 20 03:40:39 2006 UTC
# Line 45  import os Line 45  import os
45  # def matchShape(arg0,arg1):  # def matchShape(arg0,arg1):
46    
47  # def transpose(arg,axis=None):  # def transpose(arg,axis=None):
 # def trace(arg,axis0=0,axis1=1):  
48  # def reorderComponents(arg,index):  # def reorderComponents(arg,index):
49    
 # def integrate(arg,where=None):  
 # def interpolate(arg,where):  
 # def div(arg,where=None):  
 # def grad(arg,where=None):  
   
50  #  #
51  # slicing: get  # slicing: get
52  #          set  #          set
# Line 4188  def div(arg,where=None): Line 4182  def div(arg,where=None):
4182      @return: divergence of arg.      @return: divergence of arg.
4183      @rtype:  L{escript.Data} or L{Symbol}      @rtype:  L{escript.Data} or L{Symbol}
4184      """      """
4185      if not arg.getShape()==(arg.getDomain().getDim(),):      if isinstance(arg,Symbol):
4186        raise ValueError,"div: expected shape is (%s,)"%arg.getDomain().getDim()          dim=arg.getDim()
4187        elif isinstance(arg,escript.Data):
4188            dim=arg.getDomain().getDim()
4189        else:
4190            raise TypeError,"div: argument type not supported"
4191        if not arg.getShape()==(dim,):
4192          raise ValueError,"div: expected shape is (%s,)"%dim
4193      return trace(grad(arg,where))      return trace(grad(arg,where))
4194    
4195  def jump(arg,domain=None):  def jump(arg,domain=None):

Legend:
Removed from v.437  
changed lines
  Added in v.441

  ViewVC Help
Powered by ViewVC 1.1.26