libmesh icon indicating copy to clipboard operation
libmesh copied to clipboard

Permit mesh smoothers to move boundary/interface nodes

Open dschwen opened this issue 2 years ago • 12 comments

LibMesh mesh smoothers do not touch boundary nodes or nodes at the interface between subdomains. We could allow those nodes to move parallel to the boundary if - for example - the local curvature of the boundary is below a given threshold value.

dschwen avatar Aug 30 '22 17:08 dschwen

This mesh would benefit greatly from such a change, as node movement along the perfectly straight boundaries would significantly improve element quality.

original2 smoothed2

dschwen avatar Aug 30 '22 17:08 dschwen

better

Better but not quite there

dschwen avatar Sep 14 '22 23:09 dschwen

Here we go!

best

dschwen avatar Sep 15 '22 22:09 dschwen

What was going on near the middle corners on that first pic?

roystgnr avatar Sep 15 '22 22:09 roystgnr

What was going on near the middle corners on that first pic?

If only I knew. I reorganized the code to catch some edge cases, and retesting suddenly gave the correct result.

dschwen avatar Sep 15 '22 22:09 dschwen

Ha! I shouldn't laugh too hard, though. If we understood all our code as well as we should then I'd be recommending you add new features to the fancy variational smoother rather than the simple Laplace smoother... and I'd have done a much better job on our last set of Exodus upgrades, for that matter.

roystgnr avatar Sep 15 '22 22:09 roystgnr

There is a variational smoother? I could generalize this a bit by making the lambdas base class members...

dschwen avatar Sep 15 '22 22:09 dschwen

mesh_smoother_vsmoother.h

mesh_smoother_vsmoother.C

Nice fancy mathematics in the underlying thesis+papers, immunity to the failure cases you can see with Laplace, but the code is kind of orphaned; the original author didn't want to open source it at all (out of fear of getting hammered with maintenance requests), and it's never been properly adopted or even thoroughly refactored since, just translated (from Fortran?) to C++ code by Derek and later to C++ idioms by John.

roystgnr avatar Sep 15 '22 23:09 roystgnr

Oh, that even has a mechanism to tag movable boundary nodes. I have this for 2D and 3D, the vsmoother only has it for 2D (and not for subdomain boundaries).

dschwen avatar Sep 15 '22 23:09 dschwen

Hm, we're not making the VariationalMeshSmoother available in MOOSE, and after giving it a quick try I might have an idea why:

uhm_what

Fancy maths for the win?

dschwen avatar Sep 15 '22 23:09 dschwen

Regressed code, probably. We've never had exodiff tests in libMesh and in hindsight we really should have...

roystgnr avatar Sep 15 '22 23:09 roystgnr

It should be pretty straight forward with AD to code up arbitrary element quality metrics, and implement nodal repositioning based on the derivative of the quality metric w.r.t. the nodal positions. E.g. the element Jacobian could be such a metric. That'd be a class of smoothers with well defined underlying maths, too.

dschwen avatar Sep 15 '22 23:09 dschwen