Hi all!

I'm currently working on a small simulation that requires me to vary the 
geometry (specifically, changing epsilon) as Meep is running. From what I've 
gleaned through looking in the archives, I would need to set up my new 
geometry, call init-structure, and then meep-fields-phase-in-material but I 
can't seem to get my code working.


When I run my code, Meep will either finish after 1 step with no errors or show 
strangely shaped epsilons distributed outside of where they should be centred. 
I was hoping someone would have any tips on how to implement 
fields-phase-in-material correctly using Scheme. Here are the relevant bits of 
my code;

(set! geometry-lattice (make lattice (size 20 4 no-size)))
(set! pml-layers (list (make pml (thickness 1))))
(set! resolution 20)

(set! geometry (list
(make block (center -5 0) (size 10 0.22 infinity)
(material (make dielectric (epsilon eps))))
(make block (center 5 0) (size 10 0.22 infinity)
(material (make dielectric (epsilon eps))))
)
)

(set! sources (list
(make source
(src (make continuous-src (frequency w1)))
(component Ez) (center -8 0) (size 0 0.22))))

;input 3 vector, output modulation profile
(define modulationProfile (lambda (position)
; (+ eps (* 0.5 (cos (+ (* Omega (meep-time)) (* q (vector3-x position))))))
1
))

(define (updateEpsilon)
(set! geometry (list
;unmodulated region
(make block (center -5 0) (size 10 0.22 infinity)
(material (make dielectric (epsilon eps))))
;modulated region
(make block (center 5 0) (size 10 0.22 infinity)
(material (make material-function (epsilon-func modulationProfile))))
))
(init-structure)
(meep-fields-phase-in-material fields structure 1)
)

(use-output-directory)
(run-until 100
(at-every 1
output-epsilon
(output-png Ez "-S3 -Zc dkbluered -C $EPS")
updateEpsilon)
)

I also had a look at the corresponding C++ function 
https://github.com/stevengj/meep/blob/master/src/fields.cpp#L582, but the only 
hint I see is that possibly the set of chunks i'm trying to phase in are not 
similar.

Best,
Daniel
_______________________________________________
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Reply via email to