Discussion:
[Meep-discuss] Prism will not extend to negative z values
Alexander Davis
2018-11-15 18:27:37 UTC
Permalink
Hi All,


I am trying to define a prism object in addition to a few blocks. No matter what I set my z-values as for the vertices, the prism will only ever take up half of the domain. I am attempting to set the prism face at the bottom of the domain and have it extend to the top of the domain. Has anyone ever had this problem/know how to fix it?


Code:


(set! geometry (list
(make block ; upper lamina
(center 0 0 0)
(size ult sy sz)
(material (make medium (epsilon refr))))
(make block ; hole 1
(center 0 0 0)
(size ult ywid zwid)
(material (make medium (epsilon 1))))
(make block ; hole 2
(center 0 0 (- (+ zwid crt)))
(size ult ywid zwid)
(material (make medium (epsilon 1))))
(make block ; hole 3
(center 0 0 (+ zwid crt))
(size ult ywid zwid)
(material (make medium (epsilon 1))))
(make block ; lower lamina
(center (- (+ ild llt)) 0 0)
(size llt sy sz)
(material (make medium (epsilon refr))))
(make prism ; One of the ridges
(vertices
(list
(vector3 (* 0.5 ult) (* 0.5 sy) -5)
(vector3 (+ rh (* 0.5 ult)) (- (* 0.5 sy) 0.13) -5)
(vector3 (+ rh (* 0.5 ult)) (- (* 0.5 sy) 0.23) -5)
(vector3 (* 0.5 ult) (* 0.5 ywid) -5)))
(height (* 50 sz))
(center (vector3 0 0))
(material (make medium (epsilon refr))))))



Thanks!
Ardavan Oskooi
2018-11-15 22:19:18 UTC
Permalink
Post by Alexander Davis
I am trying to define a prism object in addition to a few blocks. No
matter what I set my z-values as for the vertices, the prism will only
ever take up half of the domain. I am attempting to set the prism face
at the bottom of the domain and have it extend to the top of the
domain. Has anyone ever had this problem/know how to fix it?
As explained in the documentation
(https://meep.readthedocs.io/en/latest/Scheme_User_Interface/#prism),
the center property of a prism object should be ignored. (Note: this is
not the case in the Python interface:
https://meep.readthedocs.io/en/latest/Python_User_Interface/#prism).
Thus, it seems that this could be a bug where the center property which
you have defined as (0,0,0) is being used somehow internally in the
prism definition. What happens when you remove the center property in
the prism definition?
Ardavan Oskooi
2018-11-16 00:24:20 UTC
Permalink
Turns out this is a bug; thanks for catching this. I have filed a bug
report: https://github.com/stevengj/meep/issues/608. Should be fixed soon.
Post by Alexander Davis
Hi All,
I am trying to define a prism object in addition to a few blocks. No
matter what I set my z-values as for the vertices, the prism will only
ever take up half of the domain. I am attempting to set the prism face
at the bottom of the domain and have it extend to the top of the
domain. Has anyone ever had this problem/know how to fix it?
(set! geometry (list
(make block                         ; upper lamina
(center 0 0 0)
(size ult sy sz)
(material (make medium (epsilon refr))))
(make block                         ; hole 1
(center 0 0 0)
(size ult ywid zwid)
(material (make medium (epsilon 1))))
(make block                         ; hole 2
(center 0 0 (- (+ zwid crt)))
(size ult ywid zwid)
(material (make medium (epsilon 1))))
(make block                         ; hole 3
(center 0 0 (+ zwid crt))
(size ult ywid zwid)
(material (make medium (epsilon 1))))
(make block                         ; lower lamina
(center (- (+ ild llt)) 0 0)
(size llt sy sz)
(material (make medium (epsilon refr))))
(make prism                         ; One of the ridges
(vertices
 (list
  (vector3 (* 0.5 ult) (* 0.5 sy) -5)
    (vector3 (+ rh (* 0.5 ult)) (- (* 0.5 sy) 0.13) -5)
    (vector3 (+ rh (* 0.5 ult)) (- (* 0.5 sy) 0.23) -5)
    (vector3 (* 0.5 ult) (* 0.5 ywid) -5)))
                                  (height (* 50 sz))
                                  (center (vector3 0 0))
                                  (material (make medium (epsilon
refr))))))
Loading...