Hi Meep users

I am trying to compute the integral of a user defined function in the
C++ interface of Meep. As far as I can see, I need to use the
"field::integrate" function, which has the following syntax (taken
from integrate.cpp source code file):

complex<double> fields::integrate(int num_fvals, const component *components,
                                  field_function integrand,
                                  void *integrand_data_,
                                  const volume &where,
                                  double *maxabs)

I am, however, in doubt about the "field_function" and also the
"*integrand_data_". The "field_function" apparently has the following
syntax (taken from the meep.hpp source code file):

typedef complex<double> (*field_function)(const complex<double> *fields,
                                           const vec &loc,
                                           void *integrand_data_);

Does the pointer "*fields" refer to all the components Ex, Ey, Ez, Hx,
... of the fields, so that if I wanted to compute Ex*Ex I would write
fields[0]*fields[0]?
Regarding the "*integrand_data_" I have not been able to figure out,
what it refers to?

If anyone has a code example using the "integrate" function or can
help me understand the syntax, I would very much appreciate it!

Best regards,

Mikkel Heuck

_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Reply via email to