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

Get source amplitude from hdf5 file #388

Merged
merged 9 commits into from
Jun 29, 2018
Merged

Get source amplitude from hdf5 file #388

merged 9 commits into from
Jun 29, 2018

Conversation

ChristopherHogan
Copy link
Contributor

Fixes #372

  • Move linear_interpolate to libmeep to avoid multiple definitions, and to use it in sources.cpp. The definition is currently in fields.cpp, but there might be a better place for it.
  • Link libmeep.so with libctlgeom.so so that src/sources.cpp:amp_file_func can access geometry_lattice and geometry_center.
  • Allow passing a filename and a dataset name to a mp.Source.
  • Added overload of add_volume_source that creates an amplitude function that reads from an hdf5 file. It expects both a .re and .im dataset.
  • Added basic test that runs a simulation with an amplitude function that always returns 1+1j, then runs the same simulation that gets the amplitude from an hdf5 file of all ones (2, 10x10 datasets for real and imaginary), and compares a field point. A more thorough test is needed (Ardavan mentioned a ray tracing example).

@stevengj @oskooi

* Create `add_volume_source` that takes array and size
* Error checking for real and imag dims sizes
* Print name of missing dataset on error
* Base linear interpolation on `where_` instead of geometry_lattice
* Don't need to link with libctlgeom
@ChristopherHogan
Copy link
Contributor Author

Updates:

  • Create add_volume_source that takes array and size
  • Error checking for real and imag dims sizes
  • Print name of missing dataset on error
  • Base linear interpolation on where_ instead of geometry_lattice
  • Don't need to link with libctlgeom

@stevengj stevengj merged commit 7798a6b into NanoComp:master Jun 29, 2018
@stevengj stevengj mentioned this pull request Jun 29, 2018
@ChristopherHogan ChristopherHogan deleted the chogan/amp_func_file branch July 3, 2018 13:00
bencbartlett pushed a commit to bencbartlett/meep that referenced this pull request Sep 9, 2021
* Basic amplitude file func working

* Add linear_interpolate to meep.hpp to avoid redundancy

* libmeep doesn't need libmeepgeom

* Add namespace to linear_interpolate

* Use LDADD for all C++ tests

* Link libmeep.so with libctlgeom.so

* Remove superfluous changes

* Free memory after amp func is done with hdf5 data.

* Updates after review

* Create `add_volume_source` that takes array and size
* Error checking for real and imag dims sizes
* Print name of missing dataset on error
* Base linear interpolation on `where_` instead of geometry_lattice
* Don't need to link with libctlgeom
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.

2 participants