Commit c7294d77eff5aaf843ca9e448991db5ce22d0dbd

using better function prototype
  
1313new_hfield = grid.Plane(shape=(301,301), timestep=1, spacestep=2*3*10**8)
1414
1515
16for step in range(1,300):
16for step in range(1,30):
1717 new_efield.y[151,151] += float(mpmath.sin(step*mpmath.pi/6.125))*2
1818 new_efield = update_efield( new_efield, new_hfield )
1919 new_hfield.z[151,151] += float(mpmath.sin(step*mpmath.pi/6.125))*2
4343 pylab.savefig("result_slice/fdtd_plane_slice-%s.png" % str(step))
4444 pylab.clf()
4545
46os.system("open result")
47os.system("open result_slice")
48print "done"
46if "Darwin" in os.uname():
47 os.system("open result")
48 os.system("open result_slice")
  
77 """
88 """
99 new_efield = grid.Plane( abuffer = efield )
10
1011 (xaxis,yaxis) = efield.x.shape
12
1113 for i in range(1,xaxis-1):
1214 for j in range(1,yaxis-1):
1315 if (i+j)%2 == 1:
1416 pass
17
1518 return new_efield
1619
1720
  
3333 Two dimension grid object
3434 """
3535
36 def __init__(self, abuffer=None, shape=None, eps=None, mu=None, sigmae=None, sigmah=None, timestep=None, spacestep=None):
36 def __init__(self, abuffer=None, shape=None, eps=epsilon_0, mu=mu_0, sigmae=0, sigmah=0, timestep=None, spacestep=None):
3737 """
3838 Give one of shape or abuffer to initialize Plane object.
3939
6969 self.y = numpy.zeros(shape, dtype="float128")
7070 self.z = numpy.zeros(shape, dtype="float128")
7171
72 self.eps = numpy.ndarray(shape=self.x.shape, dtype="float128"); self.eps[0:,0:] = (eps or epsilon_0)
73 self.mu = numpy.ndarray(shape=self.x.shape, dtype="float128"); self.mu[0:,0:] = (mu or mu_0)
74 self.sigmae = numpy.ndarray(shape=self.x.shape, dtype="float128"); self.sigmae[0:,0:] = (sigmae or 0)
75 self.sigmah = numpy.ndarray(shape=self.x.shape, dtype="float128"); self.sigmah[0:,0:] = (sigmah or 0)
72 self.eps = numpy.ndarray(shape=self.x.shape, dtype="float128"); self.eps[0:,0:] = eps
73 self.mu = numpy.ndarray(shape=self.x.shape, dtype="float128"); self.mu[0:,0:] = mu
74 self.sigmae = numpy.ndarray(shape=self.x.shape, dtype="float128"); self.sigmae[0:,0:] = sigmae
75 self.sigmah = numpy.ndarray(shape=self.x.shape, dtype="float128"); self.sigmah[0:,0:] = sigmah
7676
7777 self.timestep = (timestep or 1)
7878 self.spacestep = (spacestep or 1)