← Back to team overview

python-meep team mailing list archive

Re: Custom-src

 

2012/6/7 Eric Smoll <ericsmoll@xxxxxxxxx>:
> Hello Python Meep users,
>
> I am trying to generate a custom source from a large set of discrete data.
> Although it is a depreciated procedure, one can efficiently define a
> material function with inline C.  Is there a way to use inline C to load my
> data and define my custom source function in a way that will run efficiently
> in Meep or am I better off writing these type of scripts in the Meep C++
> interface.



Hello,

while this is most probably doable, you will not find any ready-to-go
examples. Necessity of incorporating of inline-C into python-layer was
judged by the extremely high amount of calculations of material
function with epsilon-averaging turned on. If you know for sure that
the source function will be computationally very expensive, than, of
course, you may either use numpy libraries within python, or use
C-inlining, or extend python-meep by your own classes or turn to pure
C++ interface. Without trying it is difficult to say which way is the
optimal one.

With best regards,
S.Nizamov


References