Dear Meep users,
I'm using meep's C++ interface.
I'm trying to use a derived source time class to take an external data
file (which in my case is the previously computed time response of an
atom to radiation), and use it in order to specify the time dependency
of a dipole source.
To do this I want that my source class take a vector<double> as input
and return a complex<double> value.
Thus the steps are the following:
- I write a file "My_src_time.hpp" which contains the same lines as
gaussian_src_time or continuous_src_time, except for the attributes to
pass the constructor:
class My_src_time : public src_time {
public:
My_src_time(vector<double> v, double st = -infinity, double et = infinity)
: interp(interp), start_time(float(st)), end_time(float(et)) {}
virtual ~My_src_time(){}
...
};
- In "My_src_time.cpp" I override the method "dipole":
complex<double> My_src_time::dipole(double time) const
{
int step = int(time*resolution/Courant_number);
return ( v[step], 0.0);
}
- in main() I build an object of my class and I excite a field as a
point source:
My_src_time src(input_v);
f.add_point_source(Ex, src, point_src, 1.0);
Now, the input vector "input_v" I want to pass as source is basically
an oscillating function. However, the output I obtain is some kind of
linearly decreasing function of time if I specify an Ex source
component, or a function that after a while becomes constant if I
specify a Hz source.
Thus, I'm a bit confused about how meep implements its current() and
dipole() methods, I'm not able to figure it out reading the source
code..
Thanks in advance,
Mattia
_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss