Mesh Oriented datABase  (version 5.5.0)
An array-based unstructured mesh library
cgm2moab.hpp File Reference
#include <iostream>
#include "moab/Interface.hpp"
#include "moab/GeomTopoTool.hpp"
+ Include dependency graph for cgm2moab.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CHECKERR(M, C)   chkerr( M, C, __LINE__, __FILE__ )
 

Functions

void chkerr (Interface *mbi, ErrorCode code, int line, const char *file)
 
void chkerr (Interface &mbi, ErrorCode code, int line, const char *file)
 
void chkerr (GeomTopoTool &gtt, ErrorCode code, int line, const char *file)
 

Variables

bool verbose
 program-wide verbose output flag More...
 

Macro Definition Documentation

◆ CHECKERR

#define CHECKERR (   M,
 
)    chkerr( M, C, __LINE__, __FILE__ )

Definition at line 19 of file cgm2moab.hpp.

Function Documentation

◆ chkerr() [1/3]

void chkerr ( GeomTopoTool gtt,
ErrorCode  code,
int  line,
const char *  file 
)

Definition at line 46 of file cgm2moab.cpp.

47 {
48  chkerr( gtt.get_moab_instance(), code, line, file );
49 }

References chkerr(), and moab::GeomTopoTool::get_moab_instance().

◆ chkerr() [2/3]

void chkerr ( Interface mbi,
ErrorCode  code,
int  line,
const char *  file 
)

Definition at line 41 of file cgm2moab.cpp.

42 {
43  chkerr( &mbi, code, line, file );
44 }

References chkerr().

◆ chkerr() [3/3]

void chkerr ( Interface mbi,
ErrorCode  code,
int  line,
const char *  file 
)

Generic halt-on-error error checking

Definition at line 21 of file cgm2moab.cpp.

22 {
23 
24  if( code != MB_SUCCESS )
25  {
26  std::cerr << "Error: " << mbi->get_error_string( code ) << " (" << code << ")" << std::endl;
27  std::string message;
28  if( MB_SUCCESS == mbi->get_last_error( message ) && !message.empty() )
29  std::cerr << "Error message: " << message << std::endl;
30  std::string fname = file;
31  size_t slash = fname.find_last_of( '/' );
32  if( slash != fname.npos )
33  {
34  fname = fname.substr( slash + 1 );
35  }
36  std::cerr << "At " << fname << " line: " << line << std::endl;
37  std::exit( EXIT_FAILURE );
38  }
39 }

References moab::Interface::get_error_string(), moab::Interface::get_last_error(), and MB_SUCCESS.

Referenced by chkerr().

Variable Documentation

◆ verbose