2011/7/28 Yu Zhang <zham...@gmail.com>: > 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) > >
Hello! CallbackMatrix2D is a new feature that I personally did not tried much. Probably you have found a bug. What is an exact error message? Is it possible for your task to use simple callbacks? You can look for the reference to the test file "known_results.py". I remember that I have done quite a lot simulations with polarizability without problems. Best regards, Shavkat _______________________________________________ Mailing list: https://launchpad.net/~python-meep Post to : python-meep@lists.launchpad.net Unsubscribe : https://launchpad.net/~python-meep More help : https://help.launchpad.net/ListHelp