On 03/24/2017 02:00 PM, Thomas AUZINGER wrote:
My questions are: 1.) Is this intended behavior? 2.) If not, would it make sense to alter the definition of at-time in a way that the step-functions of an (at-time T ...) are called during the iteration with a Meep time that is actually the closest time to T? In this case, I can submit a patch to the repository.
Note that there is already a built-in routine in the fields class, used by all the step functions in the libctl interface which involve the simulation time, which rounds the time to a float: round_time(). Unfortunately, as you have discovered, this can still suffer from occasional rounding errors.
Adding a small, negligible factor to reduce the sensitivity to rounding errors is a workaround. Please go ahead and submit a pull request on GitHub.
_______________________________________________ meep-discuss mailing list meep-discuss@ab-initio.mit.edu http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss