libmesh解析
本工作只是尝试解析原libmesh的代码,供学习使用
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 
函数
libMesh::MacroFunctions 命名空间参考

函数

void here (const char *file, int line, const char *date, const char *time, std::ostream &os)
 
void stop (const char *file, int line, const char *date, const char *time)
 
void report_error (const char *file, int line, const char *date, const char *time, std::ostream &os)
 

函数说明

void libMesh::MacroFunctions::here ( const char *  file,
int  line,
const char *  date,
const char *  time,
std::ostream &  os 
)

在文件 libmesh_common.C41 行定义.

参考 libMesh::global_processor_id().

参考自 report_error() , 以及 stop().

42 {
43  os << "[" << static_cast<std::size_t>(libMesh::global_processor_id()) << "] "
44  << file
45  << ", line " << line
46  << ", compiled " << date
47  << " at " << time
48  << std::endl;
49 }
processor_id_type global_processor_id()
Definition: libmesh_base.h:85
void libMesh::MacroFunctions::report_error ( const char *  file,
int  line,
const char *  date,
const char *  time,
std::ostream &  os 
)

在文件 libmesh_common.C69 行定义.

参考 libMesh::global_n_processors(), here(), libMesh::on_command_line(), libMesh::print_trace() , 以及 libMesh::write_traceout().

70 {
71  // It is possible to have an error *inside* report_error; e.g. from
72  // print_trace. We don't want to infinitely recurse.
73  static bool reporting_error = false;
74  if (reporting_error)
75  {
76  // I heard you like error reporting, so we put an error report
77  // in report_error() so you can report errors from the report.
78  os << "libMesh encountered an error while attempting to report_error." << std::endl;
79  return;
80  }
81  reporting_error = true;
82 
83  if (libMesh::global_n_processors() == 1 ||
84  libMesh::on_command_line("--print-trace"))
86  else
88  libMesh::MacroFunctions::here(file, line, date, time, os);
89 
90  reporting_error = false;
91 }
processor_id_type global_n_processors()
Definition: libmesh_base.h:75
void write_traceout()
Writes a stack trace to a uniquely named file if –enable-tracefiles has been set by configure...
Definition: print_trace.C:244
void print_trace(std::ostream &out_stream)
Print a stack trace (for code compiled with gcc)
Definition: print_trace.C:206
bool on_command_line(std::string arg)
Definition: libmesh.C:872
void here(const char *file, int line, const char *date, const char *time, std::ostream &os)
void libMesh::MacroFunctions::stop ( const char *  file,
int  line,
const char *  date,
const char *  time 
)

在文件 libmesh_common.C53 行定义.

参考 libMesh::global_n_processors(), here() , 以及 libMesh::out.

参考自 libMesh::PetscMatrix< T >::row_start() , 以及 libMesh::PetscMatrix< T >::row_stop().

54 {
56  {
57  libMesh::MacroFunctions::here(file, line, date, time);
58 #if defined(LIBMESH_HAVE_CSIGNAL) && defined(SIGSTOP)
59  libMesh::out << "Stopping process " << getpid() << "..." << std::endl;
60  std::raise(SIGSTOP);
61  libMesh::out << "Continuing process " << getpid() << "..." << std::endl;
62 #else
63  libMesh::out << "WARNING: libmesh_stop() does not work; no operating system support." << std::endl;
64 #endif
65  }
66 }
processor_id_type global_n_processors()
Definition: libmesh_base.h:75
OStreamProxy out
void here(const char *file, int line, const char *date, const char *time, std::ostream &os)