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

Only allocate edge_lengths and face_areas when using the ECT solver #5593

Merged
merged 4 commits into from
Jan 22, 2025

Conversation

RemiLehe
Copy link
Member

Following #5558, the MultiFab edge_lengths and face_areas are not used anymore, expect for the ECT solver. Thus, only allocateing them when using the ECT solver saves a considerable amount of memory.

@@ -43,7 +43,7 @@

flag_correct_div = False

solver = picmi.ElectromagneticSolver(grid=grid, method="Yee", cfl=1.0)
solver = picmi.ElectromagneticSolver(grid=grid, method="ECT", cfl=1.0)
Copy link
Member Author

Choose a reason for hiding this comment

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

This test fails when using the "Yee" solver, because the MultiFab that are accessed with PICMI do not exist ; not sure how we want to handle this type of error in general.

Copy link
Member

Choose a reason for hiding this comment

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

One way to handle this would be to create a python accessible function that would create those multifabs if they don't exist and return them. But that would still require this test to change since in that case Python would have to take ownership of the multifabs themselves, not just wrappers for them. I think it is okay to not support that at this time. If it turns out there are users that rely on those multifabs we can fix it when they come forward. How does that sound?

Copy link
Member Author

Choose a reason for hiding this comment

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

OK, that works.

@RemiLehe RemiLehe merged commit 70dbbb1 into ECP-WarpX:development Jan 22, 2025
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants