Skip to content

Make Diagnostic box selection more robust#1364

Merged
AlexanderSinn merged 2 commits into
Hi-PACE:developmentfrom
AlexanderSinn:Make_Diagnostic_box_selection_more_robust
Mar 17, 2026
Merged

Make Diagnostic box selection more robust#1364
AlexanderSinn merged 2 commits into
Hi-PACE:developmentfrom
AlexanderSinn:Make_Diagnostic_box_selection_more_robust

Conversation

@AlexanderSinn
Copy link
Copy Markdown
Member

This PR fixes an issue where

amr.n_cell = 1024 1024 512
geometry.prob_lo     = -400e-6   -400e-6   -50e-6
geometry.prob_hi     =  400e-6    400e-6    50e-6

plasma_diag.patch_lo = -400e-6   -400e-6    50e-6
plasma_diag.patch_hi =  400e-6    400e-6    50e-6

would crash with the unhelpful error message

0::Assertion `rtmp > std::numeric_limits<ParticleReal>::lowest() && iters < maxiters' failed, file "/home/asinn/hipace/build/_deps/fetchedamrex-src/Src/Base/AMReX_Geometry.cpp", line 590 !!!
SIGABRT

because the plasma_diag patch was technically outside the simulation domain.
With this PR the input works and if modified (50e-6 -> 51e-6) would give the error

0::Assertion `domain.ok()' failed, file "/home/asinn/hipace/src/diagnostics/Diagnostic.cpp", line 412, Msg: Box for diagnostic object 'plasma_diag' is empty. Make sure that it intersects with the simulation domain!
Simulation: ((0,0,0) (1023,1023,511) (0,0,0))
Diagnositc: ((-2,-2,516) (1024,1024,518) (0,0,0))
Intersection: ((0,0,516) (1023,1023,511) (0,0,0)) !!!
SIGABRT
  • Small enough (< few 100s of lines), otherwise it should probably be split into smaller PRs
  • Tested (describe the tests in the PR description)
  • Runs on GPU (basic: the code compiles and run well with the new module)
  • Contains an automated test (checksum and/or comparison with theory)
  • Documented: all elements (classes and their members, functions, namespaces, etc.) are documented
  • Constified (All that can be const is const)
  • Code is clean (no unwanted comments, )
  • Style and code conventions are respected at the bottom of https://github.com/Hi-PACE/hipace
  • Proper label and GitHub project, if applicable

@AlexanderSinn AlexanderSinn added bug Something isn't working component: diagnostics About any types of diagnostics labels Mar 17, 2026
Copy link
Copy Markdown
Member

@MaxThevenet MaxThevenet left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!

@AlexanderSinn AlexanderSinn merged commit a7feed1 into Hi-PACE:development Mar 17, 2026
11 checks passed
@AlexanderSinn AlexanderSinn deleted the Make_Diagnostic_box_selection_more_robust branch April 8, 2026 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working component: diagnostics About any types of diagnostics

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants