~nizamov-shawkat/python-meep/devel

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
%pythoncode %{

import numpy
import sys

def master_printf(str, *args):
    master_printf_orig(str % args)

def debug_printf(str, *args):
    debug_printf_orig(str % args)

def abort(str, *args):
    abort_orig(str % args)

def quiet(q = True ):
    cvar.quiet = q
    return cvar.quiet  

def interrupt():
    return cvar.interrupt

def no_pml():
    return boundary_region()

# merged from EL branch
def getFluxData(pFluxPlane):
    """ 
    Retrieves a 2-dimensional array with the frequencies and flux values for a certain flux plane.
    """
    fd = fluxData(pFluxPlane) 
    freqRange = numpy.arange(fd.minFreq(), fd.maxFreq(), fd.deltaFreq() )                
    fluxVal = [fd.getFlux(freq) for freq in freqRange]
    return [freqRange, fluxVal]

m=MPI(sys.argv)

master_printf("Python-meep initialization OK \n")
quiet()

%}