On Mon, 10 Apr 2006, X. Y. AO wrote:
How to get the integral of the normal component of the time-averaged Poynting vector over a plane? Meep runs with complex fields, drived by

As described in the manual, Meep uses real fields unless you set force-complex-fields? to true (see the Meep Reference).

multiple continuous-wave electric dipoles with random phase factors. The number given by (add-flux) is increased with TIME (run-until TIME). It

The add-flux thing is for getting flux spectra, which is not what you want it sounds like.

seems that (meep-fields-flux-in-box fields dir box) can work, but what does "fields" here means?

Yes, that will work, although you will want to set force-complex-fields? in order that it give you the time average flux rather than a snapshot.

fields is an abstract data type (corresponding to the C++ type meep::fields*) describing all of the fields in the current simulation. There is a global variable named "fields" (described in the Meep Reference) that is initialized when you start the simulation run), which you will want to use here.

(In principle, you can have multiple meep::fields objects to run multiple simulations at once, but that is not the normal mode of operaton.)

The next version of Meep will have (flux-in-box dir box) convenience functions that automatically use the global fields object.

Another question, how to get the steady-state field distribution (complex amplitude)? (output-hfield-z) etc. can only output fields in a certain time.

(To others on this list: "steady-state" response is the usual term for the exp(-iwt) response field from an exp(-iwt) source, after all transients have died away.)

To get the steady-state response from a CW source, currently the best way is to simply run for a long time after smoothly turning on a source (you will want to set the fwidth or width parameter of the continuous-src to make it turn on smoothly instead of suddenly).

If you want the complex amplitudes, you need to set force-complex-fields? to true as mentioned above. Of course, there is an arbitrary phase depending on what time instant you look at, but you can simply look an integer number of periods after your source starts if you want to look at a time when J has zero phase.

There is an hidden experimental feature to solve for the steady-state CW response directly by solving the associated linear equations via a biconjugate gradient algorithm. This is not really documented yet because its convergence is still problematic, but you can play with it by running:
        (meep-fields-solve-cw fields tol)
where "tol" is a relative tolerance (e.g. 1e-4) in the fields and "fields" is the global "fields" variable. You'll want to do this after running for at least a few periods to initialize the fields to something reasonable.

Steven

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

Reply via email to