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_farfields routine to obtain far fields as NumPy array #680

Closed
oskooi opened this issue Jan 21, 2019 · 1 comment
Closed

get_farfields routine to obtain far fields as NumPy array #680

oskooi opened this issue Jan 21, 2019 · 1 comment
Assignees

Comments

@oskooi
Copy link
Collaborator

oskooi commented Jan 21, 2019

Currently, there are only two routines available for obtaining the far fields:

  1. get_farfield: returns the far field at a single point
  2. output_farfields: writes the far fields in a given Volume to an HDF5 file

It would be useful to have an additional third routine which returns the far fields in a given Volume as a NumPy array. This would facilitate post processing directly from within a single Python script without having to write and read from disk.

As an extension of this feature, rather than restrict the far field output to a rectilinear Volume, the region could be generalized to a GeometricObject (e.g., Sphere, Prism, Cylinder, etc.)

@stevengj
Copy link
Collaborator

Looks straightforward, because the dft_near2far::save_farfields function already collects all the necessary information in an array before writing it to disk. So we would want to:

  1. Refactor save_farfields into two routines — a get_farfields_array that collects the EH array and a save_farfields that calls get_farfields_array and then saves it to HDF5.

  2. Change get_farfields_array to use sum_to_all instead of sum_to_master so that all processes get the data.

  3. Make a high-level wrapper around get_farfields_array and call it from Python.

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

No branches or pull requests

3 participants