-
Notifications
You must be signed in to change notification settings - Fork 280
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
[ENH] RAMSES: set max_level from parameter file #5060
base: main
Are you sure you want to change the base?
Conversation
@max_level.setter | ||
def max_level(self, value): | ||
self._max_level = value | ||
return self.ds.max_level |
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.
2d3bee0
to
62441df
Compare
This allows to, e.g. create a sphere object without ever reading most of the AMR file
62441df
to
d3345d8
Compare
I'm not 100% on this. In my mind, the idea of the |
I'm not sure I understand what you mean. To clarify, before this PR, The motivation is that the former definition requires reading the entirety of the AMR structure of the simulation, while the latter only requires parsing one small text file. As far as I could tell, the only place where |
Oh, I think I understand -- and I can see the value in speeding it up! What I'm saying is that the usage of But maybe this is OK for RAMSES -- or maybe for the specific case of spheres, we don't do the check? |
I see. I guess the issue is that, although I can explore the idea of replacing occurrences of |
Is it possible to do an extremely quick pass to get the max level, without parsing the full file? I'm not able to convince myself. |
PR Summary
RAMSES contains a text file that describes some basic element of the AMR structure, including the maximum level of refinment. However, that level may not be reached. Up to this PR, we would read all AMR domain files to figure out to effective max level of refinment. This is however a costly operation for large simulations; this PR returns a more conservative number for the max level (the highest achievable by the sim) and is MUCH faster.
PR Checklist