Skip to content
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

WarpX class : current_centering_* variables no longer static #5641

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

lucafedeli88
Copy link
Member

This PR turns the static variables of the WarpX class current_centering_nox, current_centering_noy, and current_centering_noz into private member variables: m_current_centering_nox, m_current_centering_noy, and m_current_centering_noz.

@lucafedeli88 lucafedeli88 added the cleaning Clean code, improve readability label Feb 5, 2025
@@ -3043,10 +3043,10 @@ def initialize_inputs(self):
pywarpx.warpx.field_centering_noz = self.field_centering_order[-1]
# warpx.current_centering_no<x,y,z>
if self.current_centering_order is not None:
pywarpx.warpx.current_centering_nox = self.current_centering_order[0]
pywarpx.warpx.m_current_centering_nox = self.current_centering_order[0]
Copy link
Member Author

@lucafedeli88 lucafedeli88 Feb 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not too familiar with picmi: is it OK to make this change here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. I'm not 100% sure.

I think these might need to match the names of the input parameters exposed to the users, i.e., the names set here without m_:
https://github.com/lucafedeli88/WarpX/blob/ce93182632c5cd43049e1111f3cd8976642e7aa2/Source/WarpX.cpp#L1073-L1078

            utils::parser::queryWithParser(
                pp_warpx, "current_centering_nox", m_current_centering_nox);
            utils::parser::queryWithParser(
                pp_warpx, "current_centering_noy", m_current_centering_noy);
            utils::parser::queryWithParser(
                pp_warpx, "current_centering_noz", m_current_centering_noz);

@dpgrote
Can you confirm? I might be wrong, I'm not 100% sure.

@lucafedeli88 lucafedeli88 changed the title [WIP] WarpX class : current_centering_* variables no longer static WarpX class : current_centering_* variables no longer static Feb 5, 2025
@ax3l ax3l requested a review from EZoni February 11, 2025 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleaning Clean code, improve readability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants