Hallo,
I'm trying to calculate the energy-flux of a propagating electromagnetic
field via Meep. Therefore, I want to track the calculated energy going
through some specific cutting plane every certain time intervals (a test
ctl-file is attached below). So I tried to include the "display-fluxes"
function as a step-function-argument into the "run-until" function (see
attached CTL-file) to be called every 50 time units. What happens then:
First: The function is called at time-step 0 (see output text) successfully.
Question: Why it is called the first time at t=0 (and not at t=50)?
Second: At time-step 50 an error occurs, so that the program doesn't enter
into the function at all but it exits with the given message.
I tried to use some other functions to avoid the problem, but also the
"save-flux" function leads to the same problem. The only way to run the
program is to call both of the functions "stand-alone" (not as a
step-function) after the run-function is completed!
Thomas Paul.
***************************************************************************
-----------
Initializing structure...
Working in 2D dimensions.
time for set_epsilon = 0.0345418 s
-----------
flux0:, 0.76, 0.0
flux0:, 0.804444444444444, 0.0
flux0:, 0.848888888888889, 0.0
flux0:, 0.893333333333333, 0.0
flux0:, 0.937777777777778, 0.0
flux0:, 0.982222222222222, 0.0
flux0:, 1.02666666666667, 0.0
flux0:, 1.07111111111111, 0.0
flux0:, 1.11555555555556, 0.0
flux0:, 1.16, 0.0
creating output file "./test-eps-000000.00.h5"...
creating output file "./test-ez-000010.00.h5"...
creating output file "./test-ez-000020.00.h5"...
creating output file "./test-ez-000030.00.h5"...
Meep progress: 35.3/100.0 = 35.3% done in 4.0s, 7.3s to go
on time step 1415 (time=35.375), 0.00282935 s/step
creating output file "./test-ez-000040.00.h5"...
creating output file "./test-ez-000050.00.h5"...
ERROR: In procedure procedure-property:
ERROR: Wrong type argument in position 1: (#<unspecified> #<unspecified>
#<unspecified> #<unspecified> #<unspecified> #<unspecified> #<unspecified>
#<unspecified> #<unspecified> #<unspecified>)
***************************************************************************
***************************************************************************
* CTL-CONTROL-FILE
***************************************************************************
(define sx 10) ; size of cell in X direction
(define sy 10) ; size of cell in Y direction
(define sz 0) ; size of cell in Y direction
(set! geometry-lattice (make lattice (size sx sy no-size)))
(define source1 (make source
(src (make gaussian-src (frequency 0.96) (fwidth 0.2)))
(component Ez)
(center (vector3 (+ (* -0.5 sx) 2) 0 0))
(size (vector3 0 sy 0))
)
)
(set! sources (list source1))
(set! pml-layers (list (make pml (thickness 1.0))))
(set! resolution 20)
(set! force-complex-fields? false)
(set! output-single-precision? true)
(set! eps-averaging? false)
(define outputVolume (volume (center 0 0 0) (size sx sy 0)))
(define fluxPlane1 (make flux-region
(center 0 0 0)
(size 0 sy 0)
(direction X)))
(define fP1 (add-flux 0.96 0.4 100 fluxPlane1))
(run-until 100
(at-beginning output-epsilon)
(at-every 10 (in-volume outputVolume output-efield-z))
(at-every 50 (display-fluxes fP1))
)
_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss