foo
This commit is contained in:
parent
f5e3b2b4f3
commit
39436ea6d9
14
fdtd.py
14
fdtd.py
@ -1,15 +1,15 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# From the Meep tutorial: plotting permittivity and fields of a bent waveguide
|
# From the Meep tutorial: plotting permittivity and fields of a bent waveguide
|
||||||
from __future__ import division
|
from __future__ import division
|
||||||
|
|
||||||
import meep as mp
|
import meep as mp
|
||||||
import matplotlib.pyplot as plt
|
#import matplotlib.pyplot as plt
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from matplotlib import cm
|
#from matplotlib import cm
|
||||||
import pygame
|
import pygame
|
||||||
|
|
||||||
mp.quiet(True)
|
mp.quiet(True)
|
||||||
@ -67,11 +67,11 @@ def get_slice(sim):
|
|||||||
|
|
||||||
def plot_dielectric(sim):
|
def plot_dielectric(sim):
|
||||||
val = sim.get_array(center=mp.Vector3(), size=cell, component=mp.Dielectric, arr=buffer)
|
val = sim.get_array(center=mp.Vector3(), size=cell, component=mp.Dielectric, arr=buffer)
|
||||||
plt.figure()
|
#plt.figure()
|
||||||
plt.imshow(val, interpolation='none', cmap='RdBu')
|
#plt.imshow(val, interpolation='none', cmap='RdBu')
|
||||||
#plt.axis('off')
|
#plt.axis('off')
|
||||||
plt.show()
|
#plt.show()
|
||||||
print()
|
#print()
|
||||||
|
|
||||||
|
|
||||||
#sim.run(mp.at_beginning(plot_dielectric), mp.at_every(0.6, get_slice), until=200)
|
#sim.run(mp.at_beginning(plot_dielectric), mp.at_every(0.6, get_slice), until=200)
|
||||||
|
Loading…
Reference in New Issue
Block a user