[Solvergraph][Ramses][PIC] Draft PR for PIC solvergraph node with empty kernel on grid#1530
Conversation
This reverts commit 05d45c2.
|
Thanks @aserhani for opening this PR! You can do multiple things directly here: Once the workflow completes a message will appear displaying informations related to the run. Also the PR gets automatically reviewed by gemini, you can: |
Summary of ChangesHello @aserhani, 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 establishes the foundational framework for incorporating a Particle-In-Cell (PIC) solver into the RAMSES model. It introduces the necessary data structures, configuration options, and a dedicated solvergraph node to manage PIC-related computations. While the actual kernel implementation is still in progress, this PR provides the essential scaffolding for future development and integration of PIC capabilities, enhancing the model's ability to simulate particle dynamics. 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.
Code Review
This pull request introduces the initial scaffolding for a Particle-In-Cell (PIC) solver node within the Ramses model's solvergraph. The changes include adding a new NodePIC with an empty kernel, associated configuration options, storage fields, and Python bindings. The implementation is a good starting point. My review includes suggestions to improve code quality and maintainability, such as adding const correctness, completing documentation, and removing temporary debugging code before finalization. All original comments have been retained as they do not contradict or align with the provided rules in a way that would require modification or dropping.
| if (true) { | ||
| // logger::raw_ln(" -- tex:\n" + | ||
| // shambase::get_check_ref(storage.solver_sequence).get_tex()); logger::raw_ln( | ||
| // " -- dot:\n" + shambase::get_check_ref(storage.solver_sequence).get_dot_graph()); | ||
|
|
||
| if (shamcomm::world_rank() == 0) { | ||
| std::ofstream graph_dot_file; | ||
| graph_dot_file.open("./solvergraph.dot"); | ||
| graph_dot_file << "digraph G {\n"; | ||
| graph_dot_file << shambase::get_check_ref(storage.solver_sequence).get_dot_graph(); | ||
| graph_dot_file << "}\n"; | ||
| graph_dot_file.close(); | ||
| } | ||
| } |
| // Particle-In-Cell config | ||
| ////////////////////////////////////////////////////////////////////////////////////////////// | ||
| PICConfig pic_config{}; | ||
| inline bool is_pic_enabled() { return pic_config.enabled; } |
There was a problem hiding this comment.
For better code practice and to indicate that this function does not modify the object's state, it's recommended to mark is_pic_enabled as a const method. This allows it to be called on const instances of SolverConfig.
| inline bool is_pic_enabled() { return pic_config.enabled; } | |
| inline bool is_pic_enabled() const { return pic_config.enabled; } |
| * @file ParticleInCell.hpp | ||
| * @author Anass Serhani (anass.serhani@cnrs.fr) | ||
| * @author Timothée David--Cléris (tim.shamrock@proton.me) --no git blame-- | ||
| * @brief |
| "flux_rhov_dust_face_zp", "flux_rhov_dust_face_zp", ndust); | ||
| } | ||
|
|
||
| // will be filled by NodePIC |
There was a problem hiding this comment.
| * @file ParticleInCell.cpp | ||
| * @author Anass Serhani (anass.serhani@cnrs.fr) | ||
| * @author Timothée David--Cléris (tim.shamrock@proton.me) --no git blame-- | ||
| * @brief |
| std::string tex = R"tex( | ||
| // TODO: Add TeX description here | ||
| )tex"; |
No description provided.