Skip to content

Transmissibility: say which connection a failed lookup wanted - #7344

Draft
hnil wants to merge 4 commits into
OPM:masterfrom
hnil:pr/transmissibility-lookup-message
Draft

Transmissibility: say which connection a failed lookup wanted#7344
hnil wants to merge 4 commits into
OPM:masterfrom
hnil:pr/transmissibility-lookup-message

Conversation

@hnil

@hnil hnil commented Aug 21, 2026

Copy link
Copy Markdown
Member

transmissibility(), diffusivity() and dispersivity() look their result up with std::unordered_map::at, so a missing connection surfaces as unordered_map::at: key not found with nothing else — no cells, no indication of what went wrong. Chasing one of those down a full-field model is what prompted this.

The lookup now names both cells with their Cartesian index and IJK, says whether they are Cartesian neighbours or a non-neighbour pair, and checks whether the grid actually joins them — which separates "this calculation skipped a face the grid has" from "the caller asked about a pair the grid never joined, so its indices are not this grid's". The refinement level is appended only when the grid has levels, behind an if constexpr (requires ...), so nothing changes for grids without them.

Error paths only; no behaviour change on a run that works.

Draft: no test. The failure it reports is by construction one that should not happen, so I would welcome a view on whether it is worth constructing one.

🤖 Generated with Claude Code

hnil and others added 4 commits August 21, 2026 13:04
transmissibility(), diffusivity() and dispersivity() reached into their maps
with at(), so a connection the calculation never produced surfaced as
"unordered_map::at: key not found" and nothing else -- no cell, no direction,
no clue whether refinement was involved.

Report both cells: index, Cartesian index, and on a refined grid the level each
one is on. A pair spanning a refinement boundary, or two cells refining a single
coarse cell, is exactly where these lookups go wrong, and the level is what
makes that visible.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
… its level right

The level came from walking the grid view to the elemIdx'th element, which is
iteration order, not mapper-index order -- the two need not agree, least of all
on a refined leaf, so the level reported could belong to another cell. Look it
up through the mapper.

Also report each cell's IJK, and classify the pair: refined siblings, Cartesian
neighbours in I, J or K, several layers apart in one column, or no Cartesian
relation at all. Which of those it is says whether a face the grid should have
went missing or a non-neighbour connection did.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A missing connection has two very different causes: this calculation skipped a
face the grid has, or the caller asked about a pair the grid never joined and
the indices it used are not this grid's. Check and say which.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@hnil
hnil requested a review from bska August 21, 2026 12:31
@bska bska added the manual:irrelevant This PR is a minor fix and should not appear in the manual label Aug 21, 2026
@bska

bska commented Aug 21, 2026

Copy link
Copy Markdown
Member

jenkins build this please

@bska

bska commented Aug 26, 2026

Copy link
Copy Markdown
Member

The PR is marked as "draft" and can therefore not be merged. Is there more work coming here? If not, I suggest you mark the PR as "ready for review".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

manual:irrelevant This PR is a minor fix and should not appear in the manual

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants