-
Notifications
You must be signed in to change notification settings - Fork 644
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add 1 FAQ and update docs * updates * add FAQ on chirped pulse (including 1 figure) and --with-openmp to build instructions * Scheme version of linear-chirped pulse example * tweaks * Update FAQ.md
- Loading branch information
Showing
12 changed files
with
120 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
## linear-chirped pulse planewave with higher frequencies at the front (down-chirp) | ||
|
||
import meep as mp | ||
import numpy as np | ||
|
||
resolution = 40 | ||
|
||
dpml = 2 | ||
pml_layers = [mp.PML(thickness=dpml,direction=mp.X)] | ||
|
||
sx = 40 | ||
sy = 6 | ||
cell_size = mp.Vector3(sx+2*dpml,sy) | ||
|
||
v0 = 1.0 # pulse center frequency | ||
a = 0.2 # Gaussian envelope half-width | ||
b = -0.5 # linear chirp rate (positive: up-chirp, negative: down-chirp) | ||
t0 = 15 # peak time | ||
|
||
chirp = lambda t: np.exp(1j*2*np.pi*v0*(t-t0)) * np.exp(-a*(t-t0)**2+1j*b*(t-t0)**2) | ||
|
||
sources = [mp.Source(src=mp.CustomSource(src_func=chirp), | ||
center=mp.Vector3(-0.5*sx), | ||
size=mp.Vector3(y=sy), | ||
component=mp.Ez)] | ||
|
||
sim = mp.Simulation(cell_size=cell_size, | ||
boundary_layers=pml_layers, | ||
resolution=resolution, | ||
k_point=mp.Vector3(), | ||
sources=sources, | ||
symmetries=[mp.Mirror(mp.Y)]) | ||
|
||
sim.run(mp.in_volume(mp.Volume(center=mp.Vector3(), size=mp.Vector3(sx,sy)), | ||
mp.at_every(2.7, mp.output_efield_z)), | ||
until=t0+50) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
;; linear-chirped pulse planewave with higher frequencies at the front (down-chirp) | ||
|
||
(set-param! resolution 40) | ||
|
||
(define-param dpml 2) | ||
(set! pml-layers (list (make pml (thickness dpml) (direction X)))) | ||
|
||
(define-param sx 40) | ||
(define-param sy 6) | ||
|
||
(set! geometry-lattice (make lattice (size (+ sx (* 2 dpml)) sy no-size))) | ||
|
||
(define-param v0 1.0) ; pulse center frequency | ||
(define-param a 0.2) ; Gaussian envelope half-width | ||
(define-param b -0.5) ; linear chirp rate (positive: up-chirp, negative: down-chirp) | ||
(define-param t0 15) ; peak time | ||
|
||
(define chirp (lambda (t) (* (exp (* 0+1i 2 pi v0 (- t t0))) (exp (+ (* (- a) (sqr (- t t0))) (* 0+1i b (sqr (- t t0)))))))) | ||
|
||
(set! sources (list (make source | ||
(src (make custom-src (src-func chirp))) | ||
(center (* -0.5 sx) 0 0) | ||
(size 0 sy 0) | ||
(component Ez)))) | ||
|
||
(set! k-point (vector3 0 0 0)) | ||
|
||
(run-until (+ t0 50) (in-volume (volume (center 0 0 0) (size sx sy 0)) (at-every 2.7 output-efield-z))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters