Skip to content

Conversation

@ChristopherHogan
Copy link
Contributor

Closes #72. I'm not sure I got the indexing correct in the loops. Any ideas for a test?
@stevengj @oskooi

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);
Copy link
Collaborator

Choose a reason for hiding this comment

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

ij2 here should flip i, not j.

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)));
Copy link
Collaborator

Choose a reason for hiding this comment

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

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.

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.

2 participants