python-meep team mailing list archive
-
python-meep team
-
Mailing list archive
-
Message #00038
[python-eep] Conductivity in python meep
Dear all,
I'm trying to simulate a 2D waveguide with a metallic obstacle
in the center, and have trouble setting up the conductivity. Here
is my partial code. It is the last line yielding problem. I appreciate
if anyone can help with it.
class material_sigma(CallbackMatrix2D):
def __init__(self, vol, m_sigma, resolution_factor = 1):
CallbackMatrix2D.__init__(self)
master_printf("Creating the material matrix....\n")
matrix_resolution = resolution_factor
self.sig = m_sigma
master_printf("Setting the material matrix...\n")
self.set_matrix_2D(self.sig, vol, resolution_factor)
master_printf("MeepMaterial object initialized.\n")
fdtd_domain = voltwo(domain_size_x, domain_size_y, 1)
m_sigma = zeros((domain_size_x, domain_size_y))
m_sigma[200:200+L,20:20+W] = 9.0e30
material_s = material_sigma(fdtd_domain, m_sigma, 1)
set_SIGMA_Callback(material_s.__disown__())
rec_wg = structure(fdtd_domain, EPS, pml(20,X))
ec_wg.add_polarizability(SIGMA)
best,
Yu
Follow ups