Meep Reference

From AbInitio

(Difference between revisions)
Jump to: navigation, search
Revision as of 19:56, 4 November 2005 (edit)
Stevenj (Talk | contribs)
(cat)
← Previous diff
Revision as of 04:55, 7 November 2005 (edit)
Stevenj (Talk | contribs)

Next diff →
Line 5: Line 5:
[[Category:Meep]] [[Category:Meep]]
 +
 +==Input Variables==
 +These are global variables that you can set to control various parameters of the Meep computation. In brackets after each variable is the type of value that it should hold. (The classes, complex datatypes like <code>geometric-object</code>, are described in a later subsection. The basic datatypes, like <code>integer</code>, <code>boolean</code>, <code>cnumber</code>, and <code>vector3</code>, are defined by [[libctl User Reference|libctl]].)
 +
 +; <code>geometry</code> [list of <code>geometric-object</code> class]
 +: Specifies the geometric objects making up the structure being simulated. When objects overlap, later objects in the list take precedence. Defaults to no objects (empty list).
 +; <code>sources</code> [list of <code>source</code> class]
 +: Specifies the current sources to be present in the simulation; defaults to none.
 +; <code>symmetries</code> [list of <code>symmetry</code> class]
 +: Specifies the spatial (mirror/rotation) symmetries to exploit in the simulation (defaults to none). The symmetries ''must'' be obeyed by ''both'' the structure ''and'' by the sources. See also: [[Exploiting symmetry in Meep]].
 +; <code>pml-layers</code> [list of <code>pml</code> class]
 +: Specifies the absorbing [[perfectly matched layers|PML]] boundary layers to use; defaults to none.
 +; <code>default-material</code> [<code>material-type</code> class]
 +: Holds the default material that is used for points not in any object of the geometry list. Defaults to <code>air</code> (&epsilon; of 1).
 +; <code>geometry-lattice</code> [<code>lattice</code> class]
 +: Specifies the the size of the unit cell (which is centered on the origin of the coordinate system). If any dimension of the lattice <code>size</code> is the special value <code>no-size</code>, then the dimension of the lattice is reduced (i.e. it becomes two- or one-dimensional) by default. Defaults to a cubic cell of unit size.
 +; <code>dimensions</code> [<code>integer</code>]
 +: Explicitly specifies the dimensionality of the simulation, if the value is less than 3. If the value is 3 (the default), then the dimensions are automatically reduced if possible when any of the <code>geometry-lattice</code> sizes are <code>no-size</code>. If <code>dimensions</code> is the special value of <code>CYLINDRICAL</code>, then cylindrical coordinates are used and the <math>x</math> and <math>z</math> dimensions are interpreted as <math>r</math> and <math>z</math>, respectively.
 +; <code>m</code> [<code>number</code>]
 +: For <code>CYLINDRICAL</code> simulations, specifies that the angular &phi; dependence of the fields is of the form <math>e^{im\phi}</math> (default is <code>m=0</code>). If the simulation cell includes the origin <math>r=0</math>, then <code>m</code> must be an integer.
 +; <code>resolution</code> [<code>number</code> or <code>vector3</code>]
 +: Specifies the computational grid resolution, in pixels per distance unit. Defaults to <code>10</code>.
 +; <code>ensure-periodicity</code> [<code>boolean</code>]
 +; <code>k-point</code> [<code>false</code> or <code>vector3</code>]
 +: If <code>false</code> (the default), then the boundaries are perfect metallic (zero electric field). If a vector, then the boundaries are Bloch-periodic: the fields at one side are <math>\exp(i\mathbf{k}\cdot\mathbf{R})</math> times the fields at the other side, separated by the lattice vector <math>\mathbf{R}</math>. The <code>k-point</code> vector is specified in ''Cartesian'' coordinates, in units of 2&pi;/distance. (This is ''different'' from [[MPB]], equivalent to taking MPB's <code>k-points</code> through the function <code>reciprocal->cartesian</code>.)
 +; <code>ensure-periodicity</code> [<code>boolean</code>]
 +: If <code>true</code> (the default), ''and'' if the boundary conditions are periodic (<code>k-point</code> is not <code>false</code>), then the geometric objects are automatically repeated periodically according to the lattice vectors (the size of the computational cell).
 +; <code>force-complex-fields?</code> [<code>boolean</code>]
 +: By default, Meep runs its simulations with purely real fields whenever possible. It uses complex fields (which require twice the memory and computation) if the <code>k-point</code> is non-zero or if <code>m</code> is non-zero. However, by setting <code>force-complex-fields?</code> to <code>true</code>, Meep will always use complex fields. See also: [[Complex fields in Meep]].
 +; <code>filename-prefix</code> [<code>string</code>]
 +: A string prepended to all output filenames. Defaults to the name of the current ctl file, with ".ctl" replaced by "-" (e.g. <code>foo.ctl</code> uses a <code>"foo-"</code> prefix).
 +; <code>Courant</code> [<code>number</code>]
 +; Specify the Courant factor <math>S</math> which relates the time step size to the spatial discretization: <math>c\Delta t = S\Delta x</math>. Default is <code>0.5</code>. For numerical stability, the Courant factor must be ''at most'' <math>1/\sqrt{\textrm{# dimensions}}</math>, and in practice should be slightly smaller.
 +; <code>output-volume</code> [<code>meep::geometric_volume*</code>]
 +: Specifies the default region of space that is output by the HDF5 output functions (below); see also the <code>(volume ...)</code> function to create <code>meep::geometric_volume*</code> objects. The default is <code>'()</code> (null), which means that the whole computational cell is output. Normally, you should use the <code>(in-volume ...)</code> function to modify the output volume instead of setting <code>output-volume</code> directly.
 +; <code>progress-interval</code> [<code>number</code>]
 +: Time interval (seconds) after which Meep prints a progress message; default is 4 seconds.
 +
 +The require a bit more understanding of the inner workings of Meep to use (see also the [[#SWIG wrappers|SWIG wrappers]]).
 +
 +; <code>structure</code> [<code>meep::structure*</code>]
 +: Pointer to the current structure being simulated; initialized by <code>(init-structure)</code> which is called automatically by <code>(init-fields)</code> which is called automatically by any of the <code>(run)</code> functions.
 +; <code>fields</code> [<code>meep::fields*</code>]
 +: Pointer to the current fields being simulated; initialized by <code>(init-fields)</code> which is called automatically by any of the <code>(run)</code> functions.
 +; <code>num-chunks</code> [<code>integer</code>]
 +; Minimum number of "chunks" (subarrays) to divide the structure/fields into (default 0); actual number is determined by number of processors, PML layers, etcetera. (Mainly useful for debugging.)
 +
 +== Predefined Variables ==
 +
 +Variables predefined for your convenience and amusement.
 +
 +; <code>air</code>, <code>vacuum</code> [<code>material-type</code> class]
 +: Two aliases for a predefined material type with a dielectric constant of 1.
 +; <code>metal</code> [<code>material-type</code> class]
 +: A predefined material type corresponding to a perfectly conducting metal (in which the electric field is zero).
 +; <code>nothing</code> [<code>material-type</code> class]
 +: A material that, effectively, punches a hole through other objects to the background (<code>default-material</code> or <code>epsilon-input-file</code>).
 +; <code>infinity</code> [<code>number</code>]
 +: A big number (1.0e20) to use for "infinite" dimensions of objects.
 +; <code>pi</code> [<code>number</code>]
 +: &pi; (3.14159...).

Revision as of 04:55, 7 November 2005

Meep
Download
Release notes
FAQ
Meep manual
Introduction
Installation
Tutorial
Reference
C++ Tutorial
C++ Reference
Acknowledgements
License and Copyright

Here, we document the features exposed to the user by the Meep package. We do not document the Scheme language or the functions provided by libctl (see also the libctl User Reference section of the libctl manual).

This page is simply a compact listing of the functions exposed by the interface; for a gentler introduction, see the Meep tutorial. Also, we note that this page is not, and probably never will be, a complete listing of all functions. In particular, because of the SWIG wrappers, every function in the C++ interface is accessible from Scheme, but not all of these functions are documented or intended for end users.

Input Variables

These are global variables that you can set to control various parameters of the Meep computation. In brackets after each variable is the type of value that it should hold. (The classes, complex datatypes like geometric-object, are described in a later subsection. The basic datatypes, like integer, boolean, cnumber, and vector3, are defined by libctl.)

geometry [list of geometric-object class]
Specifies the geometric objects making up the structure being simulated. When objects overlap, later objects in the list take precedence. Defaults to no objects (empty list).
sources [list of source class]
Specifies the current sources to be present in the simulation; defaults to none.
symmetries [list of symmetry class]
Specifies the spatial (mirror/rotation) symmetries to exploit in the simulation (defaults to none). The symmetries must be obeyed by both the structure and by the sources. See also: Exploiting symmetry in Meep.
pml-layers [list of pml class]
Specifies the absorbing PML boundary layers to use; defaults to none.
default-material [material-type class]
Holds the default material that is used for points not in any object of the geometry list. Defaults to air (ε of 1).
geometry-lattice [lattice class]
Specifies the the size of the unit cell (which is centered on the origin of the coordinate system). If any dimension of the lattice size is the special value no-size, then the dimension of the lattice is reduced (i.e. it becomes two- or one-dimensional) by default. Defaults to a cubic cell of unit size.
dimensions [integer]
Explicitly specifies the dimensionality of the simulation, if the value is less than 3. If the value is 3 (the default), then the dimensions are automatically reduced if possible when any of the geometry-lattice sizes are no-size. If dimensions is the special value of CYLINDRICAL, then cylindrical coordinates are used and the x and z dimensions are interpreted as r and z, respectively.
m [number]
For CYLINDRICAL simulations, specifies that the angular φ dependence of the fields is of the form eimφ (default is m=0). If the simulation cell includes the origin r = 0, then m must be an integer.
resolution [number or vector3]
Specifies the computational grid resolution, in pixels per distance unit. Defaults to 10.
ensure-periodicity [boolean]
k-point [false or vector3]
If false (the default), then the boundaries are perfect metallic (zero electric field). If a vector, then the boundaries are Bloch-periodic: the fields at one side are \exp(i\mathbf{k}\cdot\mathbf{R}) times the fields at the other side, separated by the lattice vector \mathbf{R}. The k-point vector is specified in Cartesian coordinates, in units of 2π/distance. (This is different from MPB, equivalent to taking MPB's k-points through the function reciprocal->cartesian.)
ensure-periodicity [boolean]
If true (the default), and if the boundary conditions are periodic (k-point is not false), then the geometric objects are automatically repeated periodically according to the lattice vectors (the size of the computational cell).
force-complex-fields? [boolean]
By default, Meep runs its simulations with purely real fields whenever possible. It uses complex fields (which require twice the memory and computation) if the k-point is non-zero or if m is non-zero. However, by setting force-complex-fields? to true, Meep will always use complex fields. See also: Complex fields in Meep.
filename-prefix [string]
A string prepended to all output filenames. Defaults to the name of the current ctl file, with ".ctl" replaced by "-" (e.g. foo.ctl uses a "foo-" prefix).
Courant [number]
Specify the Courant factor S which relates the time step size to the spatial discretization
cΔt = SΔx. Default is 0.5. For numerical stability, the Courant factor must be at most Failed to parse (unknown error): 1/\sqrt{\textrm{# dimensions}}

, and in practice should be slightly smaller.

output-volume [meep::geometric_volume*]
Specifies the default region of space that is output by the HDF5 output functions (below); see also the (volume ...) function to create meep::geometric_volume* objects. The default is '() (null), which means that the whole computational cell is output. Normally, you should use the (in-volume ...) function to modify the output volume instead of setting output-volume directly.
progress-interval [number]
Time interval (seconds) after which Meep prints a progress message; default is 4 seconds.

The require a bit more understanding of the inner workings of Meep to use (see also the SWIG wrappers).

structure [meep::structure*]
Pointer to the current structure being simulated; initialized by (init-structure) which is called automatically by (init-fields) which is called automatically by any of the (run) functions.
fields [meep::fields*]
Pointer to the current fields being simulated; initialized by (init-fields) which is called automatically by any of the (run) functions.
num-chunks [integer]
Minimum number of "chunks" (subarrays) to divide the structure/fields into (default 0); actual number is determined by number of processors, PML layers, etcetera. (Mainly useful for debugging.)

Predefined Variables

Variables predefined for your convenience and amusement.

air, vacuum [material-type class]
Two aliases for a predefined material type with a dielectric constant of 1.
metal [material-type class]
A predefined material type corresponding to a perfectly conducting metal (in which the electric field is zero).
nothing [material-type class]
A material that, effectively, punches a hole through other objects to the background (default-material or epsilon-input-file).
infinity [number]
A big number (1.0e20) to use for "infinite" dimensions of objects.
pi [number]
π (3.14159...).
Personal tools