On Aug 13, 2008, at 12:12 PM, asadollahbaik a. (aa306) wrote: > Dear Meep users, > > I am trying to define a structure of 2D photonic crystal. In this > structure I need to define lets say a region of 10 by 10 rods in a > hexagon lattice, shifted by the vector ( 10 10 0). > I am trying to do that in meep by “shift-geomtric-object”: > (set! geometry (shift-geometric-object geometry (vector3 10 10 0))) > Meep gives me an error:
"geometry" is a list of object. The first argument to shift-geometric- object is a single object, not a list of objects. (An important rule to remember in computer programming: know what types of arguments a function expects!) What you need to do is to use "map" to apply shift-geometric-object to each object in the geometry list, and produce a new list. e.g. (set! geometry (map (lambda (o) (shift-geometric-object o (vector3 10 10))) geometry)) If you don't understand the "map" function or the "lambda" construct, any reference on Scheme (see the links in the manual) will explain them. Steven _______________________________________________ meep-discuss mailing list [email protected] http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

