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

Method load_force

python/simulation.py:3429–3440  ·  view source on GitHub ↗

Load the Fourier-transformed fields into the given force object (replacing any values currently there) from an HDF5 file of the given `filename` without the `.h5` suffix (the current filename-prefix is prepended automatically). You must load from a file that was save

(self, fname, force)

Source from the content-addressed store, hash-verified

3427 )
3428
3429 def load_force(self, fname, force):
3430 """
3431 Load the Fourier-transformed fields into the given force object (replacing any
3432 values currently there) from an HDF5 file of the given `filename` without the
3433 `.h5` suffix (the current filename-prefix is prepended automatically). You must
3434 load from a file that was saved by `save_force` in a simulation of the same
3435 dimensions for both the cell and the force regions with the same number of
3436 processors and chunk layout.
3437 """
3438 if self.fields is None:
3439 self.init_sim()
3440 force.load_hdf5(self.fields, fname, "", self.get_filename_prefix())
3441
3442 def save_force(self, fname, force):
3443 """

Callers 1

load_minus_forceMethod · 0.95

Calls 3

init_simMethod · 0.95
get_filename_prefixMethod · 0.95
load_hdf5Method · 0.45

Tested by

no test coverage detected