On Sep 11, 2008, at 3:11 AM, phcgroup wrote:
>
> I write a part of code to generate a source which has random phase  
> and orientation in time,
>
> (set! *random-state* (seed->random-state (current-time))); you  
> mentioned put this at the top of the .ctl file in a former mail, I  
> am not sure if is needed now.

That's still needed, otherwise the "random" numbers will be the same  
every time you run Meep.

> Am I right?

Well, you have a certain kind of randomness there.  Whether this is  
"right" depends on whether this is the random distribution that you  
want.

> I know If I want a bunch of sources, I need to write a loop. I think  
> I need to write the loop inside (set! sources (list...)), because  
> (set! sources...) will replace the former source when a outside loop  
> call (set! sources...) every time. Am I right? How to write a loop  
> inside (set! sources (list...))?


Well, in your loop body you can do
     (set! sources (append sources (list .....)))
to add new items to the previous sources list.

Steven

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

Reply via email to