Repository navigation
Integrated Greens Function implementation for 2D, 2.5D, slice-by-slice, and 3D FFT-based Poisson solvers - #154
Draft
woodtp wants to merge 5 commits into
Conversation
Marked a few getters `const` where appropriate. Deleted copy/move constructors for FFT-based solvers to prevent accidental double-allocation of FFTW buffers. No longer allocate BunchExtremaCalculator and Calculator instances into dynamic memory.
This branch has not been deployed
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.
Adds optional integrated Green’s Function (IGF) kernels to the 2D and 3D FFT Poisson solvers, following the implementation as described in [1].
The existing point-sampled kernel treats the charge deposited at each grid point as a point source. This method instead integrates the free-space Green’s function over the finite source cell, which may improve accuracy when the grid cells' aspect ratios are large.
Qiang et al. propose four strategies for mitigating cancellation in terms such as$\log(x+r)$ . When $x<0$ and $\lvert x\rvert\approx r$ , direct evaluation of $x+r$ subtracts two nearly equal numbers and can become limited by numerical precision. The same issue applies independently to the $y+r$ and $z+r$ terms.
I chose the algebraic rewrite from Equation (11). From the included benchmark, the resulting maximum normalized field error remained below 0.1%, including the case where direct evaluation of the logarithm failed.
GreensFunction2DandGreensFunction3Dhelpers for finite-cell Green’s-function evaluation.setUseIntegratedGreenFunction(bool)andgetUseIntegratedGreenFunction()toPoissonSolver*andPoissonSolverFFT3D.double**double***kernel storage.PoissonSolverFFT2DPoissonSolverFFT3DSpaceChargeCalc3DSpaceChargeCalc2p5DSpaceChargeCalc2p5DrbSpaceChargeCalcSliceBySlice2D[1] Qiang, J., Mitchell, C., Lehe, R., & Formenti, A. (2024). Implementation of the Integrated Green’s Function Method for 3D Poisson’s Equation in a Large Aspect Ratio Computational Domain. Journal of Software Engineering and Applications, 17(9), 740–749. https://doi.org/10.4236/jsea.2024.179039