-
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
Move fields that are only sometimes needed to the cache? #676
Comments
Yes, that's a good idea. |
Yes, WeaklyCompressibleSPHSystem(..., techniques=(DensityDiffusionMolteniColagrossi(delta=0.1),
KernelGradientCorrection(),
TransportVelocityFormulation()) Most of our current kwargs are optional techniques to improve simulations. |
One downside is that it is not clear which system supports which fields. So this seems to me more a thing that should be done maybe in a 0.3 refactor? |
Well, it should come with a nice table in the docs listing all available techniques vs all available systems, and then showing ✅ or ❌ for each combination, similar to the README of PointNeighbors.. |
You can even make this type stable if you want, by adding type-based traits. Similar to what we have done with That's an optimization though and should only be used when type stability is (can be) an issue. |
Why wouldn't the |
I'm pretty sure that the |
Ah you were referring to the code in the first comment. I checked the LLVM when passing a tuple, and the check is indeed optimized away. |
Okay, how about this?
We reduce fields to the minimum, and everything that is only needed when some method is used goes to the cache. Then we define
We could do the same for example with
buffer
, which is only needed by open boundaries and set tonothing
in most simulations. I think this could make the system structs more readable.What do you think, @LasNikas?
Originally posted by @efaulhaber in #539 (comment)
The text was updated successfully, but these errors were encountered: