diff --git a/python/simulation.py b/python/simulation.py index 77edb9851..03db7ad28 100644 --- a/python/simulation.py +++ b/python/simulation.py @@ -1941,6 +1941,7 @@ def load_fields(self, fname, single_parallel_file=True): """ if self.fields is None: raise ValueError("Fields must be initialized before loading fields from file '%s'" % fname) + self._evaluate_dft_objects() self.fields.load(fname, single_parallel_file) print("Loaded fields from file: %s (%s)" % (fname, str(single_parallel_file))) @@ -1964,9 +1965,9 @@ def load_chunk_layout(self, br, source): ## source is either filename (string) self.structure.load_chunk_layout(source, br) - def _get_load_dump_dirname(self, dirname, single_parallel_file): + def get_load_dump_dirname(self, dirname, single_parallel_file): """ - Get the dirname to dump simulation state to. + Get the (possibly rank specific) dirname to dump simulation state to. """ if single_parallel_file: dump_dirname = dirname @@ -1980,7 +1981,7 @@ def dump(self, dirname, dump_structure=True, dump_fields=True, single_parallel_f """ Dumps simulation state. """ - dump_dirname = self._get_load_dump_dirname(dirname, single_parallel_file) + dump_dirname = self.get_load_dump_dirname(dirname, single_parallel_file) os.makedirs(dump_dirname, exist_ok=True) if dump_structure: @@ -1998,7 +1999,7 @@ def load(self, dirname, load_structure=True, load_fields=True, single_parallel_f This should called right after the Simulation object has been created but before 'init_sim' is called. """ - dump_dirname = self._get_load_dump_dirname(dirname, single_parallel_file) + dump_dirname = self.get_load_dump_dirname(dirname, single_parallel_file) self.load_single_parallel_file = single_parallel_file if load_structure: diff --git a/src/fields_dump.cpp b/src/fields_dump.cpp index 567a989e8..6fce54e2c 100644 --- a/src/fields_dump.cpp +++ b/src/fields_dump.cpp @@ -112,7 +112,6 @@ void fields::dump_fields_chunk_field(h5file *h5f, bool single_parallel_file, void fields::dump(const char *filename, bool single_parallel_file) { if (verbosity > 0) { printf("creating fields output file \"%s\" (%d)...\n", filename, single_parallel_file); - log(); } h5file file(filename, h5file::WRITE, single_parallel_file, !single_parallel_file); @@ -278,9 +277,6 @@ void fields::load(const char *filename, bool single_parallel_file) { load_dft_hdf5(chunks[i]->dft_chunks, dataname, &file, 0, single_parallel_file); } } - - if (verbosity > 0) - log(); } } // namespace meep