Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

structure dump/load functions #261

Merged
merged 8 commits into from Mar 29, 2018
Merged

structure dump/load functions #261

merged 8 commits into from Mar 29, 2018

Conversation

stevengj
Copy link
Collaborator

@stevengj stevengj commented Mar 29, 2018

This adds structure::dump(filename) and structure::load(filename) functions to dump the raw ε data to disk and load it back, for doing multiple simulations with the same materials but different sources etcetera.

Requires that the dump/load simulations have the same chunks (i.e. the same grid, number of processors, and PML).

Currently only stores ε and μ, and not nonlinear coefficients or polarizability.

Also makes the h5file API support 64-bit sizes.

(Missing tests, but I tried a quick test by hand and it seems to be functioning as intended.)

@stevengj
Copy link
Collaborator Author

stevengj commented Mar 29, 2018

In Python, maybe sim.dump_structure(filename) and sim.load_structure(filename). Maybe a load_structure=filename keyword in the simulation constructor.

The test would be to run a 2d simulation with some geometry (e.g. a cylinder or two of index 3 or so in index=1 background) and a source (I would use an Hz source) and compute the (also Hz) field at some point after some number of time steps, calling structure::dump("foo.h5") at the end. Then run the same simulation with load_structure("foo.h5") and an empty geometry list (but the same PML, sources, and other parameters). You should get exactly the same result.

@stevengj stevengj merged commit fcd4ba7 into master Mar 29, 2018
@stevengj stevengj deleted the structure_dump branch March 29, 2018 16:02
bencbartlett pushed a commit to bencbartlett/meep that referenced this pull request Sep 9, 2021
* make h5file API 64-bit clean, support writing size_t chunks

* read_chunk for size_t data

* structure::dump/load functions

* use size_t in get_array_slice_dimensions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant