/[escript]/trunk/doc/user/examples/mytools.py
ViewVC logotype

Diff of /trunk/doc/user/examples/mytools.py

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

revision 326 by jgs, Wed Nov 9 02:02:19 2005 UTC revision 327 by gross, Wed Dec 7 04:32:28 2005 UTC
# Line 1  Line 1 
1  # $Id$  # $Id$
2  from esys.linearPDEs import LinearPDE  from esys.escript.linearPDEs import LinearPDE
3    from esys.escript import kronecker
4  import numarray  import numarray
5  class Helmholtz(LinearPDE):  class Helmholtz(LinearPDE):
6     def setValue(self,kappa=0,omega=1,f=0,eta=0,g=0):     def setValue(self,kappa=0,omega=1,f=0,eta=0,g=0):
7          # get spatial dimension          # get spatial dimension
8          ndim=self.getDim()          ndim=self.getDim()
         # get kronecker symbol from numarray: kronecker[i,j]=1 for i=j and =0 else  
         kronecker=numarray.identity(ndim)  
9          # map kappa, omega, f, eta, g to the coefficients of the general PDE          # map kappa, omega, f, eta, g to the coefficients of the general PDE
10          self._LinearPDE__setValue(A=kappa*kronecker,D=omega,Y=f,d=eta,y=g)          super(Helmholtz, self).setValue(A=kappa*kronecker(ndim),D=omega,Y=f,d=eta,y=g)

Legend:
Removed from v.326  
changed lines
  Added in v.327

  ViewVC Help
Powered by ViewVC 1.1.26