-
Notifications
You must be signed in to change notification settings - Fork 264
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
Sinks in the kd tree #620
Draft
Yrisch
wants to merge
29
commits into
danieljprice:master
Choose a base branch
from
Yrisch:sinktree_matrix
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Sinks in the kd tree #620
Conversation
This file contains 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
…k are computed in force routine
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.
Type of PR:
modification to existing code
Description:$\mathcal{O}(N_\text{sink}N_\text{SPH})$ interaction starts to be the main bottleneck. The new method can bring back the complexity of this interaction to $\mathcal{O}(N_\mathrm{sink}\mathrm{log}(N_\mathrm{gas}) + N_\mathrm{gas}\mathrm{log}(N_\mathrm{sink}))$ at a cost of 2nd order multipole accuracy. To use with care !
Add an option to construct the kd tree using SPH and sink particles. It is then possible to compute sink-gas and sink-sink long-range interactions using the main force routine.
This can be useful when the number of sinks inside a simulation is high. In that case, the direct sink-gas direct
The implementation uses a runtime flag that will change the
maxp
value tomaxp = maxp + maxptmass
. This ensures to have enough space inxyzh_soa
andiphase_soa
to push sink positions, masses and the newisink
phase. The only modification in the tree construction is a loop on point masses inconstruct_root_node
. Despite that, the tree is built the same as before.Few conditions in multiple files are necessary to avoid using sinks in neighbour loops. The main force loop has been modified to identify sink particles. Sink-gas short-range interactions are softened the same way as the direct method. short sink-sink interactions are skipped to be computed within substep routine.
Finally, during one step, sink velocities need to be kicked with these new forces during the upper-level integration like SPH particles. To agree with the Individual timestep scheme, sinks are always considered active (smallest bin) for now.
Testing:
Same tests as in test_grav with the new method
Did you run the bots? no
Did you update relevant documentation in the docs directory? no