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

Method load_energy

python/simulation.py:3195–3206  ·  view source on GitHub ↗

Load the Fourier-transformed fields into the given energy 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 sav

(self, fname: str, energy: DftEnergy)

Source from the content-addressed store, hash-verified

3193 self._display_energy("total", get_total_energy, energys)
3194
3195 def load_energy(self, fname: str, energy: DftEnergy):
3196 """
3197 Load the Fourier-transformed fields into the given energy object (replacing any
3198 values currently there) from an HDF5 file of the given `filename` without the
3199 `.h5` suffix (the current filename-prefix is prepended automatically). You must
3200 load from a file that was saved by `save_energy` in a simulation of the same
3201 dimensions for both the cell and the energy regions with the same number of
3202 processors and chunk layout.
3203 """
3204 if self.fields is None:
3205 self.init_sim()
3206 energy.load_hdf5(self.fields, fname, "", self.get_filename_prefix())
3207
3208 def save_energy(self, fname: str, energy: DftEnergy):
3209 """

Callers 1

load_minus_energyMethod · 0.95

Calls 3

init_simMethod · 0.95
get_filename_prefixMethod · 0.95
load_hdf5Method · 0.45

Tested by

no test coverage detected