Hi, thanks to Shavkat and Martin, I made it work! The minimum code
snippet is as such:
class MyConductivity(meep.Callback):
def __init__(self):
meep.Callback.__init__(self)
def double_vec(self, r):
return 1e4
mc = MyConductivity()
meep.set_COND_Callback(mc.__disown__())
s.set_conductivity(meep.E_stuff, meep.COND)
Several problems needed to be fixed, e. g. I wanted to __disown__ a
class instance twice for EPS and COND; then I did not know which
component to choose.
I will proceed to implement a precise frequency-domain simulation for
dispersive media and put it on the web for others.
Filip
2013/1/18, Nizamov Shawkat <[email protected]>:
> Hi,
>
>> s.set_conductivity(meep.COND, 123.45) ## does not work!
>
>> NotImplementedError: Wrong number of arguments for overloaded
>> function 'structure_orig_set_conductivity'.
>> Possible C/C++ prototypes are:
>>
>> set_conductivity(meep::structure*,meep::component,meep::material_function
>> &)
>> set_conductivity(meep::structure *,meep::component,double
>> (*)(meep::vec const &))
>
> It means that you have to pass the component - "D_stuff" or similar,
> as far as I understand. First you have to figure out which component
> should be really passed to this function to work (consult other
> examples in C/Scheme). Second you have to pass that component and your
> callback class with function, which returns something (e.g. constant)
> given the coordinates. But what are you passing is the callback and
> constant. Unfortunately I do not have the example at a hand and do not
> already remember all the details.
>
> Hope it helps,
> Shavkat
>
_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss