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

Adjoint near2far with vol_src #1329

Merged
merged 51 commits into from
Oct 1, 2020
Merged

Conversation

mochen4
Copy link
Collaborator

@mochen4 mochen4 commented Aug 26, 2020

No description provided.

python/source.py Outdated Show resolved Hide resolved
python/source.py Outdated Show resolved Hide resolved
@stevengj
Copy link
Collaborator

Note: issue #1365 will make this even more efficient.

src/meep.hpp Outdated Show resolved Hide resolved
src/sources.cpp Outdated Show resolved Hide resolved
@stevengj stevengj merged commit 1836839 into NanoComp:master Oct 1, 2020
python/meep.i Show resolved Hide resolved
@mochen4 mochen4 mentioned this pull request Mar 10, 2021
@@ -1346,11 +1357,12 @@ class fields_chunk {
structure_chunk *new_s;
structure_chunk *s;
const char *outdir;
int chunk_idx;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was it necessary to add a new member variable chunk_idx to the fields_chunk class? It doesn't seem to be actually used for anything. There is a member function n_proc() which already returns the chunk ID (equivalent to the MPI rank) and thus adding a chunk_idx variable seems redundant.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't a proc have multiple chunks?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes for the PML regions but still chunk_idx doesn't seem to be used for anything.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chunk_idx is first used in dft_near2far::near_sourcedata, as the fc_idx in the structure sourcedata. That information is later used in fields::add_srcdata to find the right field chunk to add source.

Copy link
Collaborator

@oskooi oskooi Mar 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, it is necessary to add a chunk_idx variable to the fields_chunk class because there is no way from within a dft_near2far object to identify each fields_chunk associated with each dft_chunk object.

bencbartlett pushed a commit to bencbartlett/meep that referenced this pull request Sep 9, 2021
* add yee grid to array slice

* add yee grid to array slice

* fix gradients

* rebase

* try better gradients

* cleanup from revert

* fix multifreq bug

* mpi memory fixes

* fix memory leaks

* setup branch

* correct scale

* offset issue

* offset issue

* several frequencies

* several frequencies

* several frequencies

* fourier

* update example

* near2far

* near2far

* fix factor

* typo

* yee grid

* rebase

* rebase

* rebase

* weight

* add example

* Fix Fourier

* change example

* typo

* rebase

* fix rebase

* fix rebase

* fix rebase

* srcdata

* vol_src

* src_vol

* src_vol

* src_vol

* src_vol

* add example

* add example

* clean up

* clean up

* delete extra blank lines

* resolve issues

* fix issues

* fix issues

Co-authored-by: Alec Hammond <[email protected]>
Co-authored-by: smartalecH <[email protected]>
Co-authored-by: MoChen <[email protected]>
Co-authored-by: Mo Chen <[email protected]>
Co-authored-by: Mo Chen <[email protected]>
Co-authored-by: Mo Chen <[email protected]>
Co-authored-by: Mo Chen <[email protected]>
Co-authored-by: Mo Chen <[email protected]>
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.

4 participants