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) 