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 Fornberg coefficients calculations from WarpX to ablastr #5619

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

Conversation

lucafedeli88
Copy link
Member

The calculation of Fornberg stencil coefficients is rather general, and it can be shared with other projects of the BLAST family. Therefore, this PR moves the responsible functions into ablastr.

Specifically, the PR does the following:

  • 2 new files (FiniteDifference.H and FiniteDifference.cpp) are created under ablastr/math (CMakeLists.txt and Make.package accordingly)
  • the static method of the WarpX class getFornbergStencilCoefficients and the ReorderFornbergCoefficients function (originally defined in an anonymous namespace in WarpX.cpp) are moved to these new files, inside the namespace ablastr::math
  • the two methods are minimally adapted (e.g., AMREX_ALWAYS_ASSERT_WITH_MESSAGE becomes ABLASTR_ALWAYS_ASSERT_WITH_MESSAGE)
  • WarpX.cpp and SpectralKSpace.cpp (where the aforementioned functions were called) are updated

Note that with this PR SpectralKSpace.cpp does not need anymore to include the heavy WarpX.H header.

@lucafedeli88 lucafedeli88 added cleaning Clean code, improve readability component: ABLASTR components shared with other PIC codes labels Jan 30, 2025
@lucafedeli88 lucafedeli88 changed the title [WIP] Move Fornberg coefficients calculations from WarpX to ablastr Move Fornberg coefficients calculations from WarpX to ablastr Jan 30, 2025
@lucafedeli88 lucafedeli88 requested a review from EZoni January 30, 2025 15:46
@ax3l ax3l self-requested a review February 4, 2025 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleaning Clean code, improve readability component: ABLASTR components shared with other PIC codes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants