libmesh icon indicating copy to clipboard operation
libmesh copied to clipboard

Variational smoother now uses libMesh solver and constraint system

Open pbehne opened this issue 8 months ago • 2 comments

Previously, the VariationalMeshSmoother set up and solved the optimization problem using logic branches for each element type and a separate solver than what libMesh provides.

This PR introduces two new objects to incorporate the variational smoother's solve process into the rest of libMesh: the FEMSystem-derived VariationalSmootherSystem and the Constraint-derived VariationalSmootherConstraint.

The VariationalSmootherSystem computes the residual and analytic Jacobian for the optimization solve. The analytic Jacobian was verified to be correct when compared to finite difference estimations.

The VariationalSmootherConstraint currently constrains boundary nodes and, if requested, subdomain boundary nodes to not move during the smoothing process. Less strict sliding boundary node constraints will be introduced in a future PR.

These changes allowed for a massive cleanup of the VariationalMeshSmootherClass.

Ref. #4082

pbehne avatar Jun 12 '25 20:06 pbehne

Ooh - we never talked about the parallel case. That's going to be slightly harder to fix than bad whitespace or a shadowing error.

For now, what we want to do is copy the variational smoother solution vector (which is PARALLEL, with a GHOSTED current_local_solution copy) into a SERIAL vector before using the results from there. That's also the long-term solution for serial (including ReplicatedMesh) meshes, but at some point we might also want to write a code path that sets up the proper ghosting (algebraic ghosting will need to match geometric ghosting, even if the latter has been expanded) on distributed meshes.

roystgnr avatar Jun 13 '25 18:06 roystgnr

Job Coverage, step Generate coverage on 3df510b wanted to post the following:

Coverage

6a0857 #4191 3df510
Total Total +/- New
Rate 63.70% 64.27% +0.57% 94.25%
Hits 75765 75056 -709 246
Misses 43178 41725 -1453 15

Diff coverage report

Full coverage report

This comment will be updated on new commits.

moosebuild avatar Jun 19 '25 00:06 moosebuild