-
Notifications
You must be signed in to change notification settings - Fork 18
[SPH] enable Machida 2006 EOS #1444
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
base: main
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @tdavidcl, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the simulation framework by adding comprehensive support for the Machida 2006 Equation of State. The changes involve defining the new EOS configuration, seamlessly integrating it into the existing EOS management system, and implementing its specific pressure and sound speed calculations within the SPH solver. Additionally, the new EOS is fully supported for JSON serialization/deserialization and is accessible via Python bindings, providing users with an expanded set of physical models for their simulations. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request adds support for the Machida 2006 equation of state, with changes spanning configuration, serialization, computation, and Python bindings. The implementation is largely well-structured and follows the existing patterns in the codebase. I have identified a couple of minor areas for improvement: an unprofessional error message that should be updated for clarity, and some unused variables in a lambda function that can be removed to enhance code quality and readability. Overall, this is a solid contribution.
| j.at("mh").get<Tscal>(), | ||
| j.at("kb").get<Tscal>()}; | ||
| } else { | ||
| shambase::throw_unimplemented("wtf !"); |
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.
The error message "wtf !" is unprofessional and not descriptive. It should be replaced with a message that clearly explains the error, for example, indicating that an unknown or unsupported eos_type was encountered during deserialization.
| shambase::throw_unimplemented("wtf !"); | |
| shambase::throw_unimplemented("Unknown or unsupported eos_type for deserialization."); |
| [rho_c1, rho_c2, rho_c3, cs0 = cs, mu, mh, kb]( | ||
| u32 i, | ||
| auto rho, | ||
| const Tscal *__restrict U, | ||
| const Tvec *__restrict xyz, | ||
| Tscal *__restrict P, | ||
| Tscal *__restrict cs) { |
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.
The lambda captures mu, mh, and kb, but these variables are not used within the lambda's body. This can be misleading and adds unnecessary overhead. Additionally, the parameters U and xyz are also unused. It's good practice to indicate this by removing their names. Please apply the suggested changes to improve code clarity.
[rho_c1, rho_c2, rho_c3, cs0 = cs](
u32 i,
auto rho,
const Tscal *__restrict /*U*/,
const Tvec *__restrict /*xyz*/,
Tscal *__restrict P,
Tscal *__restrict cs) {
Workflow reportworkflow report corresponding to commit 86f6972 Light CI is enabled. This will only run the basic tests and not the full tests. Pre-commit check reportPre-commit check: ✅ Test pipeline can run. Doxygen diff with
|
No description provided.