Skip to content

Fix Netgen permutation - #5034

Merged
pbrubeck merged 7 commits into
releasefrom
pbrubeck/fix/netgen-permutation
Jul 28, 2026
Merged

Fix Netgen permutation#5034
pbrubeck merged 7 commits into
releasefrom
pbrubeck/fix/netgen-permutation

Conversation

@pbrubeck

@pbrubeck pbrubeck commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

Description

Attempting to make find_permutation more robust by comparing reference coordinates and using numpy.argmin as opposed to taking an arbitary tolerance, which is now deprecated.

The correct fix is to use a PETSc Section: #5277

@pbrubeck
pbrubeck force-pushed the pbrubeck/fix/netgen-permutation branch 2 times, most recently from ae9b3f7 to b8376af Compare April 17, 2026 13:11
@UZerbinati

Copy link
Copy Markdown
Contributor

@KarsKnook might be what you are looking for, can you take a look ? :)

@connorjward connorjward left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Isn't this undone in #5277?

Not sure what this brings to the table. Shouldn't we just finish and merge #5277?

@pbrubeck

Copy link
Copy Markdown
Contributor Author

Isn't this undone in #5277?

Not sure what this brings to the table. Shouldn't we just finish and merge #5277?

#5277 targets #5215 but this problem with the tolerances is a real bug (some high-order netgen meshes end up with self-intersecting cells), so we should ideally be targeting release. Are you okay with a cython rework of high-order netgen meshes going into release?

@connorjward

Copy link
Copy Markdown
Contributor

Are you okay with a cython rework of high-order netgen meshes going into release?

Of course not.

If this fixes a real bug in release then I don't mind this going in to it, which can be distinct from the changes to main. We should have a test in that case.

@pbrubeck
pbrubeck force-pushed the pbrubeck/fix/netgen-permutation branch from b8376af to 9b1829d Compare July 28, 2026 09:21
@pbrubeck
pbrubeck changed the base branch from main to release July 28, 2026 09:21
@pbrubeck
pbrubeck requested a review from connorjward July 28, 2026 10:07
@pbrubeck

Copy link
Copy Markdown
Contributor Author

If this fixes a real bug in release then I don't mind this going in to it, which can be distinct from the changes to main. We should have a test in that case.

Done

Comment thread firedrake/netgen.py Outdated
Comment thread firedrake/netgen.py Outdated
Co-authored-by: Pablo Brubeck <brubeck@protonmail.com>
Comment thread firedrake/netgen.py Outdated
Comment thread firedrake/netgen.py Outdated
Comment thread firedrake/netgen.py Outdated
Comment thread firedrake/netgen.py
Co-authored-by: Pablo Brubeck <brubeck@protonmail.com>

@connorjward connorjward left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes this much better. I think that this is not just me being picky. This is radically clearer for anyone else coming to this code for this first time.

Comment thread firedrake/netgen.py

@connorjward connorjward left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I still don't understand the maths, but that's a me issue. This is probably fine.

@pbrubeck
pbrubeck enabled auto-merge (squash) July 28, 2026 14:34
@UZerbinati

UZerbinati commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

I'm very very happy with this, it's nice to see that you find a better way to construct the mapping.
I was trying to do something similar here: https://github.com/firedrakeproject/firedrake/tree/uz/fix_permuation

@pbrubeck

Copy link
Copy Markdown
Contributor Author

I'm very very happy with this, it's nice to see that you find a better way to construct the mapping.

This is just a patch. The correct approach is #5277

@pbrubeck
pbrubeck merged commit 15c5146 into release Jul 28, 2026
7 checks passed
@pbrubeck
pbrubeck deleted the pbrubeck/fix/netgen-permutation branch July 28, 2026 15:11
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.

3 participants