Add xparity constraints#74
Open
ChristopherHogan wants to merge 2 commits intoNanoComp:masterfrom
ChristopherHogan:chogan/72
Open
Add xparity constraints#74ChristopherHogan wants to merge 2 commits intoNanoComp:masterfrom ChristopherHogan:chogan/72
ChristopherHogan wants to merge 2 commits intoNanoComp:masterfrom
ChristopherHogan:chogan/72
Conversation
stevengj
reviewed
Sep 13, 2018
| for (i = 0; 2*i < nx; ++i) { | ||
| for (j = 0; j <= ny; ++j) { | ||
| int ij = i * ny + j; | ||
| int ij2 = i * ny + (j > 0 ? ny - j : 0); |
Collaborator
There was a problem hiding this comment.
ij2 here should flip i, not j.
stevengj
reviewed
Sep 13, 2018
| 0.5*(SCALAR_IM(u2) - xparity*SCALAR_IM(u))); | ||
| ASSIGN_SCALAR(X.data[(ijk2 * 2 + 1) * X.p + b], | ||
| 0.5*(SCALAR_RE(v2) + xparity*SCALAR_RE(v)), | ||
| 0.5*(SCALAR_IM(v2) + xparity*SCALAR_IM(v))); |
Collaborator
There was a problem hiding this comment.
This isn't right. It's tricky, because we are mirror flipping a vector field, but the vector field is stored in a funny "transverse" coordinate system in order to impose a key mathematical constraint.
The "transverse" coordinate system is specially chosen to have nice properties for mirror flipping in the y and z direction: https://github.com/stevengj/mpb/blob/62495d4f9b3402b31383f0cc255cb5a95d033f7e/src/maxwell/maxwell.c#L398-L399
but it may not be so nice for flipping in x.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #72. I'm not sure I got the indexing correct in the loops. Any ideas for a test?
@stevengj @oskooi