~emmanuel-lambert/python-meep/intec

« back to all changes in this revision

Viewing changes to tests/physical.py

  • Committer: emmanuel.lambert at ugent
  • Date: 2009-12-01 13:23:31 UTC
  • Revision ID: emmanuel.lambert@intec.ugent.be-20091201132331-4y3ad7wvx1fjnzog
merging

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/env python 
 
1
#!/usr/bin/env python
2
2
# passed
3
3
from meep import *
4
4
from math import fabs,sqrt
5
5
 
 
6
quiet(True)
 
7
 
6
8
def radiating_2D(xmax):
7
9
    a = 10.0
8
10
    ymax = 3.0
55
57
    master_printf("Ratio is %g from (%g %g) and (%g %g)\n", ratio, amp1.real, amp1.imag, amp2.real, amp2.imag)
56
58
    if (ratio > 2.12 or ratio < 1.88):
57
59
        abort("Failed\n")
58
 
    return True 
 
60
    return True
59
61
 
60
62
print "radiating source should decay spatially as 1/sqrt(r) in 2D."
61
63
radiating_2D(8.0)