32 #ifndef OOMPH_DEFINITIONS_HEADER
33 #define OOMPH_DEFINITIONS_HEADER
37 #include <oomph-lib-config.h>
51 #define OOMPH_MAKE_STRING(x) #x
57 #define OOMPH_TO_STRING(x) OOMPH_MAKE_STRING(x)
61 #define OOMPH_EXCEPTION_LOCATION __FILE__ ":" OOMPH_TO_STRING(__LINE__)
65 #if defined(__GNUC__) || (defined(__MWERKS__) && (__MWERKS__ >= 0x3000)) || \
66 (defined(__ICC) && (__ICC >= 600)) || defined(__ghs__)
67 #define OOMPH_CURRENT_FUNCTION __PRETTY_FUNCTION__
69 #elif defined(__DMC__) && (__DMC__ >= 0x810)
70 #define OOMPH_CURRENT_FUNCTION __PRETTY_FUNCTION__
72 #elif defined(__FUNCSIG__)
73 #define OOMPH_CURRENT_FUNCTION __FUNCSIG__
75 #elif (defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 600)) || \
76 (defined(__IBMCPP__) && (__IBMCPP__ >= 500))
77 #define OOMPH_CURRENT_FUNCTION __FUNCTION__
79 #elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x550)
80 #define OOMPH_CURRENT_FUNCTION __FUNC__
82 #elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)
83 #define OOMPH_CURRENT_FUNCTION __func__
86 #define OOMPH_CURRENT_FUNCTION "[Unknown function -- unrecognised compiler]"
99 namespace Global_timings
117 namespace TerminateHelper
196 const char* location,
198 std::ostream& exception_stream,
199 const unsigned& output_width,
200 bool list_trace_back);
235 const char* location)
257 Output_width = output_width;
279 const char* location)
301 Output_width = output_width;
372 namespace Global_output_stream
389 namespace Global_unsigned
407 namespace Global_string_for_annotation
415 extern std::vector<std::string>
String;
478 return Output_modifier_pt;
int i
Definition: BiCGSTAB_step_by_step.cpp:9
A small nullstream class that throws away everything sent to it.
Definition: oomph_definitions.h:315
Nullstream()
Constructor sets the buffer sizes to zero, suppressing all output.
Definition: oomph_definitions.h:318
Definition: oomph_definitions.h:430
std::ostream & operator<<(std::ostream &(*f)(std::ostream &))
Overload insertor to handle stream modifiers.
Definition: oomph_definitions.h:470
std::ostream * Stream_pt
Pointer to the output stream – defaults to std::cout.
Definition: oomph_definitions.h:433
OomphInfo()
Definition: oomph_definitions.h:441
std::ostream & operator<<(_Tp argument)
Definition: oomph_definitions.h:450
std::ostream *& stream_pt()
Access function for the stream pointer.
Definition: oomph_definitions.h:464
OutputModifier * Output_modifier_pt
Pointer to the output modifier object – defaults to no modification.
Definition: oomph_definitions.h:436
OutputModifier *& output_modifier_pt()
Access function for the output modifier pointer.
Definition: oomph_definitions.h:476
Definition: oomph_definitions.h:222
OomphLibError(const std::string &error_description, const std::string &function_name, const char *location)
Definition: oomph_definitions.h:233
static unsigned Output_width
Width in characters of the output report.
Definition: oomph_definitions.h:227
static void set_stream_pt(std::ostream *const &stream_pt)
Definition: oomph_definitions.h:248
static std::ostream * Stream_pt
Output stream that is used to write the errors.
Definition: oomph_definitions.h:224
static void set_output_width(const unsigned &output_width)
Definition: oomph_definitions.h:255
Definition: oomph_definitions.h:174
~OomphLibException()
The destructor cannot throw an exception (C++ STL standard)
Definition: oomph_definitions.cc:126
OomphLibException(const std::string &error_description, const std::string &function_name, const char *location, const std::string &exception_type, std::ostream &exception_stream, const unsigned &output_width, bool list_trace_back)
Definition: oomph_definitions.cc:144
void disable_error_message()
Definition: oomph_definitions.h:178
std::stringstream * Exception_stringstream_pt
String stream that records the error message.
Definition: oomph_definitions.h:209
std::ostream * Exception_stream_pt
Exception stream to which we write message in destructor.
Definition: oomph_definitions.h:206
bool Suppress_error_message
Definition: oomph_definitions.h:213
Definition: oomph_definitions.h:149
~OomphLibQuietException()
The destructor cannot throw an exception (C++ STL standard)
Definition: oomph_definitions.h:155
OomphLibQuietException()
Constructor.
Definition: oomph_definitions.cc:114
Definition: oomph_definitions.h:267
static void set_output_width(const unsigned &output_width)
Definition: oomph_definitions.h:299
static unsigned Output_width
Width of output.
Definition: oomph_definitions.h:272
static std::ostream * Stream_pt
Output stream that is used to write the errors.
Definition: oomph_definitions.h:269
static void set_stream_pt(std::ostream *const &stream_pt)
Definition: oomph_definitions.h:292
OomphLibWarning(const std::string &warning_description, const std::string &function_name, const char *location)
Definition: oomph_definitions.h:277
Definition: oomph_definitions.h:339
virtual ~OutputModifier()
Empty virtual destructor.
Definition: oomph_definitions.h:345
OutputModifier()
Empty constructor.
Definition: oomph_definitions.h:342
virtual bool operator()(std::ostream &stream)
Definition: oomph_definitions.h:350
static int f(const TensorMap< Tensor< int, 3 > > &tensor)
Definition: cxx11_tensor_map.cpp:237
std::ostream * Stream_pt
Definition: structured_cubic_point_source.cc:104
std::ofstream * Outfile
Output stream.
Definition: oomph_definitions.cc:252
std::vector< std::string > String
Definition: oomph_definitions.cc:300
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286
bool Doc_comprehensive_timings
Definition: oomph_definitions.cc:49
unsigned Number
The unsigned.
Definition: oomph_definitions.cc:269
void clean_up_memory()
Definition: oomph_definitions.cc:86
void suppress_exception_error_messages()
Suppress error messages (e.g. because error has been caught)
Definition: oomph_definitions.cc:72
void setup()
Setup terminate helper.
Definition: oomph_definitions.cc:63
void spawn_errors_from_uncaught_errors()
Function to spawn messages from uncaught errors.
Definition: oomph_definitions.cc:79
std::stringstream * Exception_stringstream_pt
String stream that records the error message.
Definition: oomph_definitions.cc:103
std::ostream * Error_message_stream_pt
Stream to output error messages.
Definition: oomph_definitions.cc:100
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition: AnisotropicHookean.h:10
Nullstream oomph_nullstream
Single (global) instantiation of the Nullstream.
Definition: oomph_definitions.cc:313
OutputModifier default_output_modifier
Single global instatiation of the default output modifier.
Definition: oomph_definitions.cc:325
OomphInfo oomph_info
Definition: oomph_definitions.cc:319