libMesh
Public Member Functions | Public Attributes | List of all members
libMesh::PetscSolverException Class Reference

A specialization of the SolverException class for PETSc. More...

#include <petsc_solver_exception.h>

Inheritance diagram for libMesh::PetscSolverException:
[legend]

Public Member Functions

 PetscSolverException (int error_code_in)
 
virtual const char * what () const libmesh_noexcept
 Override the what() function to provide a generic error message. More...
 

Public Attributes

int error_code
 The error code generated by the solver. More...
 
std::string what_message
 string which holds the message built in the constructor. More...
 

Detailed Description

A specialization of the SolverException class for PETSc.

Definition at line 37 of file petsc_solver_exception.h.

Constructor & Destructor Documentation

libMesh::PetscSolverException::PetscSolverException ( int  error_code_in)

Definition at line 40 of file petsc_solver_exception.h.

References libMesh::SolverException::error_code, libmesh_nullptr, and libMesh::SolverException::what_message.

40  :
41  SolverException(error_code_in)
42  {
43  const char * text;
44  // This is one scenario where we don't catch the error code
45  // returned by a PETSc function :)
46  PetscErrorMessage(error_code, &text, libmesh_nullptr);
47  what_message = text;
48  }
SolverException(int error_code_in)
const class libmesh_nullptr_t libmesh_nullptr
int error_code
The error code generated by the solver.
std::string what_message
string which holds the message built in the constructor.

Member Function Documentation

virtual const char* libMesh::SolverException::what ( ) const
virtualinherited

Override the what() function to provide a generic error message.

Definition at line 131 of file libmesh_exceptions.h.

132  {
133  // std::string::c_str() is noexcept in C++11, so it's safe to call
134  // in what() because it can't throw.
135  return what_message.c_str();
136  }
std::string what_message
string which holds the message built in the constructor.

Member Data Documentation

int libMesh::SolverException::error_code
inherited

The error code generated by the solver.

Definition at line 141 of file libmesh_exceptions.h.

Referenced by PetscSolverException().

std::string libMesh::SolverException::what_message
inherited

string which holds the message built in the constructor.

Definition at line 146 of file libmesh_exceptions.h.

Referenced by PetscSolverException().


The documentation for this class was generated from the following file: