我已经使用 anaconda 环境安装了pymeep 。不幸的是,当我使用 Spyder 尝试使用 meep 中的 Vector3 类运行时,我得到了错误:
AttributeError:模块“meep”没有属性“Vector3”
有谁知道如何解决它?我已经尝试过使用推荐的环境:
conda create -n mp -c chogan -c defaults -c conda-forge pymeep
没用。
我使用的代码是这里的第一个教程/示例:
import meep as mp
cell = mp.Vector3(16, 8, 0)
geometry = [mp.Block(mp.Vector3(1e20, 1, 1e20),
center=mp.Vector3(0, 0),
material=mp.Medium(epsilon=12))]
sources = [mp.Source(mp.ContinuousSource(frequency=0.15),
component=mp.Ez,
center=mp.Vector3(-7,0))]
pml_layers = [mp.PML(1.0)]
resolution = 10
sim = mp.Simulation(cell_size=cell,
boundary_layers=pml_layers,
geometry=geometry,
sources=sources,
resolution=resolution)
sim.run(until=200)