idaholab / moose

Multiphysics Object Oriented Simulation Environment
https://www.mooseframework.org
GNU Lesser General Public License v2.1
1.77k stars 1.05k forks source link

ElementQualityAux cowardly returning 1. #25121

Open jmeier opened 1 year ago

jmeier commented 1 year ago

Bug Description

I'm running MOOSE Version: git commit b38350ebf7 on 2023-08-04 In my simulation I requested Moose to write some quality measurement to an AuxVariable. Unfortunately, when executing the simulation I get:

[0] ../src/geom/elem.C, line 1589, compiled Jul 27 2023 at 13:38:17
ERROR:  unknown quality metric: [1] ../src/geom/elem.C, line 1589, compiled Jul 27 2023 at 13:38:17
ERROR:  unknown quality metric: SHAPE
Cowardly returning 1.
SHAPE
Cowardly returning 1.
[2] ../src/geom/elem.C, line 1589, compiled Jul 27 2023 at 13:38:17
ERROR:  unknown quality metric: SHAPE[3] ../src/geom/elem.C, line 1589, compiled Jul 27 2023 at 13:38:17
ERROR:  unknown quality metric:
Cowardly returning 1.
SHAPE
Cowardly returning 1.

I found an issue mentioning similar behavior without solving it: 12131

Steps to Reproduce

In a Moose model, add the following blocks and execute the model:

[AuxVariables]
   [quality]
     family = MONOMIAL
     order = CONSTANT
   []
 []

 [AuxKernels]
   [qa]
     type = ElementQualityAux
     variable = quality
     metric = SHAPE
   []
 []

Impact

The model itselfs runs with no additional problems. The AuxVariable is created, but set to no meaningful value.

GiudGiud commented 1 year ago

Hello

what element type are you using? This is the default output message for when the quality routine is not implemented on an element

Guillaume

jmeier commented 1 year ago

Dear Guillaume,

Thank you for your reply. I'm using TET10. May I suggest to tweak the error message to inform the user that the quality routine is not implemented for this element type?

Jörg

GiudGiud commented 1 year ago

@roystgnr how difficult would it be to get TET10 implemented?

lindsayad commented 1 year ago

The quality implementation or the error message that comes from missing implementations comes from libMesh so it might be worth "transferring" this issue to libMesh

lindsayad commented 1 year ago

We can keep this on the MOOSE side since it's exposed by one of MOOSE's objects. I've opened the corresponding libmesh issue https://github.com/libMesh/libmesh/issues/3612

lindsayad commented 1 year ago

how difficult would it be to get TET10 implemented?

Note that quality isn't implemented for any tets, not just tet10

GiudGiud commented 1 year ago

I think there might not be a single measure of quality for tets. There's at least metric tied to angles, maybe there are others?

roystgnr commented 1 year ago

We've defined DIAGONAL for Hex/Quad and TAPER for Hex (but not Quad?), but those wouldn't make sense for Tet.

We have STRETCH for Tri, so you'd think it would apply to Tet too, but I'm not sure what the definition is on the non-tensor-product case. It couldn't be the same as what we have commented for STRETCH for Quad and Hex (where the code doesn't match the comment but the code looks right...)

We have ASPECT_RATIO for Quad, which seems like it would make sense for any Elem type. Likewise SHAPE/SKEW? I don't think I've got the reference for the latter, but I think (although, as the discerning reader will by this point have guessed, this is my first time looking at some of this code...) the former would be easy to put in.

roystgnr commented 1 year ago

We don't seem to have any of this specialized for higher-order geometric Elem, though. I guess the theory is that if you've got good vertex positions then the mid nodes are easy, and if you don't then the mid nodes are irrelevant? Either that or the theory is that this is hard so we'll just do the basics.

GiudGiud commented 1 year ago

Seems fair for the second order case.

jmeier commented 1 year ago

As a sidenote: Two options for quality measures for TET/TRI elements:

Quality Spheres: The quality of TET elements may be defined as the (normalised) quotient of the inner sphere radius and the outer sphere radius. Normalisation results in a value of 1.0 for an equilateral tetrahedron. For TRI elements, the quality may be defined analogously from the normalised quotient of the inner circle radius and the outer circle radius (where an equilateral triangle is normalised to 1.0). This quality measure obviously ignores the intermediate nodes for TET10, TRI6, and higher.

Quality SICN: Other FE programmes use a "signed inverse condition number" ("quality SICN") as a quality feature taking into account the intermediate nodes. Here one may find more information about this: Johnen (2021): Quality Measures for Curvilinear Finite Elements

lindsayad commented 2 months ago

@jmeier can you give the reason for why you are closing the issue? This helps with our software quality assurance

jmeier commented 2 months ago

This was not intentional.