Mesh Oriented datABase
(version 5.4.1)
Array-based unstructured mesh datastructure
|
00001 #include <cstdio> 00002 #include <cstring> 00003 #include "moab_mpi.h" 00004 #include "iMeshP.h" 00005 00006 #define IMESH_ASSERT( ierr ) \ 00007 if( ( ierr ) != 0 ) printf( "imesh assert\n" ); 00008 #define IMESH_NULL 0 00009 #define STRINGIFY_( X ) #X 00010 #define STRINGIFY( X ) STRINGIFY_( X ) 00011 00012 int main( int argc, char* argv[] ) 00013 { 00014 MPI_Init( &argc, &argv ); 00015 printf( "Hello\n" ); 00016 00017 iMesh_Instance imesh; 00018 iMeshP_PartitionHandle partn; 00019 int ierr, num_sets; 00020 00021 iBase_EntitySetHandle root; 00022 imesh = IMESH_NULL; 00023 iMesh_newMesh( 0, &imesh, &ierr, 0 ); 00024 IMESH_ASSERT( ierr ); 00025 iMesh_getRootSet( imesh, &root, &ierr ); 00026 IMESH_ASSERT( ierr ); 00027 00028 iMeshP_createPartitionAll( imesh, MPI_COMM_WORLD, &partn, &ierr ); 00029 IMESH_ASSERT( ierr ); 00030 00031 const char options[] = " moab:PARALLEL=READ_PART " 00032 " moab:PARTITION=PARALLEL_PARTITION " 00033 " moab:PARALLEL_RESOLVE_SHARED_ENTS " 00034 " moab:PARTITION_DISTRIBUTE "; 00035 const char* filename = STRINGIFY( MESHDIR ) "/64bricks_1khex.h5m"; 00036 ; 00037 00038 iMeshP_loadAll( imesh, partn, root, filename, options, &ierr, strlen( filename ), strlen( options ) ); 00039 IMESH_ASSERT( ierr ); 00040 00041 iMesh_getNumEntSets( imesh, IMESH_NULL, 1, &num_sets, &ierr ); 00042 IMESH_ASSERT( ierr ); 00043 printf( "There's %d entity sets here\n", num_sets ); 00044 00045 iMesh_dtor( imesh, &ierr ); 00046 IMESH_ASSERT( ierr ); 00047 00048 printf( "Done\n" ); 00049 MPI_Finalize(); // probably the 4th time this is called.. no big deal 00050 }