Skip to content

Commit

Permalink
Fix html md issues (#2181)
Browse files Browse the repository at this point in the history
* Add #center to all the images; Center equations

* Update extra.css
  • Loading branch information
jamesetouma authored Jul 30, 2022
1 parent 6ecaad9 commit 6d38e01
Show file tree
Hide file tree
Showing 43 changed files with 229 additions and 229 deletions.
2 changes: 1 addition & 1 deletion doc/docs/C++_Tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ while (f.time() < curr_time + 1/w_midgap) {
After we convert the HDF5 files to PNG format and superimpose the images on the dielectric background to produce an animated, we obtain the following:


![](images/Fabryperot.gif)
![](images/Fabryperot.gif#center)


Compiling
Expand Down
2 changes: 1 addition & 1 deletion doc/docs/Exploiting_Symmetry.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Meep supports exploiting several kinds of symmetries:
- 90° (fourfold) rotational symmetry about the origin, around the $x$/$y$/$z$ axes. This is also known as a $C_4$ symmetry.


![](images/C2_symmetry.png)
![](images/C2_symmetry.png#center)


The first two kinds of symmetry each reduce the computational cell (internally) by a factor of two, and the third by a factor of four. If your structure has multiple symmetries, you can combine them arbitrarily. For example, your cell may have two orthogonal mirror planes (e.g. one even and one odd), or it may have four-fold rotational symmetry about the $z$ axis and a mirror plane through $z=0$. Thus, in 3d you might be able to reduce your cell by at most a factor of eight, or a factor of four in 2d. This is why the interface lets you specify a **list** `symmetries` of `symmetry` objects.
Expand Down
14 changes: 7 additions & 7 deletions doc/docs/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ polarization is also zero. This is demonstrated in the figure below showing a
In the [interface](Python_User_Interface.md#source), the source currents are labeled $E_x$ or $H_y$ etc. according to what components of the electric/magnetic fields they correspond to.


![](images/residue_fields_bound_charges.png)
![](images/residue_fields_bound_charges.png#center)


### How do I compute the local density of states (LDOS) in a lossy material?
Expand Down Expand Up @@ -151,7 +151,7 @@ For an example of the second approach, see [Tutorial/Eigenmode Source/Planewaves
A focused beam with a Gaussian envelope can be created using the [`GaussianBeamSource`](Python_User_Interface.md#gaussianbeamsource) as demonstrated in this [script](https://github.com/NanoComp/meep/blob/master/python/examples/gaussian-beam.py). The following are four snapshots of the resulting field profile generated using a line source (red line) in 2d for different values of the beam waist radius/width $w_0$ (`beam_w0`), propagation direction $\vec{k}$ (`beam_kdir`), and focus (`beam_x0`):


![](images/gaussian_beam.png)
![](images/gaussian_beam.png#center)


Note: beams in a homogeneous material do *not* have a fixed width in Maxwell's equations; they always spread out during propagation (i.e., diffraction). The [numerical aperture (NA)](https://en.wikipedia.org/wiki/Gaussian_beam#Beam_divergence) of a Gaussian beam with waist radius $w$ and vacuum wavelength $\lambda$ within a medium of index $n$ is $n\sin(\lambda/(\pi nw))$.
Expand All @@ -165,7 +165,7 @@ A circularly polarized planewave in [cylindrical coordinates](Python_Tutorials/C
You can use an instantaneous [`ContinuousSource`](Python_User_Interface.md#continuoussource) with large wavelength (or nearly-zero frequency). This is analogous to a [direct current](https://en.wikipedia.org/wiki/Direct_current). You will also need to create a [run function](Python_User_Interface.md#run-functions) which contains [`change_sources`](Python_User_Interface.md#reloading-parameters) and specify the `center` property of the point source to be time dependent. As an example, the following image demonstrates [Cherenkov radiation](https://en.wikipedia.org/wiki/Cherenkov_radiation) involving a moving point charge with [superluminal phase velocity](https://en.wikipedia.org/wiki/Faster-than-light#Phase_velocities_above_c) (see [examples/cherenkov-radiation.py](https://github.com/NanoComp/meep/blob/master/python/examples/cherenkov-radiation.py)).


![](images/cherenkov_radiation.png)
![](images/cherenkov_radiation.png#center)


### Why doesn't the continuous-wave (CW) source produce an exact single-frequency response?
Expand All @@ -175,7 +175,7 @@ The [ContinuousSource](Python_User_Interface.md#continuoussource) does not produ
If the `width` is 0 (the default) then the source turns on sharply which creates high-frequency transient effects. Otherwise, the source turns on with a shape of (1 + tanh(t/`width` - `slowness`))/2. That is, the `width` parameter controls the width of the turn-on. The `slowness` parameter controls how far into the exponential tail of the tanh function the source turns on. The default `slowness` of 3.0 means that the source turns on at $(1 + \tanh(-3))/2 = 0.00247$ of its maximum amplitude. A larger value for `slowness` means that the source turns on even more gradually at the beginning (i.e., farther in the exponential tail). The effect of varying the two parameters `width` and `slowness` independently in the turn-on function is shown below.


![](images/cwsrc_turnon.png)
![](images/cwsrc_turnon.png#center)


Note: even if you have a continuous wave (CW) source at a frequency $\omega$, the time dependence of the electric field after transients have died away won't necessarily be $cos(\omega t)$, because in general there is a phase difference between the current and the resulting fields. In general for a CW source you will eventually get fields proportional to $cos(\omega t-\phi)$ for some phase $\phi$ which depends on the field component, the source position, and the surrounding geometry.
Expand All @@ -193,7 +193,7 @@ No. A narrow-bandwidth Gaussian is still a Gaussian: it goes to zero at both the
You can use a [`CustomSource`](Python_User_Interface.md#customsource) to define an arbitrary time-profile for the [`Source`](Python_User_Interface.md#source) object. As an example, the following snapshots of the out-of-plane electric field demonstrates a [linear-chirped pulse](https://www.rp-photonics.com/chirp.html) planewave propagating from the left to the right with higher frequencies (smaller wavelengths) at the front (i.e., a down chirp). For the simulation script, see [examples/chirped_pulse.py](https://github.com/NanoComp/meep/blob/master/python/examples/chirped_pulse.py).


![](images/chirped_pulse.png)
![](images/chirped_pulse.png#center)


Usage: Fields
Expand Down Expand Up @@ -252,7 +252,7 @@ For a linear system, you can use a [ContinuousSource](Python_User_Interface.md#c
The decay coefficient of the fields within any PML contains a $\cos(\theta)$ factor where $\theta$ is the incidence angle ($\theta=0^{\circ}$ is normal incidence). The decay therefore becomes *slower* as glancing incidence ($\theta=90^{\circ}$) is approached. This is true in the continuum limit and can be demonstrated by verifying that the reflections from the PML do *not* change with resolution. Otherwise, if the reflection decreases with increasing resolution then it may be due to transition reflections (i.e., the impedance mismatch at the PML interface) which can also be reduced by making the PML thicker instead of increasing the resolution. Transition reflections also increase as glancing incidence is approached, because at glancing incidence the phase-velocity mismatch between incident and reflected waves goes to zero as described in [Optics Express, Vol. 16, pp. 11376-92 (2008)](http://www.opticsinfobase.org/abstract.cfm?URI=oe-16-15-11376). Glancing-angle fields commonly arise in simulations where one direction is periodic and the other is terminated by a PML (such as in [diffraction gratings](Python_Tutorials/Mode_Decomposition.md#diffraction-spectrum-of-a-binary-grating)), in which case you can have spurious solutions that travel *parallel* to the PML interface; a workaround is to use a thicker non-PML [absorber](Python_User_Interface.md#absorber). This is demonstrated in the figure below by the glancing-angle fields remaining in the cell after a [source planewave](Python_Tutorials/Eigenmode_Source.md#planewaves-in-homogeneous-media) at 45° has long been turned off: the PML (left inset) is unable to absorb these fields unlike the absorber (right inset).


![](images/pml_glancing_field.png)
![](images/pml_glancing_field.png#center)


### How do I compute the modes of a non-orthogonal (i.e., triangular) lattice?
Expand Down Expand Up @@ -352,7 +352,7 @@ Still, there are times when, for whatever reason, you might not want this featur
Even if you disable the subpixel averaging, however, when you output the dielectric function to a file and visualize it, you may notice that there are some pixels with intermediate ε values, right at the boundary between two materials. This is due to a completely different reason. Internally, Meep's simulation is performed on a [Yee grid](Yee_Lattice.md), in which every field component is stored on a slightly different grid which are offset from one another by half-pixels, and the ε values are also stored on this Yee grid. For output purposes, however, it is more user-friendly to output all fields etcetera on the same grid at the center of each pixel, so all quantities are interpolated onto this grid for output. Therefore, even though the internal $\varepsilon$ values are indeed discontinuous when you disable subpixel averaging, the output file will still contain some "averaged" values at interfaces due to the interpolation from the Yee grid to the center-pixel grid. For the same reason, if `k_point` is set and the boundaries are Bloch-periodic, the permittivity function of the entire cell obtained via `get_epsilon` or `output_epsilon` will show that a little of the cell from one edge "leaks" over to the other edge: these extra pixels are added to implement the boundary conditions. This is independent of PML and the way the structure is defined (i.e., using geometric objects or a material function, etc.). An example is shown in the figure below comparing `output_epsilon` for two cases involving with and without `k_point`. The discretization artifacts are highlighted.


![](images/output_epsilon_kpoint.png)
![](images/output_epsilon_kpoint.png#center)


### Why does subpixel averaging take so long?
Expand Down
12 changes: 6 additions & 6 deletions doc/docs/Introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ Meep simulates [Maxwell's equations](https://en.wikipedia.org/wiki/Maxwell's_equ



$\frac{d\mathbf{B}}{dt} = -\nabla\times\mathbf{E} - \mathbf{J}_B - \sigma_B \mathbf{B}$
$$\frac{d\mathbf{B}}{dt} = -\nabla\times\mathbf{E} - \mathbf{J}_B - \sigma_B \mathbf{B}$$

$\mathbf{B} = \mu \mathbf{H}$
$$\mathbf{B} = \mu \mathbf{H}$$

$\frac{d\mathbf{D}}{dt} = \nabla\times\mathbf{H} - \mathbf{J} - \sigma_D \mathbf{D}$
$$\frac{d\mathbf{D}}{dt} = \nabla\times\mathbf{H} - \mathbf{J} - \sigma_D \mathbf{D}$$

$\mathbf{D} = \varepsilon \mathbf{E}$
$$\mathbf{D} = \varepsilon \mathbf{E}$$



where $\mathbf{D}$ is the displacement field, $\varepsilon$ is the dielectric constant, $\mathbf{J}$ is the current density (of electric charge), and $\mathbf{J}$<sub>*B*</sub> is the *magnetic-charge* current density. Magnetic currents are a convenient computational fiction in some situations. $\mathbf{B}$ is the magnetic flux density (often called the magnetic field), $\mu$ is the magnetic permeability, and $\mathbf{H}$ is the magnetic field. The $\sigma_B$ and $\sigma_D$ terms correspond to (frequency-independent) magnetic and electric conductivities, respectively. The divergence equations are implicitly:



$\nabla \cdot \mathbf{B} = - \int^t \nabla \cdot (\mathbf{J}_B(t') + \sigma_B \mathbf{B}) dt'$
$$\nabla \cdot \mathbf{B} = - \int^t \nabla \cdot (\mathbf{J}_B(t') + \sigma_B \mathbf{B}) dt'$$

$\nabla \cdot \mathbf{D} = - \int^t \nabla \cdot (\mathbf{J}(t') + \sigma_D \mathbf{D})dt' \equiv \rho$
$$\nabla \cdot \mathbf{D} = - \int^t \nabla \cdot (\mathbf{J}(t') + \sigma_D \mathbf{D})dt' \equiv \rho$$



Expand Down
6 changes: 3 additions & 3 deletions doc/docs/Materials.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,10 @@ Analytically, what this means is that the resonances that are present in the sys
Although Meep is using an oscillator model equation for the atomic polarization and level populations, instead of the Bloch equations, Meep retains the two terms usually approximated to zero when deriving the oscillator model equations from the Bloch equations, and so these equations are exactly equivalent to the Bloch equations. For more details, see [arXiv:2007.09329](https://arxiv.org/abs/2007.09329) and Section 6.4.1 of [Nonlinear Optics (third edition)](https://www.amazon.com/Nonlinear-Optics-Third-Robert-Boyd/dp/0123694701) by R. W. Boyd. To verify this equivalence between the different equations for modeling the polarization, as well as confirm that saturable media have been properly implemented in Meep, we compare the results of Meep with an independent FDTD solver using the Bloch equations and the frequency domain steady-state ab initio laser theory (SALT), in a 1d, one-sided, Fabry-Perot cavity containing a two-level gain medium that exhibits steady-state, multi-mode lasing. The cavity has a length of $a = 1$, a background index of $n = 1.5$, an atomic transition frequency of $\omega_n = 40/(2\pi)$, with width $\gamma_n = 8/(2\pi)$, the decay rate from level $2$ to $1$ is $\Gamma_{21} = 0.005$, the pumping rate from $1$ to $2$ is $\Gamma_{12} = 0.0051$, and the total atomic density, $N_0$, of the system was varied to produce different amounts of gain. These plots are given in terms of the equilibrium inversion, $D_0$, which is the inversion of the saturable gain medium in the absence of an electric field, i.e. the value of $\Delta N$ when $\mathbf{E} = 0$. There is agreement among the three methods close to the initial as well as past the third lasing threshold as shown in the following two figures.


![Near threshold comparison](images/meep_salt_comparison_thresh.png)
![Near threshold comparison](images/meep_salt_comparison_thresh.png#center)


![Near threshold comparison](images/meep_salt_comparison_full.png)
![Near threshold comparison](images/meep_salt_comparison_full.png#center)


For the two-level atomic gain model used in this example, $D_0$ can be calculated as:
Expand Down Expand Up @@ -313,7 +313,7 @@ plt.show()
```


![SiO2 from the materials library](images/SiO2_materials_library.png)
![SiO2 from the materials library](images/SiO2_materials_library.png#center)


**Note:** for narrowband calculations, some of the Lorentzian susceptibility terms may be unnecessary and will contribute to consuming more computational resources than are required (due to the additional storage and time stepping of the polarization fields). Computational efficiency can be improved (without significantly affecting accuracy) by removing from the material definitions those Lorentzian susceptibility terms which are far outside the spectral region of interest. In addition, when using the materials library the Courant parameter may need to be reduced to achieve meaningful results, see [Numerical Stability](Materials.md#numerical-stability).
Loading

0 comments on commit 6d38e01

Please sign in to comment.