On Sat, 22 Dec 2007, Manoj Rajagopalan wrote:
>   I was browsing the source code to see how geometric objects like 
> spheres, cones, cylinders etc can be specified with dispersive materials 
> and after spending many hours I'm still lost.
>
>   Am I right in understanding that solid geometry primitives are handled 
> by the interface to libctl? If so then how can I include such objects in 
> a pure C++ program?

Right.  The C++ Meep code knows nothing about geometric objects.  You 
just pass an arbitrary epsilon(r) function, which you can define in any 
way that you want.

Originally, we just wrote our own functions to implement spheres, 
cylinders, etcetera, on a case-by-case basis.  This is not too hard, 
usually.  However, if you have lots of objects it is much faster to use 
libctl (or some other solid geometry library), since libctl has a 
tree-based logarithmic time lookup routine to find out which object goes 
with a given point.

To use libctl's geometry routines directly, it is possible to link to 
libctlgeom.a (-lctlgeom).   However, this is not really documented at the 
moment; you have to read the source code.

>   One method seems to be to declare a "double eps(vec const&)" 
> permittivity function which can contain information about the geometry 
> of the "scene" but I don't think this helps with dispersive materials. 
> If i understand correctly, this function will work only for simple 
> dielectrics or for monochromatic excitations.

Right, in the C++ interface you specify the nondispersive epsilon via an 
eps(r) function.  To specify the location of the dispersive material, you 
pass a sigma(r) function to add_polarization.  And to specify the Kerr 
material, you pass a similar function to add_kerr, etc.

Regards,
Steven G. Johnson

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

Reply via email to