Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NOX: catch std::runtime_error instead of char* for Trilinos 14.2.0 onwards #15450

Merged
merged 3 commits into from
Jun 23, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 13 additions & 4 deletions include/deal.II/trilinos/nox.templates.h
Original file line number Diff line number Diff line change
Expand Up @@ -1161,12 +1161,21 @@ namespace TrilinosWrappers
ExcNOXNoConvergence());
}
}
// See if NOX returned by triggering an exception. In a sign of generally
// poor software design, NOX throws an exception that is not of a class
// derived from std::exception, but just a char*. That's a nuisance -- you
// just have to know :-(
// See if NOX returned by triggering an exception.
# if DEAL_II_TRILINOS_VERSION_GTE(14, 2, 0)
// Starting with Trilinos version 14.2.0 NOX started to throw a
// std::runtime_error instead of a plain char*.
catch (const std::runtime_error &exc)
{
const char *s = exc.what();
# else
// In a sign of generally poor software design, NOX prior to Trilinos
// version 4.2.0 throws an exception that is not of a class derived
tamiko marked this conversation as resolved.
Show resolved Hide resolved
// from std::exception, but just a char*. That's a nuisance -- you just
// have to know :-(
catch (const char *s)
{
# endif
// Like above, see if NOX aborted because there was an exception
// in a user callback. In that case, collate the errors if we can
// (namely, if the user exception was derived from std::exception),
Expand Down