-
Notifications
You must be signed in to change notification settings - Fork 32
max battle #1146
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
max battle #1146
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -401,12 +401,16 @@ | |||||||||||||||||||||
| grid.nbrGhosts(kwargs["interp_order"], x) for x in ["primal", "dual"] | ||||||||||||||||||||||
| ) | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| interp = kwargs["interp_order"] | ||||||||||||||||||||||
| max_ghosts = get_max_ghosts() | ||||||||||||||||||||||
| small_invalid_patch_size = phare_utilities.np_array_ify(max_ghosts, ndim) | ||||||||||||||||||||||
| largest_patch_size = kwargs.get("largest_patch_size", None) | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # to prevent primal ghost overlaps of non adjacent patches, we need smallest_patch_size+=1 | ||||||||||||||||||||||
| smallest_patch_size = phare_utilities.np_array_ify(max_ghosts, ndim) + 1 | ||||||||||||||||||||||
| # to prevent primal ghost box overlaps of non adjacent patches, we need smallest_patch_size * 2 + 1 | ||||||||||||||||||||||
| smallest_patch_size = phare_utilities.np_array_ify(max_ghosts, ndim) * 2 + 1 | ||||||||||||||||||||||
| # TORM next lines after https://github.com/llnl/SAMRAI/issues/311 | ||||||||||||||||||||||
| min_per_interp = [6, 9, 9] # SAMRAI BORDER BUG | ||||||||||||||||||||||
| smallest_patch_size = phare_utilities.np_array_ify(min_per_interp[interp - 1], ndim) | ||||||||||||||||||||||
|
Comment on lines
+409
to
+413
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Dead assignment on Line 410 — value is immediately overwritten on Line 413. The Suggested cleanup- # to prevent primal ghost box overlaps of non adjacent patches, we need smallest_patch_size * 2 + 1
- smallest_patch_size = phare_utilities.np_array_ify(max_ghosts, ndim) * 2 + 1
+ # to prevent primal ghost box overlaps of non adjacent patches, we'd need smallest_patch_size * 2 + 1
+ # smallest_patch_size = phare_utilities.np_array_ify(max_ghosts, ndim) * 2 + 1
# TORM next lines after https://github.com/llnl/SAMRAI/issues/311
min_per_interp = [6, 9, 9] # SAMRAI BORDER BUG
smallest_patch_size = phare_utilities.np_array_ify(min_per_interp[interp - 1], ndim)📝 Committable suggestion
Suggested change
🧰 Tools🪛 GitHub Check: CodeQL[warning] 409-409: Variable defined multiple times 🤖 Prompt for AI Agents
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in future it will only require removing code, this is clear. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
✏️ Learnings added
🧠 Learnings used |
||||||||||||||||||||||
| if "smallest_patch_size" in kwargs and kwargs["smallest_patch_size"] is not None: | ||||||||||||||||||||||
| smallest_patch_size = phare_utilities.np_array_ify( | ||||||||||||||||||||||
| kwargs["smallest_patch_size"], ndim | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.