MOAB: Mesh Oriented datABase  (version 5.5.0)
partest.cpp File Reference
#include <cstdio>
#include <cstring>
#include "moab_mpi.h"
#include "iMeshP.h"
+ Include dependency graph for partest.cpp:

Go to the source code of this file.

Macros

#define IMESH_ASSERT(ierr)    if( ( ierr ) != 0 ) printf( "imesh assert\n" );
 
#define IMESH_NULL   0
 
#define STRINGIFY_(X)   #X
 
#define STRINGIFY(X)   STRINGIFY_( X )
 

Functions

int main (int argc, char *argv[])
 

Macro Definition Documentation

◆ IMESH_ASSERT

#define IMESH_ASSERT (   ierr)     if( ( ierr ) != 0 ) printf( "imesh assert\n" );

Definition at line 6 of file partest.cpp.

◆ IMESH_NULL

#define IMESH_NULL   0

Definition at line 8 of file partest.cpp.

◆ STRINGIFY

#define STRINGIFY (   X)    STRINGIFY_( X )

Definition at line 10 of file partest.cpp.

◆ STRINGIFY_

#define STRINGIFY_ (   X)    #X

Definition at line 9 of file partest.cpp.

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 12 of file partest.cpp.

13 {
14  MPI_Init( &argc, &argv );
15  printf( "Hello\n" );
16 
17  iMesh_Instance imesh;
19  int ierr, num_sets;
20 
22  imesh = IMESH_NULL;
23  iMesh_newMesh( 0, &imesh, &ierr, 0 );
24  IMESH_ASSERT( ierr );
25  iMesh_getRootSet( imesh, &root, &ierr );
26  IMESH_ASSERT( ierr );
27 
28  iMeshP_createPartitionAll( imesh, MPI_COMM_WORLD, &partn, &ierr );
29  IMESH_ASSERT( ierr );
30 
31  const char options[] = " moab:PARALLEL=READ_PART "
32  " moab:PARTITION=PARALLEL_PARTITION "
33  " moab:PARALLEL_RESOLVE_SHARED_ENTS "
34  " moab:PARTITION_DISTRIBUTE ";
35  const char* filename = STRINGIFY( MESHDIR ) "/64bricks_1khex.h5m";
36  ;
37 
38  iMeshP_loadAll( imesh, partn, root, filename, options, &ierr, strlen( filename ), strlen( options ) );
39  IMESH_ASSERT( ierr );
40 
41  iMesh_getNumEntSets( imesh, IMESH_NULL, 1, &num_sets, &ierr );
42  IMESH_ASSERT( ierr );
43  printf( "There's %d entity sets here\n", num_sets );
44 
45  iMesh_dtor( imesh, &ierr );
46  IMESH_ASSERT( ierr );
47 
48  printf( "Done\n" );
49  MPI_Finalize(); // probably the 4th time this is called.. no big deal
50 }

References filename, ierr, IMESH_ASSERT, iMesh_dtor, iMesh_getNumEntSets, iMesh_getRootSet, iMesh_newMesh, IMESH_NULL, iMeshP_createPartitionAll, iMeshP_loadAll, MPI_COMM_WORLD, and STRINGIFY.