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

Method display_forces

python/simulation.py:3415–3427  ·  view source on GitHub ↗

Given a number of force objects, this displays a comma-separated table of frequencies and force spectra, prefixed by "force1:" or similar (where the number is incremented after each run). All of the forces should be for the same `fcen`/`df`/`nfreq` or `freq`. The fir

(self, *forces)

Source from the content-addressed store, hash-verified

3413 )
3414
3415 def display_forces(self, *forces):
3416 """
3417 Given a number of force objects, this displays a comma-separated table of
3418 frequencies and force spectra, prefixed by "force1:" or similar (where the number
3419 is incremented after each run). All of the forces should be for the same
3420 `fcen`/`df`/`nfreq` or `freq`. The first column are the frequencies, and
3421 subsequent columns are the force spectra.
3422 """
3423 force_freqs = get_force_freqs(forces[0])
3424 if verbosity.meep > 0:
3425 display_csv(
3426 self, "force", zip(force_freqs, *[get_forces(f) for f in forces])
3427 )
3428
3429 def load_force(self, fname, force):
3430 """

Callers 1

test_forceMethod · 0.95

Calls 3

get_force_freqsFunction · 0.85
display_csvFunction · 0.85
get_forcesFunction · 0.85

Tested by 1

test_forceMethod · 0.76