4 from optparse
import OptionParser
9 from grid
import ExplicitSolver
, norm
15 Calculates error (norm) series
18 # parser initialization
19 parser
= OptionParser()
20 parser
.add_option('--hy', dest
='hy', default
='1e-7')
21 parser
.add_option('--hz', dest
='hz', default
='1e-7')
22 parser
.add_option('--ht', dest
='ht', default
='1e-16')
23 (opts
, args
) = parser
.parse_args()
26 time
= np
.double('1e-14')
27 ly
= np
.double('2e-5')
28 lz
= np
.double('2e-5')
30 ht
= np
.double(opts
.ht
)
31 hy
= np
.double(opts
.hy
)
32 hz
= np
.double(opts
.hz
)
34 solver
= ExplicitSolver(int(ly
/ hy
), int(lz
/ hz
), time
, ht
, solver
='inline')
39 for i
in xrange(u
.shape
[0]):
40 for j
in xrange(u
.shape
[1]):
41 u
[i
, j
] = Exm(i
* hy
, j
* hz
, time
, M
)
46 if __name__
== '__main__':