Description: This example tests MOAB's trace back error handler in serial.
To run: ./TestErrorHandling <test_case_num(1 to 4)>
#ifdef MOAB_HAVE_MPI
#endif
#include <iostream>
using namespace std;
{
string test_file = string(
MESH_DIR ) + string(
"/io/fv3x46x72.t.3.nc" );
}
{
string test_file = string(
MESH_DIR ) + string(
"/io/homme3x3458.t.3.nc" );
ErrorCode rval =
mb.load_file( test_file.c_str(), NULL,
"VARIABLE=T;GATHER_SET=0.1" );
MB_CHK_ERR( rval );
}
{
string test_file = string(
MESH_DIR ) + string(
"/io/fv3x46x72.t.3.nc" );
}
{
const int NUM_VTX = 100;
vector< double > coords( 3 * NUM_VTX );
Range verts;
void* ptr = NULL;
int count = 0;
rval =
mb.tag_iterate( tag, verts.begin(), verts.end(), count, ptr );
MB_CHK_SET_ERR( rval,
"Failed to iterate over tag on " << NUM_VTX <<
" vertices" );
}
int main(
int argc,
char** argv )
{
if( argc < 2 )
{
cout << "Usage: " << argv[0] << " <test_case_num(1 to 4)>" << endl;
return 0;
}
#ifdef MOAB_HAVE_MPI
MPI_Init( &argc, &argv );
#endif
int test_case_num = atoi( argv[1] );
switch( test_case_num )
{
case 1:
break;
case 2:
break;
case 3:
break;
case 4:
break;
default:
break;
}
#ifdef MOAB_HAVE_MPI
MPI_Finalize();
#endif
return 0;
}