MOAB: Mesh Oriented datABase  (version 5.2.1)
read_nc.cpp
Go to the documentation of this file.
00001 #include "TestUtil.hpp"
00002 #include "moab/Core.hpp"
00003 
00004 using namespace moab;
00005 
00006 std::string example_eul    = TestDir + "/io/eul3x48x96.t.3.nc";
00007 std::string example_fv     = TestDir + "/io/fv3x46x72.t.3.nc";
00008 std::string example_domain = TestDir + "/io/domain.ocn.ne4np4_oQU240.160614.nc";
00009 
00010 #ifdef MOAB_HAVE_MPI
00011 #include "moab_mpi.h"
00012 #include "moab/ParallelComm.hpp"
00013 #endif
00014 
00015 // CAM-EUL
00016 void test_read_eul_all();
00017 void test_read_eul_onevar();
00018 void test_read_eul_onetimestep();
00019 void test_read_eul_nomesh();
00020 void test_read_eul_novars();
00021 
00022 // CAM-FV
00023 void test_read_fv_all();
00024 void test_read_fv_onevar();
00025 void test_read_fv_onetimestep();
00026 void test_read_fv_nomesh();
00027 void test_read_fv_novars();
00028 #ifdef MOAB_HAVE_MPI
00029 void test_read_fv_ghosting();
00030 #endif
00031 
00032 // Domain file
00033 void test_read_domain();
00034 
00035 ErrorCode get_options( std::string& opts );
00036 
00037 const int levels = 3;
00038 
00039 int main( int argc, char* argv[] )
00040 {
00041     int result = 0;
00042 
00043 #ifdef MOAB_HAVE_MPI
00044     int fail = MPI_Init( &argc, &argv );
00045     if( fail ) return 1;
00046 #else
00047     argv[0]   = argv[argc - argc];  // To remove the warnings in serial mode about unused variables
00048 #endif
00049 
00050     result += RUN_TEST( test_read_eul_all );
00051     result += RUN_TEST( test_read_eul_onevar );
00052     result += RUN_TEST( test_read_eul_onetimestep );
00053     result += RUN_TEST( test_read_eul_nomesh );
00054     result += RUN_TEST( test_read_eul_novars );
00055     result += RUN_TEST( test_read_domain );
00056     // Exclude test_read_fv_all() since reading edge data is not implemented in MOAB yet
00057     // result += RUN_TEST(test_read_fv_all);
00058     result += RUN_TEST( test_read_fv_onevar );
00059     result += RUN_TEST( test_read_fv_onetimestep );
00060     result += RUN_TEST( test_read_fv_nomesh );
00061     result += RUN_TEST( test_read_fv_novars );
00062 
00063 #ifdef MOAB_HAVE_MPI
00064     // Before ghosting issues with ownership were fixed, this test failed on 4 processors
00065     result += RUN_TEST( test_read_fv_ghosting );
00066 #endif
00067 
00068 #ifdef MOAB_HAVE_MPI
00069     fail = MPI_Finalize();
00070     if( fail ) return 1;
00071 #endif
00072 
00073     return result;
00074 }
00075 
00076 void test_read_eul_all()
00077 {
00078     Core moab;
00079     Interface& mb = moab;
00080 
00081     std::string opts;
00082     ErrorCode rval = get_options( opts );CHECK_ERR( rval );
00083 
00084     rval = mb.load_file( example_eul.c_str(), NULL, opts.c_str() );CHECK_ERR( rval );
00085 
00086     // Check for proper tags
00087     Tag Ttag0, Ttag1, coordTag;
00088     rval = mb.tag_get_handle( "T0", levels, MB_TYPE_DOUBLE, Ttag0 );CHECK_ERR( rval );
00089 
00090     rval = mb.tag_get_handle( "T1", levels, MB_TYPE_DOUBLE, Ttag1 );CHECK_ERR( rval );
00091 
00092     rval = mb.tag_get_handle( "COORDS", 3, MB_TYPE_DOUBLE, coordTag );CHECK_ERR( rval );
00093 
00094     // Check for some tags with double underscore in the tag name
00095     Tag tempTag;
00096     rval = mb.tag_get_handle( "__lon_LOC_MINMAX", 2, MB_TYPE_INTEGER, tempTag );CHECK_ERR( rval );
00097 
00098     rval = mb.tag_get_handle( "__lon_LOC_VALS", 0, MB_TYPE_DOUBLE, tempTag, MB_TAG_VARLEN );CHECK_ERR( rval );
00099 
00100     rval = mb.tag_get_handle( "__lon_GLOBAL_MINMAX", 2, MB_TYPE_INTEGER, tempTag );CHECK_ERR( rval );
00101 }
00102 
00103 void test_read_eul_onevar()
00104 {
00105     Core moab;
00106     Interface& mb = moab;
00107     std::string opts;
00108     ErrorCode rval = get_options( opts );CHECK_ERR( rval );
00109 
00110     opts += std::string( ";VARIABLE=T" );
00111     rval = mb.load_file( example_eul.c_str(), NULL, opts.c_str() );CHECK_ERR( rval );
00112 
00113     // Check for proper tags
00114     Tag Ttag0, Ttag1;
00115     rval = mb.tag_get_handle( "T0", levels, MB_TYPE_DOUBLE, Ttag0 );CHECK_ERR( rval );
00116 
00117     rval = mb.tag_get_handle( "T1", levels, MB_TYPE_DOUBLE, Ttag1 );CHECK_ERR( rval );
00118 
00119     // Check values of tag T0 (first level) at some strategically chosen places below
00120 #ifdef MOAB_HAVE_MPI
00121     ParallelComm* pcomm = ParallelComm::get_pcomm( &mb, 0 );
00122     int rank            = pcomm->proc_config().proc_rank();
00123     int procs           = pcomm->proc_config().proc_size();
00124 #else
00125     int rank  = 0;
00126     int procs = 1;
00127 #endif
00128 
00129     const double eps = 0.0001;
00130     double val[8 * levels];
00131 
00132     if( 1 == procs )
00133     {
00134         Range global_quads;
00135         rval = mb.get_entities_by_type( 0, MBQUAD, global_quads );CHECK_ERR( rval );
00136         CHECK_EQUAL( (size_t)4608, global_quads.size() );
00137 
00138         EntityHandle gloabl_quad_ents[] = { global_quads[0],    global_quads[2255], global_quads[2304],
00139                                             global_quads[4559], global_quads[48],   global_quads[2303],
00140                                             global_quads[2352], global_quads[4607] };
00141         rval                            = mb.tag_get_data( Ttag0, &gloabl_quad_ents[0], 8, val );
00142 
00143         CHECK_REAL_EQUAL( 252.8529, val[0 * levels], eps );  // First global quad
00144         CHECK_REAL_EQUAL( 234.8390, val[1 * levels], eps );  // 2256th global quad
00145         CHECK_REAL_EQUAL( 232.6458, val[2 * levels], eps );  // 2305th global quad
00146         CHECK_REAL_EQUAL( 205.3905, val[3 * levels], eps );  // 4560th global quad
00147         CHECK_REAL_EQUAL( 252.7116, val[4 * levels], eps );  // 49th global quad
00148         CHECK_REAL_EQUAL( 232.6670, val[5 * levels], eps );  // 2304th global quad
00149         CHECK_REAL_EQUAL( 234.6922, val[6 * levels], eps );  // 2353th global quad
00150         CHECK_REAL_EQUAL( 200.6828, val[7 * levels], eps );  // Last global quad
00151     }
00152     else if( 2 == procs )
00153     {
00154         Range local_quads;
00155         rval = mb.get_entities_by_type( 0, MBQUAD, local_quads );CHECK_ERR( rval );
00156         CHECK_EQUAL( (size_t)2304, local_quads.size() );
00157 
00158         EntityHandle local_quad_ents[] = { local_quads[0], local_quads[1151], local_quads[1152], local_quads[2303] };
00159         rval                           = mb.tag_get_data( Ttag0, &local_quad_ents[0], 4, val );
00160 
00161         if( 0 == rank )
00162         {
00163             CHECK_REAL_EQUAL( 252.8529, val[0 * levels],
00164                               eps );  // First local quad, first global quad
00165             CHECK_REAL_EQUAL( 234.8390, val[1 * levels],
00166                               eps );  // Median local quad, 2256th global quad
00167             CHECK_REAL_EQUAL( 232.6458, val[2 * levels],
00168                               eps );  // Median local quad, 2305th global quad
00169             CHECK_REAL_EQUAL( 205.3905, val[3 * levels],
00170                               eps );  // Last local quad, 4560th global quad
00171         }
00172         else if( 1 == rank )
00173         {
00174             CHECK_REAL_EQUAL( 252.7116, val[0 * levels],
00175                               eps );  // First local quad, 49th global quad
00176             CHECK_REAL_EQUAL( 232.6670, val[1 * levels],
00177                               eps );  // Median local quad, 2304th global quad
00178             CHECK_REAL_EQUAL( 234.6922, val[2 * levels],
00179                               eps );  // Median local quad, 2353th global quad
00180             CHECK_REAL_EQUAL( 200.6828, val[3 * levels],
00181                               eps );  // Last local quad, last global quad
00182         }
00183     }
00184 }
00185 
00186 void test_read_eul_onetimestep()
00187 {
00188     Core moab;
00189     Interface& mb = moab;
00190     std::string opts;
00191     ErrorCode rval = get_options( opts );CHECK_ERR( rval );
00192 
00193     opts += std::string( ";VARIABLE=T;TIMESTEP=1" );
00194     rval = mb.load_file( example_eul.c_str(), NULL, opts.c_str() );CHECK_ERR( rval );
00195 
00196     // Check for proper tags
00197     Tag Ttag0, Ttag1;
00198     rval = mb.tag_get_handle( "T0", levels, MB_TYPE_DOUBLE, Ttag0 );
00199     CHECK_EQUAL( rval, MB_TAG_NOT_FOUND );
00200 
00201     rval = mb.tag_get_handle( "T1", levels, MB_TYPE_DOUBLE, Ttag1 );CHECK_ERR( rval );
00202 }
00203 
00204 void test_read_eul_nomesh()
00205 {
00206     Core moab;
00207     Interface& mb = moab;
00208 
00209     // Need a set for nomesh to work right
00210     EntityHandle set;
00211     ErrorCode rval = mb.create_meshset( MESHSET_SET, set );CHECK_ERR( rval );
00212 
00213     std::string orig, opts;
00214     rval = get_options( orig );CHECK_ERR( rval );
00215 
00216     opts = orig + std::string( ";VARIABLE=T;TIMESTEP=0" );
00217     rval = mb.load_file( example_eul.c_str(), &set, opts.c_str() );CHECK_ERR( rval );
00218 
00219     // Check for proper tag
00220     Tag Ttag0, Ttag1;
00221     rval = mb.tag_get_handle( "T0", levels, MB_TYPE_DOUBLE, Ttag0 );CHECK_ERR( rval );
00222 
00223     rval = mb.tag_get_handle( "T1", levels, MB_TYPE_DOUBLE, Ttag1 );
00224     CHECK_EQUAL( rval, MB_TAG_NOT_FOUND );
00225 
00226     // Now read 2nd timestep with nomesh option
00227     opts = orig + std::string( ";VARIABLE=T;TIMESTEP=1;NOMESH" );
00228     rval = mb.load_file( example_eul.c_str(), &set, opts.c_str() );CHECK_ERR( rval );
00229 
00230     // Check for proper tag
00231     rval = mb.tag_get_handle( "T1", levels, MB_TYPE_DOUBLE, Ttag1 );CHECK_ERR( rval );
00232 }
00233 
00234 void test_read_eul_novars()
00235 {
00236     Core moab;
00237     Interface& mb = moab;
00238 
00239     // Need a set for nomesh to work right
00240     EntityHandle set;
00241     ErrorCode rval = mb.create_meshset( MESHSET_SET, set );CHECK_ERR( rval );
00242 
00243     std::string orig, opts;
00244     rval = get_options( orig );CHECK_ERR( rval );
00245 
00246     opts = orig + std::string( ";NOMESH;VARIABLE=" );
00247     rval = mb.load_file( example_eul.c_str(), &set, opts.c_str() );CHECK_ERR( rval );
00248 
00249     opts = orig + std::string( ";VARIABLE=;TIMESTEP=0" );
00250     rval = mb.load_file( example_eul.c_str(), &set, opts.c_str() );CHECK_ERR( rval );
00251 
00252     // Check for proper tag
00253     Tag Ttag0, Ttag1;
00254     rval = mb.tag_get_handle( "T0", levels, MB_TYPE_DOUBLE, Ttag0 );
00255     CHECK_EQUAL( rval, MB_TAG_NOT_FOUND );
00256 
00257     opts = orig + std::string( ";VARIABLE=T;TIMESTEP=0;NOMESH" );
00258     rval = mb.load_file( example_eul.c_str(), &set, opts.c_str() );CHECK_ERR( rval );
00259 
00260     rval = mb.tag_get_handle( "T0", levels, MB_TYPE_DOUBLE, Ttag0 );CHECK_ERR( rval );
00261 
00262     rval = mb.tag_get_handle( "T1", levels, MB_TYPE_DOUBLE, Ttag1 );
00263     CHECK_EQUAL( rval, MB_TAG_NOT_FOUND );
00264 
00265     // Now read 2nd timestep with nomesh option
00266     opts = orig + std::string( ";VARIABLE=T;TIMESTEP=1;NOMESH" );
00267     rval = mb.load_file( example_eul.c_str(), &set, opts.c_str() );CHECK_ERR( rval );
00268 
00269     // Check for proper tag
00270     rval = mb.tag_get_handle( "T1", levels, MB_TYPE_DOUBLE, Ttag1 );CHECK_ERR( rval );
00271 }
00272 
00273 void test_read_fv_all()
00274 {
00275     Core moab;
00276     Interface& mb = moab;
00277 
00278     std::string opts;
00279     ErrorCode rval = get_options( opts );CHECK_ERR( rval );
00280 
00281     rval = mb.load_file( example_fv.c_str(), NULL, opts.c_str() );CHECK_ERR( rval );
00282 
00283     // Check for proper tags
00284     Tag Ttag0, Ttag1, coordTag;
00285     rval = mb.tag_get_handle( "T0", levels, MB_TYPE_DOUBLE, Ttag0 );CHECK_ERR( rval );
00286 
00287     rval = mb.tag_get_handle( "T1", levels, MB_TYPE_DOUBLE, Ttag1 );CHECK_ERR( rval );
00288 
00289     rval = mb.tag_get_handle( "COORDS", 3, MB_TYPE_DOUBLE, coordTag );CHECK_ERR( rval );
00290 }
00291 
00292 void test_read_fv_onevar()
00293 {
00294     Core moab;
00295     Interface& mb = moab;
00296     std::string opts;
00297     ErrorCode rval = get_options( opts );CHECK_ERR( rval );
00298 
00299     opts += std::string( ";VARIABLE=T" );
00300     rval = mb.load_file( example_fv.c_str(), NULL, opts.c_str() );CHECK_ERR( rval );
00301 
00302     // Check for proper tags
00303     Tag Ttag0, Ttag1;
00304     rval = mb.tag_get_handle( "T0", levels, MB_TYPE_DOUBLE, Ttag0 );CHECK_ERR( rval );
00305 
00306     rval = mb.tag_get_handle( "T1", levels, MB_TYPE_DOUBLE, Ttag1 );CHECK_ERR( rval );
00307 
00308     // Check values of tag T0 (first level) at some strategically chosen places below
00309 #ifdef MOAB_HAVE_MPI
00310     ParallelComm* pcomm = ParallelComm::get_pcomm( &mb, 0 );
00311     int rank            = pcomm->proc_config().proc_rank();
00312     int procs           = pcomm->proc_config().proc_size();
00313 #else
00314     int rank  = 0;
00315     int procs = 1;
00316 #endif
00317 
00318     const double eps = 0.0001;
00319     double val[8 * levels];
00320 
00321     if( 1 == procs )
00322     {
00323         Range global_quads;
00324         rval = mb.get_entities_by_type( 0, MBQUAD, global_quads );CHECK_ERR( rval );
00325         CHECK_EQUAL( (size_t)3312, global_quads.size() );
00326 
00327         EntityHandle gloabl_quad_ents[] = { global_quads[0],    global_quads[1619], global_quads[1656],
00328                                             global_quads[3275], global_quads[36],   global_quads[1655],
00329                                             global_quads[1692], global_quads[3311] };
00330         rval                            = mb.tag_get_data( Ttag0, &gloabl_quad_ents[0], 8, val );
00331 
00332         CHECK_REAL_EQUAL( 253.6048, val[0 * levels], eps );  // First global quad
00333         CHECK_REAL_EQUAL( 232.2170, val[1 * levels], eps );  // 1620th global quad
00334         CHECK_REAL_EQUAL( 232.7454, val[2 * levels], eps );  // 1657th global quad
00335         CHECK_REAL_EQUAL( 210.2581, val[3 * levels], eps );  // 3276th global quad
00336         CHECK_REAL_EQUAL( 253.6048, val[4 * levels], eps );  // 37th global quad
00337         CHECK_REAL_EQUAL( 232.9553, val[5 * levels], eps );  // 1656th global quad
00338         CHECK_REAL_EQUAL( 232.1704, val[6 * levels], eps );  // 1693th global quad
00339         CHECK_REAL_EQUAL( 210.2581, val[7 * levels], eps );  // Last global quad
00340     }
00341     else if( 2 == procs )
00342     {
00343         Range local_quads;
00344         rval = mb.get_entities_by_type( 0, MBQUAD, local_quads );CHECK_ERR( rval );
00345         CHECK_EQUAL( (size_t)1656, local_quads.size() );
00346 
00347         EntityHandle local_quad_ents[] = { local_quads[0], local_quads[827], local_quads[828], local_quads[1655] };
00348         rval                           = mb.tag_get_data( Ttag0, &local_quad_ents[0], 4, val );
00349 
00350         if( 0 == rank )
00351         {
00352             CHECK_REAL_EQUAL( 253.6048, val[0 * levels],
00353                               eps );  // First local quad, first global quad
00354             CHECK_REAL_EQUAL( 232.2170, val[1 * levels],
00355                               eps );  // Median local quad, 1620th global quad
00356             CHECK_REAL_EQUAL( 232.7454, val[2 * levels],
00357                               eps );  // Median local quad, 1657th global quad
00358             CHECK_REAL_EQUAL( 210.2581, val[3 * levels],
00359                               eps );  // Last local quad, 3276th global quad
00360         }
00361         else if( 1 == rank )
00362         {
00363             CHECK_REAL_EQUAL( 253.6048, val[0 * levels],
00364                               eps );  // First local quad, 37th global quad
00365             CHECK_REAL_EQUAL( 232.9553, val[1 * levels],
00366                               eps );  // Median local quad, 1656th global quad
00367             CHECK_REAL_EQUAL( 232.1704, val[2 * levels],
00368                               eps );  // Median local quad, 1693th global quad
00369             CHECK_REAL_EQUAL( 210.2581, val[3 * levels],
00370                               eps );  // Last local quad, last global quad
00371         }
00372     }
00373 }
00374 
00375 void test_read_fv_onetimestep()
00376 {
00377     Core moab;
00378     Interface& mb = moab;
00379     std::string opts;
00380     ErrorCode rval = get_options( opts );CHECK_ERR( rval );
00381 
00382     opts += std::string( ";VARIABLE=T;TIMESTEP=1" );
00383     rval = mb.load_file( example_fv.c_str(), NULL, opts.c_str() );CHECK_ERR( rval );
00384 
00385     // Check for proper tags
00386     Tag Ttag0, Ttag1;
00387     rval = mb.tag_get_handle( "T0", levels, MB_TYPE_DOUBLE, Ttag0 );
00388     CHECK_EQUAL( rval, MB_TAG_NOT_FOUND );
00389 
00390     rval = mb.tag_get_handle( "T1", levels, MB_TYPE_DOUBLE, Ttag1 );CHECK_ERR( rval );
00391 
00392     // Check for some tags with double underscore in the tag name
00393     Tag tempTag;
00394     rval = mb.tag_get_handle( "__lon_LOC_MINMAX", 2, MB_TYPE_INTEGER, tempTag );CHECK_ERR( rval );
00395 
00396     rval = mb.tag_get_handle( "__lon_LOC_VALS", 0, MB_TYPE_DOUBLE, tempTag, MB_TAG_VARLEN );CHECK_ERR( rval );
00397 
00398     rval = mb.tag_get_handle( "__lon_GLOBAL_MINMAX", 2, MB_TYPE_INTEGER, tempTag );CHECK_ERR( rval );
00399 }
00400 
00401 void test_read_fv_nomesh()
00402 {
00403     Core moab;
00404     Interface& mb = moab;
00405 
00406     // Need a set for nomesh to work right
00407     EntityHandle set;
00408     ErrorCode rval = mb.create_meshset( MESHSET_SET, set );CHECK_ERR( rval );
00409 
00410     std::string orig, opts;
00411     rval = get_options( orig );CHECK_ERR( rval );
00412 
00413     opts = orig + std::string( ";VARIABLE=T;TIMESTEP=0" );
00414     rval = mb.load_file( example_fv.c_str(), &set, opts.c_str() );CHECK_ERR( rval );
00415 
00416     // Check for proper tag
00417     Tag Ttag0, Ttag1;
00418     rval = mb.tag_get_handle( "T0", levels, MB_TYPE_DOUBLE, Ttag0 );CHECK_ERR( rval );
00419 
00420     rval = mb.tag_get_handle( "T1", levels, MB_TYPE_DOUBLE, Ttag1 );
00421     CHECK_EQUAL( rval, MB_TAG_NOT_FOUND );
00422 
00423     // Now read 2nd timestep with nomesh option
00424     opts = orig + std::string( ";VARIABLE=T;TIMESTEP=1;NOMESH" );
00425     rval = mb.load_file( example_fv.c_str(), &set, opts.c_str() );CHECK_ERR( rval );
00426 
00427     // Check for proper tag
00428     rval = mb.tag_get_handle( "T1", levels, MB_TYPE_DOUBLE, Ttag1 );CHECK_ERR( rval );
00429 }
00430 
00431 void test_read_fv_novars()
00432 {
00433     Core moab;
00434     Interface& mb = moab;
00435 
00436     // Need a set for nomesh to work right
00437     EntityHandle set;
00438     ErrorCode rval = mb.create_meshset( MESHSET_SET, set );CHECK_ERR( rval );
00439 
00440     std::string orig, opts;
00441     rval = get_options( orig );CHECK_ERR( rval );
00442 
00443     opts = orig + std::string( ";NOMESH;VARIABLE=" );
00444     rval = mb.load_file( example_fv.c_str(), &set, opts.c_str() );CHECK_ERR( rval );
00445 
00446     opts = orig + std::string( ";VARIABLE=;TIMESTEP=0" );
00447     rval = mb.load_file( example_fv.c_str(), &set, opts.c_str() );CHECK_ERR( rval );
00448 
00449     // Check for proper tag
00450     Tag Ttag0, Ttag1;
00451     rval = mb.tag_get_handle( "T0", levels, MB_TYPE_DOUBLE, Ttag0 );
00452     CHECK_EQUAL( rval, MB_TAG_NOT_FOUND );
00453 
00454     opts = orig + std::string( ";VARIABLE=T;TIMESTEP=0;NOMESH" );
00455     rval = mb.load_file( example_fv.c_str(), &set, opts.c_str() );CHECK_ERR( rval );
00456 
00457     rval = mb.tag_get_handle( "T0", levels, MB_TYPE_DOUBLE, Ttag0 );CHECK_ERR( rval );
00458 
00459     rval = mb.tag_get_handle( "T1", levels, MB_TYPE_DOUBLE, Ttag1 );
00460     CHECK_EQUAL( rval, MB_TAG_NOT_FOUND );
00461 
00462     // Now read 2nd timestep with nomesh option
00463     opts = orig + std::string( ";VARIABLE=T;TIMESTEP=1;NOMESH" );
00464     rval = mb.load_file( example_fv.c_str(), &set, opts.c_str() );CHECK_ERR( rval );
00465 
00466     // Check for proper tag
00467     rval = mb.tag_get_handle( "T1", levels, MB_TYPE_DOUBLE, Ttag1 );CHECK_ERR( rval );
00468 }
00469 
00470 #ifdef MOAB_HAVE_MPI
00471 void test_read_fv_ghosting()
00472 {
00473     Core moab;
00474     Interface& mb = moab;
00475 
00476     // Need a set for nomesh to work right
00477     EntityHandle set;
00478     ErrorCode rval = mb.create_meshset( MESHSET_SET, set );CHECK_ERR( rval );
00479 
00480     std::string orig, opts;
00481     rval = get_options( orig );CHECK_ERR( rval );
00482 
00483     opts = std::string( "PARALLEL=READ_PART;PARTITION;PARALLEL_GHOSTS=2.0.1;NOMESH;VARIABLE=;"
00484                         "PARTITION_METHOD=SQIJ" );
00485     rval = mb.load_file( example_fv.c_str(), &set, opts.c_str() );CHECK_ERR( rval );
00486 
00487     opts = std::string( "PARALLEL=READ_PART;PARTITION;PARALLEL_RESOLVE_SHARED_ENTS;PARALLEL_GHOSTS="
00488                         "2.0.1;PARTITION_METHOD=SQIJ;VARIABLE=" );
00489     rval = mb.load_file( example_fv.c_str(), &set, opts.c_str() );CHECK_ERR( rval );
00490 
00491     opts = std::string( "PARALLEL=READ_PART;PARTITION;PARTITION_METHOD=SQIJ;VARIABLE=TOT_CLD_"
00492                         "VISTAU;NOMESH;TIMESTEP=0;" );
00493     rval = mb.load_file( example_fv.c_str(), &set, opts.c_str() );CHECK_ERR( rval );
00494 }
00495 #endif
00496 
00497 void test_read_domain()
00498 {
00499     Core moab;
00500     Interface& mb = moab;
00501 
00502     // Need a set for nomesh to work right
00503     EntityHandle set;
00504     ErrorCode rval = mb.create_meshset( MESHSET_SET, set );CHECK_ERR( rval );
00505 
00506     std::string orig, opts;
00507     rval = get_options( orig );CHECK_ERR( rval );
00508 
00509     opts = orig + std::string( ";VARIABLE=" );
00510     rval = mb.load_file( example_domain.c_str(), &set, opts.c_str() );CHECK_ERR( rval );
00511 }
00512 ErrorCode get_options( std::string& opts )
00513 {
00514 #ifdef MOAB_HAVE_MPI
00515     // Use parallel options
00516     opts = std::string( ";;PARALLEL=READ_PART;PARTITION_METHOD=SQIJ;DEBUG_IO=2;" );
00517     return MB_SUCCESS;
00518 #else
00519     opts      = std::string( ";;" );
00520     return MB_SUCCESS;
00521 #endif
00522 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines