Repository navigation
Round root box size to a power of 2 - #78
Open
tristangdwl wants to merge 1 commit into
Open
tristangdwl wants to merge 1 commit into
tristangdwl wants to merge 1 commit into
Conversation
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.
The rounding incurred when normalizing the root box leads to rounding errors in the point positions, which leads to large rounding errors for targets close to sources because the kernel blows up.
This change sets
b0 = scale(1.0d0, exponent(boxsize(0)))to be a power of 2, so that the normalization is exact.I also added a near-coincident test to test_lfmm3d_scale.f and test_hfmm3d_scale.f: 2000 charges and dipoles on a sphere in a box of size about 2.6, with targets 1e-10 off the surface. The errors were: