39 int main(
int argc,
char** argv )
44 MPI_Init( &argc, &argv );
48 opts.
addOpt<
int >( string(
"dim,d" ), string(
"Dimension of mesh (default=3)" ), &
dim );
49 opts.
addOpt<
int >( string(
",n" ), string(
"Number of elements on a side (default=10)" ), &N );
54 if( NULL ==
mb )
return 1;
60 int rank = 0, nprocs = 1;
61 MPI_Comm_size( MPI_COMM_WORLD, &nprocs );
62 MPI_Comm_rank( MPI_COMM_WORLD, &rank );
63 int ilow = rank * N, ihigh = ilow + N;
66 int ilow = 0, ihigh = N;
73 (
dim > 2 ? 0 : -1 ) ),
74 HomCoord( ihigh, (
dim > 1 ? N : -1 ), (
dim > 2 ? N : -1 ) ), NULL,
86 #define MYSTREAM( a ) \
87 if( !rank ) cout << a << endl
89 if( pow( N,
dim ) == (
int)elems.
size() && pow( N + 1,
dim ) == (
int)verts.
size() )
95 <<
" elements and " << verts.
size() <<
" vertices." << endl );
98 cout <<
"Created the wrong number of vertices or hexes!" << endl;
101 vector< double > coords( 3 * pow( N + 1,
dim ) );
102 vector< EntityHandle > connect;
103 for(
int k = 0; k < (
dim > 2 ? N : 1 ); k++ )
105 for(
int j = 0; j < (
dim > 1 ? N : 1 ); j++ )
107 for(
int i = 0; i < N - 1; i++ )
111 if( 0 == ehandle )
return MB_FAILURE;