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

Array metadata replacement #655

Merged
merged 32 commits into from
Jan 8, 2019
Merged

Array metadata replacement #655

merged 32 commits into from
Jan 8, 2019

Conversation

ChristopherHogan
Copy link
Contributor

This replaces and closes #552. I made the following changes:

  • Rebased off latest master to fix several conflicts
  • Allow fields::get_array_slice_dimensions to take a direction[3] instead of int[3] by writing a wrapper for SWIG called _get_array_slice_dimensions.
  • Fixed failing h5test by passing is, ie, and wherec by reference to compute_boundary_weights.

The only thing I'm unsure of is why we subtract the X direction on line 391 in array_slice.cpp:

for(int r=0; r<rank; r++)
      dirs[r]=(meep::direction)(data->ds[r] - X);

Why is that necessary? Was it just for casting to an int when dirs was int[3]?

@stevengj @oskooi @HomerReid

@stevengj
Copy link
Collaborator

stevengj commented Jan 8, 2019

Yes, it seems like dirs[r]=data->ds[r] should be fine.

@HomerReid
Copy link
Contributor

Why is that necessary? Was it just for casting to an int when dirs was int[3]?

Yes, this was part of an attempt to avoid SWIG/python problems associated with arrays of directions that I wasn't able to solve, and now that you've solved them my workaround is obsolete. Thanks!

@stevengj stevengj merged commit 45a7785 into NanoComp:master Jan 8, 2019
@ChristopherHogan ChristopherHogan deleted the chogan/pr_552 branch January 9, 2019 21:15
bencbartlett pushed a commit to bencbartlett/meep that referenced this pull request Sep 9, 2021
* added C++ and python routines for fetching array metadata; also added be_quiet() routine for reduced console output

* updates

* updates

* updates

* updates

* updates

* updates

* revised 'python/meep.i:_get_dft_array()' to avoid crashing when dft_arrays have zero size

* updates

* updates

* updates

* updates

* get_array_metadata

* updates

* updates

* updates

* updates

* updates

* updates

* get_array_metadata

* updates

* updates

* updates

* updates

* updates

* Use direction array for get_array_slice_dimensions

* Clean up non-essential changes

* Add missing section from 652

* Allow direction array as argument to get_array_slice_dimensions

* Pass params by reference in compute_boundary_weights

* Remove unused typemaps

* Don't do direction subtraction
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.

3 participants