-
Notifications
You must be signed in to change notification settings - Fork 12
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
WIP: Iterative IC generation #66
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should move to an object-oriented approach here, as it would fit well.
from typing import Union | ||
|
||
|
||
def W_cubic_spline(r: np.ndarray, H: Union[float, np.ndarray]): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't feel comfortable having so many different types of kernels like this.
We should centralise them (the ones used for visualisation, and the ones used for this) somewhere.
The one problem with that is inlining them within the compiled (future) versions of these functions. We'll have to think about that later, but let's leave the kernels here for now - we will deal with that last.
…erlying numpy array directly.
Minor formatting changes to IC
various fixes, but mainly random generator seed is local now
The |
I currently get a crash with the following input:
What am I doing wrong? Error:
|
A small error snuck in in the past few commits. This should fix it, I was able to run a few steps with it. |
Excellent, thanks - that fixes it. At the moment it's quite slow, but I have a 10X speedup in my version that's now bounded by the tree search speed. |
We build the tree from |
Yes. The tree doesn't track changes in |
Yes, but on line 1117 of |
True. But I didn't think that would be a problem, typically the dumps are only every 100ish iterations. If you think that'll be a bottleneck, it's a simple fix with
|
Right, but don't we only need to re-build the tree if there is a redistribute? |
Yes, but the dumping needs the smoothing lengths first. So if you dumped before, don't rebuild the tree unless we also redistributed in the same step. |
How frequent are |
As frequent as you set them. I don't recommend going below every 20 iterations. |
Ok, but then we are double-tree-building when we don't need to almost every step, right? |
I only ask this because 10% of the run-time is currently spent in |
What do you mean every step? Default values are redistribution every 20th step and dump every 50th step, is that almost every step for you? |
Oh :). I see how it works now. Odd that we spend so much time in that function, I will look at optimising it some more. |
Are we giving up on this? |
i want to come back to it, as it will be an excellent feature to have... but it needs to be significantly faster |
Heya
Here's a first working version of the IC making algorithm. I extended it to work in 1D, 2D, 3D, and with arbitrary boxsizes.
It's at a reviewable state, so please have a look at it when you get the time, and let me know what you think and what needs to be improved.
I haven't finished the documentation yet, but I left a script in a new directory
/tmp/
, where you can run it if you want to.Todo's left: