Skip to content

Fix reflective BC moment calculations#354

Merged
germasch merged 56 commits intopsc-code:mainfrom
JamesMcClung:pr/fix-reflective-bc-moments
May 5, 2025
Merged

Fix reflective BC moment calculations#354
germasch merged 56 commits intopsc-code:mainfrom
JamesMcClung:pr/fix-reflective-bc-moments

Conversation

@JamesMcClung
Copy link
Collaborator

  • Move implementations of add_ghosts_reflecting_hi and add_ghosts_reflecting_lo from fields_item.hxx to add_ghosts_reflecting.hxx
  • Generalize said implementations over dimension d
  • Also implement node-centered versions
  • Test all these implementations in libpsc/tests/test_reflective_bcs.cxx, including an "integration" test performs gauss and continuity checks for particles bouncing off an upper and lower wall
    • This integration check would have failed before, because the checks were incorrectly using the "cc" ghosts-adder instead of the (then-nonexistant) "nc" version

it has to run on debug mode, because otherwise the asserts aren't compiled
This way is clearer, more reliable, and yields a cleaner error message than the assert in checks_impl.
The latter might be removed without realizing tests depend on it, and leads to the pitfall where tests erroneously pass when accidentally compiled in release mode.
revert this if it's horribly inefficient
@JamesMcClung
Copy link
Collaborator Author

It runs on my machine 🥲
@germasch is there an efficient way to get the full test logs, specifically /__w/psc/psc/build/Testing/Temporary/LastTest.log ? If it's accessible, I can't figure out how to do so. Alternatively, do you see some obvious reason why it would segfault?

@germasch germasch merged commit dd9d1e7 into psc-code:main May 5, 2025
6 checks passed
@JamesMcClung JamesMcClung deleted the pr/fix-reflective-bc-moments branch May 5, 2025 20:37
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