This commit is contained in:
m 2020-02-22 00:25:36 +01:00
parent f5e3b2b4f3
commit 39436ea6d9

16
fdtd.py
View File

@ -1,15 +1,15 @@
#!/usr/bin/env python3
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# From the Meep tutorial: plotting permittivity and fields of a bent waveguide
from __future__ import division
import meep as mp
import matplotlib.pyplot as plt
#import matplotlib.pyplot as plt
import os
import sys
import numpy as np
from matplotlib import cm
#from matplotlib import cm
import pygame
mp.quiet(True)
@ -67,12 +67,12 @@ def get_slice(sim):
def plot_dielectric(sim):
val = sim.get_array(center=mp.Vector3(), size=cell, component=mp.Dielectric, arr=buffer)
plt.figure()
plt.imshow(val, interpolation='none', cmap='RdBu')
#plt.figure()
#plt.imshow(val, interpolation='none', cmap='RdBu')
#plt.axis('off')
plt.show()
print()
#plt.show()
#print()
#sim.run(mp.at_beginning(plot_dielectric), mp.at_every(0.6, get_slice), until=200)
sim.run(mp.at_every(0.00001, get_slice), until=1000)
sim.run(mp.at_every(0.00001, get_slice), until=1000)