20 #include "libmesh/libmesh.h" 21 #include "libmesh/libmesh_common.h" 22 #include "libmesh/print_trace.h" 23 #include "libmesh/threads.h" 26 #ifdef LIBMESH_HAVE_SYS_TYPES_H 27 #include <sys/types.h> 29 #ifdef LIBMESH_HAVE_UNISTD_H 33 #ifdef LIBMESH_HAVE_CSIGNAL 37 #if defined(LIBMESH_HAVE_GCC_ABI_DEMANGLE) 45 namespace MacroFunctions
47 void here(
const char * file,
int line,
const char * date,
const char * time, std::ostream & os)
52 <<
", compiled " << date
59 void stop(
const char * file,
int line,
const char * date,
const char * time)
64 #if defined(LIBMESH_HAVE_CSIGNAL) && defined(SIGSTOP) 65 libMesh::out <<
"Stopping process " << getpid() <<
"..." << std::endl;
67 libMesh::out <<
"Continuing process " << getpid() <<
"..." << std::endl;
69 libMesh::out <<
"WARNING: libmesh_stop() does not work; no operating system support." << std::endl;
77 void report_error(
const char * file,
int line,
const char * date,
const char * time, std::ostream & os)
84 static bool reporting_error =
false;
89 os <<
"libMesh encountered an error while attempting to report_error." << std::endl;
92 reporting_error =
true;
101 reporting_error =
false;
110 #if defined(LIBMESH_HAVE_GCC_ABI_DEMANGLE) 114 std::string ret =
name;
117 char * demangled_name = abi::__cxa_demangle(
name, 0, 0, &
status);
121 ret = demangled_name;
125 std::free(demangled_name);
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
processor_id_type global_n_processors()
void here(const char *file, int line, const char *date, const char *time, std::ostream &os=libMesh::err)
The libMesh namespace provides an interface to certain functionality in the library.
void write_traceout()
Writes a stack trace to a uniquely named file if –enable-tracefiles has been set by configure...
void report_error(const char *file, int line, const char *date, const char *time, std::ostream &os=libMesh::err)
void stop(const char *file, int line, const char *date, const char *time)
Threads::spin_mutex report_error_spin_mtx
std::string demangle(const char *name)
Mostly system independent demangler.
void print_trace(std::ostream &out_stream=std::cerr)
Print a stack trace (for code compiled with gcc)
processor_id_type global_processor_id()
bool on_command_line(std::string arg)