12#define _ping_ __FILE__, __LINE__
31 std::stringstream sstream_;
43 Message(
const char* file,
const int line){
44 sstream_ <<
"\n Message from file **"<<file<<
"** in line **" <<line<<
"**:\n ";
61 std::string
str()
const {
return sstream_.str();}
82class Error :
public std::exception
110 m+=
"\n"+message.
str();
113 virtual const char*
what()
const throw()
142 Message(
"\n FAILED to converge to ")<< eps <<
"! "<<m),
169 MPI_Abort(MPI_COMM_WORLD, code);
class intended for the use in throw statements
Definition: exceptions.h:83
Error(const Message &message)
Constructor.
Definition: exceptions.h:92
std::string get_message() const
Definition: exceptions.h:96
virtual ~Error()
Definition: exceptions.h:117
void append_line(const Message &message)
Appends a newline and a message verbatim to the what string.
Definition: exceptions.h:108
void append(const Message &message)
Appends a message verbatim to the what string.
Definition: exceptions.h:101
virtual const char * what() const
Definition: exceptions.h:113
small class holding a stringstream
Definition: exceptions.h:29
friend std::ostream & operator<<(std::ostream &os, const Message &m)
Definition: exceptions.h:64
std::string str() const
return the message contained in the stream as a string
Definition: exceptions.h:61
Message(const char *file, const int line)
Initiate message with the file and line it comes from.
Definition: exceptions.h:43
Message()
construct an empty message
Definition: exceptions.h:36
Message & operator<<(const T &value)
add values to the message stream
Definition: exceptions.h:55
Message(std::string m)
Construct message with string.
Definition: exceptions.h:50
~Message()
Definition: exceptions.h:51
static void abort_program(int code=-1)
Abort program (both MPI and non-MPI)
Definition: exceptions.h:167
This is the namespace for all functions and classes defined and used by the discontinuous Galerkin li...
Indicate failure to converge.
Definition: exceptions.h:126
Fail(double eps, const Message &m)
Construct from error limit.
Definition: exceptions.h:141
double epsilon() const
Return error limit.
Definition: exceptions.h:149
virtual ~Fail()
Definition: exceptions.h:150
Fail(double eps)
Construct from error limit.
Definition: exceptions.h:133