File: cherenkov-radiation.py

package info (click to toggle)
meep-openmpi 1.25.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 64,556 kB
  • sloc: cpp: 32,214; python: 27,958; lisp: 1,225; makefile: 505; sh: 249; ansic: 131; javascript: 5
file content (40 lines) | stat: -rw-r--r-- 859 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
## moving point charge with superluminal phase velocity in dielectric media emitting Cherenkov radiation
import meep as mp

sx = 60
sy = 60
cell_size = mp.Vector3(sx, sy, 0)

dpml = 1.0
pml_layers = [mp.PML(thickness=dpml)]

v = 0.7  # velocity of point charge

symmetries = [mp.Mirror(direction=mp.Y)]

sim = mp.Simulation(
    resolution=10,
    cell_size=cell_size,
    default_material=mp.Medium(index=1.5),
    symmetries=symmetries,
    boundary_layers=pml_layers,
)


def move_source(sim):
    sim.change_sources(
        [
            mp.Source(
                mp.ContinuousSource(frequency=1e-10),
                component=mp.Ex,
                center=mp.Vector3(-0.5 * sx + dpml + v * sim.meep_time()),
            )
        ]
    )


sim.run(
    move_source,
    mp.at_every(2, mp.output_png(mp.Hz, "-vZc dkbluered -M 1")),
    until=sx / v,
)