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

Revised array metadata #811

Merged
merged 28 commits into from
Apr 17, 2019
Merged

Conversation

HomerReid
Copy link
Contributor

@HomerReid HomerReid commented Apr 10, 2019

Fixes #658, fixes #667, fixes #758. Also prepares for #759 by extending the array collapsing routine to handle double-valued arrays.

In the new approach, the weights array returned by get_array_metadata may alternatively be fetched by calling the usual get_array or get_dft_array routines with component set to NO_COMPONENT.

If the environment variable MEEP_ARRAY_XYZDIR is set to 'X', 'Y', or 'Z', then the array slice produced for NO_COMPONENT instead stores the corresponding component of the grid-point coordinate. This is not intended for regular use but may be useful for debugging complicated cases.

@stevengj
Copy link
Collaborator

Still failing:

FAIL: tests/cavity_arrayslice.py
FAIL: tests/dft_fields.py
FAIL: tests/simulation.py

@ChristopherHogan
Copy link
Contributor

FAIL: tests/simulation.py

python/tests/simulation.py:602 should be slice = sim.get_source(mp.Ez)

FAIL: tests/cavity_arrayslice.py

Passing True as the collapse (last) parameter to mp._get_array_slice_dimensions in python/simulation.py:1709 fixes this. Is collapse=True supposed to be the default now for get_array?

FAIL: tests/dft_fields.py

The results of output_dft and get_dft_array don't agree. The array shapes are the same, but the data is different.

@stevengj
Copy link
Collaborator

Is collapse=True supposed to be the default now for get_array?

Until #759 is fixed, I think it should be passing collapse=false, snap=true

@stevengj
Copy link
Collaborator

The results of output_dft and get_dft_array don't agree

Maybe one is now doing interpolation and the other isn't?

@ChristopherHogan
Copy link
Contributor

dft.cpp:1070 looks wrong. I think size_t array_size = dims[0] * (rank==1 ? dims[1] : 1); should be size_t array_size = dims[0] * (rank==2 ? dims[1] : 1);. This change makes the dft_fields.py test pass.

@stevengj
Copy link
Collaborator

It seems like it should handle rank == 3 as well; I pushed a fix.

@stevengj
Copy link
Collaborator

Is this okay to merge now?

@ChristopherHogan
Copy link
Contributor

ChristopherHogan commented Apr 14, 2019 via email

@stevengj stevengj merged commit da6fb3a into NanoComp:master Apr 17, 2019
bencbartlett pushed a commit to bencbartlett/meep that referenced this pull request Sep 9, 2021
* add --without-scheme option to configure to bypass building the scheme interface

* revised normalization of eigenmode sources to yield unit power flux (in the CW case); added discussion to FAQ section of documentation

* updates

* update FAQ entry regarding normalization of eigenmode sources

* updates

* purged extraneous adjoint-related content from master; also, renamed 'omega->freq' in python/source.py/fourier_transform

* purged extraneous adjoint-related content from master; also, renamed 'omega->freq' in python/source.py/fourier_transform

* updates

* updates

* fix reduced_stride[r-1] bug that was fixed in an intermediate commit of NanoComp#788 but missed here

* fix dft-fields test

* use infinity, not 1e10

* rm MEEP_ARRAY_XYZDIR debugging code

* deleted debugging code

* compute dirs and dims consistently in process_dft_component as in NanoComp#788

* make array-metadata compile again

* pass collapse=true in test

* fix merge snafu

* fix a couple of test failures

* add snap to _get_array_slice_dimensions

* fix array_size for dft slice

* Remove extra comma in meep.i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants