MCPcopy Create free account
hub / github.com/NanoComp/meep / meep_time

Method meep_time

python/simulation.py:2618–2632  ·  view source on GitHub ↗

Return the current simulation time in simulation time units (e.g. during a run function). This is not the wall-clock time. Occasionally, e.g. for termination conditions of the form $time < T?$, it is desirable to round the time to single precision in order to avoid

(self)

Source from the content-addressed store, hash-verified

2616 return total_bytes
2617
2618 def meep_time(self):
2619 """
2620 Return the current simulation time in simulation time units (e.g. during a run
2621 function). This is not the wall-clock time.
2622
2623 Occasionally, e.g. for termination conditions of the form $time < T?$, it is
2624 desirable to round the time to single precision in order to avoid small
2625 differences in roundoff error from making your results different by one timestep
2626 from machine to machine (a difference much bigger than roundoff error); in this
2627 case you can call `Simulation.round_time()` instead, which returns the time
2628 rounded to single precision.
2629 """
2630 if self.fields is None:
2631 self.init_sim()
2632 return self.fields.time()
2633
2634 def timestep(self) -> int:
2635 """Return the number of elapsed timesteps."""

Callers 15

_run_untilMethod · 0.95
test_pml_cylMethod · 0.95
_collectMethod · 0.80
_collect2Method · 0.80
_stopFunction · 0.80
_dispFunction · 0.80
change_geomMethod · 0.80
test_timeMethod · 0.80
get_ref_field_pointMethod · 0.80
get_field_pointMethod · 0.80
record_ex_eyMethod · 0.80
print_stuffFunction · 0.80

Calls 2

init_simMethod · 0.95
timeMethod · 0.80

Tested by 6

test_pml_cylMethod · 0.76
change_geomMethod · 0.64
test_timeMethod · 0.64
get_ref_field_pointMethod · 0.64
get_field_pointMethod · 0.64
record_ex_eyMethod · 0.64