Dear Meep-Users,

Could someone please explain why the following code for generation of a
structure doesn't work if  blk2? is false (it works fine if blk2? is
true).

Note that the failure occurs when the run command is executed. For
example:
(run-until final-time
    (at-beginning output-epsilon)
    (at-end output-efield-z))


> (define-param blk2? true)
> (define-param blk1-xcen 0)
> (define-param blk1-ycen 0)
> (define-param blk1-xsize 10)
> (define-param blk1-ysize 1)
> (define-param blk1-eps 12)
> (define-param blk2-xcen 0)
> (define-param blk2-ycen 2)
> (define-param blk2-xsize 10)
> (define-param blk2-ysize 1)
> (define-param blk2-eps 6)
> (set! geometry (list
>   (make block (center blk1-xcen blk1-ycen)
>     (size blk1-xsize blk1-ysize infinity)
>       (material (make dielectric (epsilon blk1-eps))))
>   (if blk2?
>     (begin
>       (display "blk2 being made")
>       (newline)
>       (make block (center blk2-xcen blk2-ycen)
>         (size blk2-xsize blk2-ysize infinity)
>           (material (make dielectric (epsilon blk2-eps))))))))

If blk2? is true the simulation runs fine.  If blk2 is false, the output given 
is:

> Backtrace:
> In current input:
>    1:  0* [run-until 500 #<procedure #f (to-do)>]
>    ?:  1* (if (null? fields) (init-fields))
>    ?:  2  [init-fields]
>    ?:  3* (if (null? structure) (init-structure k-point))
>    ?:  4  [init-structure #f]
>     ...
>    ?:  5  (set! structure (make-structure (infer-dimensions k) s ...))
>    ?:  6* [make-structure 2 #(27.895 16.53 1.0e-20) ...]
>    ?:  7* [object-property-value {#<unspecified>} material]
>    ?:  8* [assoc-ref ...
>    ?:  9*  [object-property-values {#<unspecified>}]
>    ?: 10   [cdr {#<unspecified>}]
> 
> <unnamed port>: In procedure cdr in expression (cdr object):
> <unnamed port>: Wrong type (expecting pair): #<unspecified>
> ABORT: (wrong-type-arg)

Any help greatly appreciated.

John

-- 
John Dell
Microelectronics Research Group
School of Electrical, Electronic and Computer Engineering
The University of Western Australia
M018, 35 Stirling Hwy, CRAWLEY, WA, 6009, AUSTRALIA
Tel:   +61 8 6488 3112
Fax:   +61 8 6488 105
Email: jo...@ee.uwa.edu.au
Web:   http://mrg.ee.uwa.edu.au/ 



_______________________________________________
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