Skip to content

Variational smoother quadrature changes - #4544

Merged
roystgnr merged 2 commits into
libMesh:develfrom
GiudGiud:variational-smoother-quadrature
Sep 11, 2026
Merged

roystgnr merged 2 commits into
libMesh:develfrom
GiudGiud:variational-smoother-quadrature

Conversation

@GiudGiud

@GiudGiud GiudGiud commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

This doesnt change the default yet
but it's evidence we can get something else from QNODAL that would be valuable

The VariationalSmootherSystem integrates the distortion-dilation metric
using the default Gauss rule, whose points lie in the element interior.
That rule cannot detect a degeneracy that is localized at an element
corner: a quad can collapse toward one of its nodes (an "hourglass",
looking like a triangle) while the interior quadrature points still
report positive Jacobians, so the metric is not penalized and the mesh
is not flagged as tangled.

Add a way to integrate the metric with a quadrature rule whose points
include the element vertices (e.g. QTRAP, QSIMPSON, QNODAL,
QGAUSS_LOBATTO), so that a folding corner drives the metric up and is
detected. This is exposed as:

  FEMContext::use_quadrature_rules(QuadratureType, extra_order)
    - a sibling of use_default_quadrature_rules / use_unweighted_...,
      building the requested rule type for each element/side/edge dim.

  VariationalSmootherSystem::set_quadrature_type(QuadratureType)
    - applied in init_context() after the base setup; the System's
      extra_quadrature_order still controls the point count. Defaults
      to QGAUSS, so existing behavior is unchanged.

  VariationalMeshSmoother::set_quadrature_type(QuadratureType)
    - plumbs the option through the high-level wrapper.
refs libMesh#4543
Co-Authored-By: Claude <noreply@anthropic.com>
* it should be. Must be called before smooth()/setup(). See
* VariationalSmootherSystem::set_quadrature_type() for details and caveats.
*/
void set_quadrature_type(QuadratureType qt) { _quadrature_type = qt; }

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think this all I need from MOOSE side

@moosebuild

moosebuild commented Sep 9, 2026 •

Copy link
Copy Markdown

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

Coverage

Inconsistent report tags were found between the head and base reports.
This can happen when reports are missing from either the head or the base.

Inconsistent tags:
32bit-np2_threads2
Full coverage report

This comment will be updated on new commits.

@GiudGiud

Copy link
Copy Markdown
Contributor Author

Test failure unrelated.
@roystgnr when you have time

@roystgnr roystgnr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is good enough as-is but I'm wondering if we can simplify the tests a bit

Comment thread tests/mesh/mesh_smoother_test.C Outdated
Add testVariationalQuadratureHourglass, which reads a mixed QUAD4/TRI3
patch built around a pinned hub node (meshes/quad4_tri3_hourglass.xda.gz)
and smooths it two ways:

 - With the default Gauss rule, a quad folds into an hourglass; the mesh
   is not flagged as tangled because the interior Gauss points stay
   positive.

 - With QNODAL (set via VariationalMeshSmoother::set_quadrature_type),
   the metric is sampled at the element vertices, so no element folds.

The fold is detected with Elem::has_invertible_map(), whose default
implementation evaluates the map Jacobian at the element nodes and
returns false if any nodal Jacobian is non-positive.

Co-Authored-By: Claude <noreply@anthropic.com>
@GiudGiud
GiudGiud force-pushed the variational-smoother-quadrature branch from e400c5f to fd8d302 Compare September 10, 2026 22:39
@roystgnr
roystgnr merged commit 5e1badd into libMesh:devel Sep 11, 2026
23 checks passed
@GiudGiud
GiudGiud deleted the variational-smoother-quadrature branch September 11, 2026 02:22
rochi00 added a commit to rochi00/libmesh that referenced this pull request Sep 29, 2026
This also picks up meshes/quad4_tri3_hourglass.xda.gz in
tests/Makefile.in, which tests/Makefile.am has listed since libMesh#4544 but
the committed Makefile.in did not.
rochi00 added a commit to rochi00/libmesh that referenced this pull request Sep 29, 2026
This also picks up meshes/quad4_tri3_hourglass.xda.gz in
tests/Makefile.in, which tests/Makefile.am has listed since libMesh#4544 but
the committed Makefile.in did not.
rochi00 added a commit to rochi00/libmesh that referenced this pull request Sep 29, 2026
This also picks up meshes/quad4_tri3_hourglass.xda.gz in
tests/Makefile.in, which tests/Makefile.am has listed since libMesh#4544 but
the committed Makefile.in did not.
rochi00 added a commit to rochi00/libmesh that referenced this pull request Sep 29, 2026
This also picks up meshes/quad4_tri3_hourglass.xda.gz in
tests/Makefile.in, which tests/Makefile.am has listed since libMesh#4544 but
the committed Makefile.in did not.
rochi00 added a commit to rochi00/libmesh that referenced this pull request Sep 29, 2026
This also picks up meshes/quad4_tri3_hourglass.xda.gz in
tests/Makefile.in, which tests/Makefile.am has listed since libMesh#4544 but
the committed Makefile.in did not.
roystgnr pushed a commit that referenced this pull request Oct 4, 2026
tests/Makefile.am gained meshes/quad4_tri3_hourglass.xda.gz in #4544
without tests/Makefile.in being regenerated, so the mesh was missing from
the generated test data list. This is the whole of ./bootstrap's diff
against devel.

Co-Authored-By: Claude <noreply@anthropic.com>
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