MOAB: Mesh Oriented datABase  (version 5.4.1)
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.

Defines

#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[])

Define Documentation

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

Definition at line 6 of file partest.cpp.

Referenced by main().

#define IMESH_NULL   0

Definition at line 8 of file partest.cpp.

Referenced by main().

#define STRINGIFY (   X)    STRINGIFY_( X )

Definition at line 10 of file partest.cpp.

Referenced by main().

#define STRINGIFY_ (   X)    #X

Definition at line 9 of file partest.cpp.


Function Documentation

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

Definition at line 12 of file partest.cpp.

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

{
    MPI_Init( &argc, &argv );
    printf( "Hello\n" );

    iMesh_Instance imesh;
    iMeshP_PartitionHandle partn;
    int ierr, num_sets;

    iBase_EntitySetHandle root;
    imesh = IMESH_NULL;
    iMesh_newMesh( 0, &imesh, &ierr, 0 );
    IMESH_ASSERT( ierr );
    iMesh_getRootSet( imesh, &root, &ierr );
    IMESH_ASSERT( ierr );

    iMeshP_createPartitionAll( imesh, MPI_COMM_WORLD, &partn, &ierr );
    IMESH_ASSERT( ierr );

    const char options[] = " moab:PARALLEL=READ_PART "
                           " moab:PARTITION=PARALLEL_PARTITION "
                           " moab:PARALLEL_RESOLVE_SHARED_ENTS "
                           " moab:PARTITION_DISTRIBUTE ";
    const char* filename = STRINGIFY( MESHDIR ) "/64bricks_1khex.h5m";
    ;

    iMeshP_loadAll( imesh, partn, root, filename, options, &ierr, strlen( filename ), strlen( options ) );
    IMESH_ASSERT( ierr );

    iMesh_getNumEntSets( imesh, IMESH_NULL, 1, &num_sets, &ierr );
    IMESH_ASSERT( ierr );
    printf( "There's %d entity sets here\n", num_sets );

    iMesh_dtor( imesh, &ierr );
    IMESH_ASSERT( ierr );

    printf( "Done\n" );
    MPI_Finalize();  // probably the 4th time this is called.. no big deal
}
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines