Dear Steven and Meep users,

It seems that when-true function and at-time do not want to work together.

Let me explain. I am trying to write a script which after reaching steady
flow will do something (presumably integrate flux over a period),
so as far as the steadiness condition is satisfied function (when-true ...)
should wait some time (here 100) and than evaluate another step function
which in turn will stop the computation.
But the computation stops when the steadiness condition is satisfied.

Am I doing something wrong?

Here is a relevant piece of .ctl file:
-----------------------------------------------------------------------------------------
(define field_pro 1) ;;field at T-50
(define field_now 0.1) ;;field at T
(define time_now 0.0)
(define TT 0)

(define (my-step-function)
       (set! field_pro field_now)
       (set! time_now (meep-time))
       (set! TT (+ time_now 100))
       (print "TT" TT "\n")
       (set! field_now (* (max-abs-field-function (list Hz) f (volume (size
(/ 2 fcen) (- sy 2)) (center (- (* 0.5 sx) (+ (+ 1 (/ 1 fcen)) pmlthick))
0)))
                          (max-abs-field-function (list Hz) f (volume (size
(/ 2 fcen) (- sy 2)) (center (- (* 0.5 sx) (+ (+ 1 (/ 1 fcen)) pmlthick))
0)))
      )
       )
    (print "field pro/field now:" (/ field_pro field_now) "\n")
)

(define alpha false)
(define (alpha-step-func) (set! alpha true)  )
(run-until (lambda () (eq? alpha true))
   (after-time 50 (at-every 50 my-step-function))
   (when-true (lambda () (< (abs (- 1 (/ field_pro field_now))) 0.2))
   (after-time TT alpha-step-func))
)
------------------------------------------------------------------------------------------

I would be very grateful for the help.
Thank you in advance.

Best,
Ruslan
_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Reply via email to