Skip to content

Conversation

@roystgnr
Copy link
Member

In idaholab/moose#31758 I took the position that we should avoid making it harder to fix the issue where we report problematic element mappings as LogicError exceptions even though they're not logic errors; after a little thought, this isn't a hard issue and I could probably spend more time arguing about hypothetically fixing it than it would take to actually fix it.

In the near term, I think a good migration path here is for user code to catch (std::exception & e) but then check whether e.what() matches "Jacobian" to determine whether it's caught a mapping issue rather than a real internal error or assertion failure.

When an application can catch this, they should get to choose whether
they can handle it silently or need to bug the user with the details.
This saves us a few lines of preprocessor macros and should produce the
same binary output in both configurations

I ran across these while grepping for places where changing exception
types might get us into any trouble.
We should really also be classifying inverse_map failures as
std::runtime_error rather than std::logic_error, but it's possible for
Newton to fail (at least in theory; I haven't seen it in practice
myself) on a non-singular and non-inverted mapping.
So let's throw DegenerateMapping instead, and again we'll stuff data
into the exception where code can catch it in the best case and it'll
still get to stderr eventually in the worst case.
@moosebuild
Copy link

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

Coverage

03bcc7 #4286 66ff4b
Total Total +/- New
Rate 65.03% 65.04% +0.01% 33.33%
Hits 76915 76907 -8 9
Misses 41361 41346 -15 18

Diff coverage report

Full coverage report

Warnings

  • New new line coverage rate 33.33% is less than the suggested 90.0%

This comment will be updated on new commits.

@roystgnr
Copy link
Member Author

Good MOOSE framework: "A zero mapping Jacobian isn't necessarily an error; it's an exception that we can often catch and recover from."

Evil MOOSE test suite: "If a zero mapping Jacobian doesn't output the exact phrase ERROR: negative Jacobian 0 then you don't pass."

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.

2 participants