20 #ifndef LIBMESH_LIBMESH_EXCEPTIONS_H 21 #define LIBMESH_LIBMESH_EXCEPTIONS_H 23 #include "libmesh/libmesh_config.h" 51 NotImplemented(std::string msg=
"") :
std::logic_error(
"Error: feature not implemented!\n" + msg ) {}
65 FileError(
const std::string & filename,
const std::string msg=
"") :
66 std::runtime_error(
"Error with file `" + filename +
"'\n" +
std::move(msg)) {}
112 std::ostringstream oss;
113 oss <<
"Error code " <<
error_code <<
" during solve." << std::endl;
125 virtual const char *
what() const noexcept
override 145 #ifdef LIBMESH_ENABLE_EXCEPTIONS 146 #define libmesh_noexcept noexcept 148 #define LIBMESH_THROW(e) do { throw e; } while (0) 149 #define libmesh_rethrow throw 150 #define libmesh_try try 151 #define libmesh_catch(e) catch(e) 155 #define LIBMESH_THROW(e) do { libMesh::err << e.what(); std::abort(); } while (0) 156 #define libmesh_rethrow 158 #define libmesh_catch(e) if (0) 160 #endif // LIBMESH_ENABLE_EXCEPTIONS 162 #endif // LIBMESH_LIBMESH_EXCEPTIONS_H A class to stub for features that should be in libMesh, but haven't been written yet, to be thrown by "libmesh_not_implemented();".
NotImplemented(std::string msg="")
A class representing that a dynamic cast failed to produce expected output.
SolverException(int error_code_in)
int error_code
The error code generated by the solver.
A class representing a floating point exception.
The libMesh namespace provides an interface to certain functionality in the library.
std::string what_message
string which holds the message built in the constructor.
A class representing an exception during a solve.
LogicError(const std::string &msg)
virtual const char * what() const noexcept override
Override the what() function to provide a generic error message.
FileError(const std::string &filename, const std::string msg="")
A class to represent the internal "this should never happen" errors, to be thrown by "libmesh_error()...
A class representing a solver's failure to converge, to be thrown by "libmesh_convergence_failure();"...
virtual ~SolverException()=default
Virtual destructor, gotta have one of those.
A class representing a failed attempt by the library to open a file (or construct an fstream...