DDMC Bugfix? - #35
Merged
Merged
Conversation
Collaborator
|
Ah - sorry for this - should've anticipated the possible slight block mesh discrepancy - LGTM (assuming it gets past the error you hit). |
RyanWollaeger
approved these changes
Aug 7, 2026
RyanWollaeger
force-pushed
the
dempsey/ddmc_fix
branch
from
August 7, 2026 22:28
f41dd77 to
0cab278
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
From GPT
Background
Fix a device-side assertion in Jaybenne IMC/DDMC runs with static mesh
refinement:
Problem
A DDMC particle crossing a mesh-block boundary is marked for communication by
zeroing its velocity. On receipt, Jaybenne identifies the DDMC entry face from
the particle position and either samples its fine-block face location or
resamples it as an IMC particle.
The DDMC position offset is
eps_ddmc_offset(), but the transition checks useonly
parthenon::robust::EPS()as their matching tolerance. Source anddestination cell faces are calculated independently, so valid coarse-to-fine
transitions can miss this machine-epsilon-sized window due to roundoff. The
particle remains zero-velocity and subsequently reaches the
Invalid transition from DDMC to IMC.device assertion.The issue is exposed by static refinement, including the stratified
rotating-frame IMC/DDMC case on AMD GPUs. Rotating-frame physics can change
where DDMC/IMC interfaces occur but does not directly move photon positions.
Description of Changes
Add
eps_ddmc_match_tolerance()intransport_utils.hpp.It returns
0.1 * eps_ddmc_offset(), providing a tolerance that absorbsface-construction roundoff while remaining well below the separation between
the valid
0.5x,1x, and2xDDMC entry offsets.Use this tolerance for DDMC transition detection in:
ptcl_ddmc_to_imc()insrc/jaybenne/transport_utils.hppSampleDDMCBlockFace()insrc/jaybenne/sample_ddmc_bface.cppAdd the missing
breakafter successfully matching the lower-X2 face inptcl_ddmc_to_imc(). This matches the control flow of the other five facebranches and avoids a needless second iteration through the offset loop.
Checklist