From a15d836a3cf84a40135ce9994b6504a9db09d410 Mon Sep 17 00:00:00 2001 From: Ardavan Oskooi Date: Thu, 22 Aug 2019 19:09:34 -0700 Subject: [PATCH] documentation for interpolate function of Python interface (#997) --- doc/docs/Parallel_Meep.md | 2 ++ doc/docs/Python_Tutorials/Mode_Decomposition.md | 2 +- doc/docs/Python_User_Interface.md | 8 ++++++-- doc/docs/Scheme_Tutorials/Mode_Decomposition.md | 2 +- doc/docs/Scheme_User_Interface.md | 4 ++-- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/doc/docs/Parallel_Meep.md b/doc/docs/Parallel_Meep.md index 1189bef7e..57612bf94 100644 --- a/doc/docs/Parallel_Meep.md +++ b/doc/docs/Parallel_Meep.md @@ -4,6 +4,8 @@ Meep supports [distributed-memory](https://en.wikipedia.org/wiki/Distributed_memory) parallelism via [MPI](https://en.wikipedia.org/wiki/Message_Passing_Interface). This allows it to scale up from single multi-core machines to multi-node [clusters](https://en.wikipedia.org/wiki/Computer_cluster) and [supercomputers](https://en.wikipedia.org/wiki/Supercomputer), and to work on large problems that may not fit into the memory of one machine. Meep simulations can use hundreds of processors, if necessary. Of course, your problem must be sufficiently large in order to [benefit from many processors](FAQ.md#should-i-expect-linear-speedup-from-the-parallel-meep). +[TOC] + Installing Parallel Meep ------------------------ diff --git a/doc/docs/Python_Tutorials/Mode_Decomposition.md b/doc/docs/Python_Tutorials/Mode_Decomposition.md index 399087540..02b941fdf 100644 --- a/doc/docs/Python_Tutorials/Mode_Decomposition.md +++ b/doc/docs/Python_Tutorials/Mode_Decomposition.md @@ -612,7 +612,7 @@ if __name__ == '__main__': The phase of the zeroth-diffraction order is simply the angle of its complex mode coefficient. Note that it is generally only the relative phase (the phase difference) between different structures that is useful. The overall mode coefficient α is multiplied by a complex number given by the source amplitude, as well as an arbitrary (but deterministic) phase choice by the mode solver MPB (i.e., which maximizes the energy in the real part of the fields via [`ModeSolver.fix_field_phase`](https://mpb.readthedocs.io/en/latest/Python_User_Interface/#loading-and-manipulating-the-current-field)) — but as long as you keep the current source fixed as you vary the parameters of the structure, the relative phases are meaningful. -The script is run from the shell terminal using: `python binary_grating_phasemap.py -gp 0.35 -gh 0.6 -oddz`. The figure below shows the transmittance spectra (left) and phase map (right). The transmittance is nearly unity over most of the parameter space mainly because of the subwavlength dimensions of the grating. The phase variation spans the full range of -π to +π at each wavelength but varies weakly with the duty cycle due to the relatively low index of the glass grating. Higher-index materials such as [titanium dioxide](https://en.wikipedia.org/wiki/Titanium_dioxide#Thin_films) (TiO2) generally provide more control over the phase. +The script is run from the shell terminal using: `python binary_grating_phasemap.py -gp 0.35 -gh 0.6 -oddz`. The figure below shows the transmittance spectra (left) and phase map (right). The transmittance is nearly unity over most of the parameter space mainly because of the subwavelength dimensions of the grating. The phase variation spans the full range of -π to +π at each wavelength but varies weakly with the duty cycle due to the relatively low index of the glass grating. Higher-index materials such as [titanium dioxide](https://en.wikipedia.org/wiki/Titanium_dioxide#Thin_films) (TiO2) generally provide more control over the phase.
![](../images/grating_phasemap.png) diff --git a/doc/docs/Python_User_Interface.md b/doc/docs/Python_User_Interface.md index f1e88d0ee..ec62e3aa2 100644 --- a/doc/docs/Python_User_Interface.md +++ b/doc/docs/Python_User_Interface.md @@ -414,11 +414,11 @@ The gyrotropy vector. Its direction determines the orientation of the gyrotropi **`sigma` [`number`]** — -The coupling factor $\sigma_n / 2\pi$ between the polarization and the driving field. In magnetic ferrites, this is the Larmor precession frequency at the saturation field. +The coupling factor $\sigma_n / 2\pi$ between the polarization and the driving field. In [magnetic ferrites](https://en.wikipedia.org/wiki/Ferrite_(magnet)), this is the Larmor precession frequency at the saturation field. **`frequency` [`number`]** — -The Larmor precession frequency, $f_n = \omega_n / 2\pi$. +The [Larmor precession](https://en.wikipedia.org/wiki/Larmor_precession) frequency, $f_n = \omega_n / 2\pi$. **`gamma` [`number`]** — @@ -976,6 +976,10 @@ Miscellaneous Functions — Meep ordinarily prints various diagnostic and progress information to standard output. This output can be suppressed by calling this function with `True` (the default). The output can be enabled again by passing `False`. This sets a global variable, so the value will persist across runs within the same script. +**`meep.interpolate(n, nums)`** +— +Given a list of numbers or `Vector3`s `nums`, linearly interpolates between them to add `n` new evenly-spaced values between each pair of consecutive values in the original list. + ### Output File Names The output filenames used by Meep, e.g. for HDF5 files, are automatically prefixed by the input variable `filename_prefix`. If `filename_prefix` is `None` (the default), however, then Meep constructs a default prefix based on the current Python filename with `".py"` replaced by `"-"`: e.g. `test.py` implies a prefix of `"test-"`. You can get this prefix by running: diff --git a/doc/docs/Scheme_Tutorials/Mode_Decomposition.md b/doc/docs/Scheme_Tutorials/Mode_Decomposition.md index 358cbf1be..31715aed0 100644 --- a/doc/docs/Scheme_Tutorials/Mode_Decomposition.md +++ b/doc/docs/Scheme_Tutorials/Mode_Decomposition.md @@ -675,7 +675,7 @@ ylabel("grating duty cycle"); title("phase (radians)"); ``` -The figure below shows the transmittance spectra (left) and phase map (right). The transmittance is nearly unity over most of the parameter space mainly because of the subwavlength dimensions of the grating. The phase variation spans the full range of -π to +π at each wavelength but varies weakly with the duty cycle due to the relatively low index of the glass grating. Higher-index materials such as [titanium dioxide](https://en.wikipedia.org/wiki/Titanium_dioxide#Thin_films) (TiO2) generally provide more control over the phase. +The figure below shows the transmittance spectra (left) and phase map (right). The transmittance is nearly unity over most of the parameter space mainly because of the subwavelength dimensions of the grating. The phase variation spans the full range of -π to +π at each wavelength but varies weakly with the duty cycle due to the relatively low index of the glass grating. Higher-index materials such as [titanium dioxide](https://en.wikipedia.org/wiki/Titanium_dioxide#Thin_films) (TiO2) generally provide more control over the phase.
![](../images/grating_phasemap.png) diff --git a/doc/docs/Scheme_User_Interface.md b/doc/docs/Scheme_User_Interface.md index 2c70905f6..9eb387e7f 100644 --- a/doc/docs/Scheme_User_Interface.md +++ b/doc/docs/Scheme_User_Interface.md @@ -353,11 +353,11 @@ The gyrotropy vector. Its direction determines the orientation of the gyrotropi **`sigma` [`number`]** — -The coupling factor $\sigma_n / 2\pi$ between the polarization and the driving field. In magnetic ferrites, this is the Larmor precession frequency at the saturation field. +The coupling factor $\sigma_n / 2\pi$ between the polarization and the driving field. In [magnetic ferrites](https://en.wikipedia.org/wiki/Ferrite_(magnet)), this is the Larmor precession frequency at the saturation field. **`frequency` [`number`]** — -The Larmor precession frequency, $f_n = \omega_n / 2\pi$. +The [Larmor precession](https://en.wikipedia.org/wiki/Larmor_precession) frequency, $f_n = \omega_n / 2\pi$. **`gamma` [`number`]** —