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

Move ApplyBCKCorrection from WarpX header to anonymous namespace in WarpXFaceExtensions.cpp #5590

Open
wants to merge 3 commits into
base: development
Choose a base branch
from

Conversation

lucafedeli88
Copy link
Member

@lucafedeli88 lucafedeli88 commented Jan 22, 2025

ApplyBCKCorrection(int idim); is only used inside WarpXFaceExtensions.cpp, therefore, with the aim of simplifying the WarpX class, this PR moves it to an anonymous namespace inside WarpXFaceExtensions.cpp.

The following modifications are also introduced:

  • idim is now passed to ApplyBCKCorrection as a template parameter (in order to pass is as a template parameter to ComputeSStab, see below)
  • ApplyBCKCorrection called ComputeSStab which was a free function inside WarpXFaceExtensions.cpp, therefore the PR moves ComputeSStab to the anonymous namespace
  • ComputeSStab now takes idim as a template parameter for performance reasons (avoid ifs inside the kernel)
  • a wrapper of ComputeSStab taking idim as a non-template argument is also provided, in order to avoid extensive modifications in other parts of WarpXFaceExtensions.cpp
  • instead of directly throwing exceptions, we now use WARPX_ALWAYS_ASSERT_WITH_MESSAGE
  • a [[maybe_unused]] attribute is added for the non-template version of ComputeSStab to avoid unused function issues raised by AppleClang and clang-tidy

@lucafedeli88 lucafedeli88 added the cleaning Clean code, improve readability label Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleaning Clean code, improve readability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant