Commit 57b03a4581162b50094ab577a84dd49f0aab4db7
- Diff rendering mode:
- inline
- side by side
fdtd_plane.py
(15 / 0)
|   | |||
| 1 | #!/usr/bin/env python | ||
| 2 | #-*- mode: python -*- | ||
| 3 | |||
| 4 | import convention | ||
| 5 | |||
| 6 | from fdtd import source, grid, mesher | ||
| 7 | |||
| 8 | pprint(locals()) | ||
| 9 | |||
| 10 | # program start | ||
| 11 | |||
| 12 | p = grid.Plane(numpy.zeros((100,100))) | ||
| 13 | print(p) | ||
| 14 | p = mesher.plane(numpy.zeros((10,10))) | ||
| 15 | print(p) |
fdtd_string.py
(1 / 2)
|   | |||
| 1 | 1 | #!/usr/bin/env python | |
| 2 | 2 | ||
| 3 | from convention import * | ||
| 4 | import_convention(globals()) | ||
| 3 | import convention | ||
| 5 | 4 | ||
| 6 | 5 | import fdtd | |
| 7 | 6 |
show_img.py
(1 / 3)
|   | |||
| 1 | 1 | #!/usr/bin/env python | |
| 2 | 2 | #-*- mode: python -*- | |
| 3 | 3 | ||
| 4 | from convention import * | ||
| 5 | import_convention(globals()) | ||
| 4 | import convention | ||
| 6 | 5 | ||
| 7 | 6 | from pylab import * | |
| 8 | 7 | from mpmath import * | |
| 9 | |||
| 10 | 8 | ||
| 11 | 9 | # program start | |
| 12 | 10 | data = numpy.zeros((50,50)) |
wave_source.py
(4 / 4)
|   | |||
| 1 | 1 | #!/usr/bin/env python | |
| 2 | 2 | #-*- mode: python -*- | |
| 3 | 3 | ||
| 4 | from convention import * | ||
| 5 | import_convention(globals()) | ||
| 6 | 4 | ||
| 5 | import convention | ||
| 6 | |||
| 7 | 7 | from fdtd.source import * | |
| 8 | 8 | ||
| 9 | 9 | # program start | |
| 10 | 10 | ||
| 11 | # plot polynomial | ||
| 11 | 12 | t = numpy.arange(-10, 10, 0.001) | |
| 12 | 13 | ||
| 13 | 14 | pylab.plot(t, map( polynomial_pulse, t ) ) | |
| … | … | ||
| 22 | 22 | pylab.gcf().clear() | |
| 23 | 23 | os.system("open poly.png") | |
| 24 | 24 | ||
| 25 | |||
| 26 | |||
| 25 | # plot gaussian | ||
| 27 | 26 | one = numpy.ones_like(t) | |
| 28 | 27 | ||
| 29 | 28 | pylab.plot(t, map( gaussian, t, one*2, one*3 ) ) |

