12 #ifndef MFEM_ERROR_HPP
13 #define MFEM_ERROR_HPP
15 #include "../config/config.hpp"
30 #ifndef _MFEM_FUNC_NAME
33 #define _MFEM_FUNC_NAME __PRETTY_FUNCTION__
38 #define _MFEM_FUNC_NAME __FUNCSIG__
42 #define MFEM_LOCATION \
43 "\n ... in function: " << _MFEM_FUNC_NAME << \
44 "\n ... at line " << __LINE__ << " of file: " << __FILE__ << '\n'
47 #define _MFEM_MESSAGE(msg, warn) \
49 std::ostringstream mfemMsgStream; \
50 mfemMsgStream << std::setprecision(16); \
51 mfemMsgStream << std::setiosflags(std::ios_base::scientific); \
52 mfemMsgStream << msg << MFEM_LOCATION; \
54 mfem::mfem_error(mfemMsgStream.str().c_str()); \
56 mfem::mfem_warning(mfemMsgStream.str().c_str()); \
64 #define MFEM_ABORT(msg) _MFEM_MESSAGE("MFEM abort: " << msg, 0)
67 #define MFEM_VERIFY(x, msg) \
70 _MFEM_MESSAGE("Verification failed: (" \
71 << #x << ") is false: " << msg, 0); \
80 #define MFEM_CONTRACT_VAR(x) if (0 && &x == &x){}
85 #define MFEM_ASSERT(x, msg) \
88 _MFEM_MESSAGE("Assertion failed: (" \
89 << #x << ") is false: " << msg, 0); \
93 #define MFEM_DEBUG_DO(x) x
98 #define MFEM_ASSERT(x, msg)
101 #define MFEM_DEBUG_DO(x)
106 #define MFEM_WARNING(msg) _MFEM_MESSAGE("MFEM Warning: " << msg, 1)
void mfem_warning(const char *msg)
void mfem_error(const char *msg)
void mfem_backtrace(int mode, int depth)