Skip to content

Hotfix702 remapping#705

Merged
tdcwilliams merged 9 commits intomasterfrom
hotfix702-remapping
Mar 19, 2026
Merged

Hotfix702 remapping#705
tdcwilliams merged 9 commits intomasterfrom
hotfix702-remapping

Conversation

@einola
Copy link
Copy Markdown
Member

@einola einola commented Mar 18, 2026

A backport of the fixes I did to the conservative remapping scheme in PR #684.

An important difference is that this code uses bamg's previous numbering feature to determine whether the element has changed. In PR #684, I had to use the element's drift speed, which is a far less accurate approach.

Some testing still required, but it seems to work ok.

einola added 8 commits March 18, 2026 06:58
Backporting of fixes in 64c7d97 and
bc3d8be. Here, we use the cross product
to determine if a point is inside or not. If there is uncertainty about
this, the caller must decide (i.e. if the point is too close to the
boundary to reliably tell). We assume an uncertain point is inside if
the caller is checking if a grid corner is inside a triangle, but
outside if the caller is checking if a triangle vertex is inside a grid
cell.
A backport of e494fbd, which says: A
comparison with zero is not very useful on a finite-precision machine!
Using 1e-6 seems to work well.
A backport of d391780, which says:
checkIfIntersecting now ignores intersections that are exactly on the
vertex. It never should have included those, and doing it like this is
very marginally better in terms of total error.
A backport of 90855a1, which says: I
was fiddling with it ans saw that I had already done something
similar in ConservativeRemappingFromMeshToMesh. It probably won't have
much of an effect. Putting it here, since these functions have been
massively rewritten anyway.
It's a good thing, and helped catching two very minor bugs.
This is just to make comparison with the work in PR #684 easier.
Propably not very useful, but helps with comparing with the work in PR
It doesn't make very much difference, but using continue is correct.
@einola einola requested a review from tdcwilliams March 18, 2026 06:25
Copy link
Copy Markdown
Contributor

@tdcwilliams tdcwilliams left a comment

Choose a reason for hiding this comment

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

Thanks @einola, it works for the mesh I was having trouble with (ps_25km.msh in the gnu environment).
I also checked a couple of restart files from before and after regridding and the interpolation looked fine.
There is a minor typo to fix

@tdcwilliams tdcwilliams merged commit 148df8a into master Mar 19, 2026
@tdcwilliams tdcwilliams deleted the hotfix702-remapping branch March 19, 2026 10:41
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