72 #define ERROR( rc, msg ) \
75 printf( "error %s", msg ); \
79 int main(
int argc,
char** argv )
81 int my_id, num_procs, ix, iy, numv, nume;
82 int dime, lco, mbtype, blockid, npe;
83 char appname[10] =
"IMTEST";
85 double coordinates[27], deltax, deltay;
86 int ids[9] = { 1, 2, 3, 6, 7, 8, 11, 12, 13 };
87 int connec[16] = { 1, 2, 5, 4, 2, 3, 6, 5, 4, 5, 8, 7, 5, 6, 9, 8 };
89 int dimgh, bridge, num_layers;
90 double coords_core[27] = { 0., 0., 0., 0., 1., 0., 0., 2., 0., 1., 0., 0., 1., 1.,
91 0., 1., 2., 0., 2., 0., 0., 2., 1., 0., 2., 2., 0. };
95 MPI_Init( &argc, &argv );
98 MPI_Comm_size( comm, &num_procs );
99 MPI_Comm_rank( comm, &my_id );
102 ERROR( rc,
"can't initialize" );
103 if( !my_id ) printf(
" I'm process %d out of %d\n", my_id, num_procs );
108 ERROR( rc,
" can't register app" );
110 deltax = ( my_id / 2 ) * 2.;
111 deltay = ( my_id % 2 ) * 2.;
112 ix = ( my_id / 2 ) * 10;
114 for(
int i = 0; i < 9; i++ )
116 coordinates[3 * i] = coords_core[3 * i] + deltax;
117 coordinates[3 * i + 1] = coords_core[3 * i + 1] + deltay;
118 coordinates[3 * i + 2] = coords_core[3 * i + 2];
121 ids[i] = ids[i] + ix + iy;
128 ERROR( rc,
"can't create vertices" );
134 ERROR( rc,
"can't create elements" );
137 ERROR( rc,
"can't resolve shared ents" );
140 ERROR( rc,
"can't update mesh info" );
142 int num_global_verts, num_global_cells;
147 int num_components = 1;
151 ERROR( rc,
"failed to create tags afrac:ifrac " );
152 double af[4] = { 1., 1., 1., 1. };
155 ERROR( rc,
"failed to set tag afrac " );
157 #ifdef MOAB_HAVE_HDF5_PARALLEL
158 char wopts[100] =
"PARALLEL=WRITE_PART";
159 char outfile[32] =
"whole.h5m";
161 ERROR( rc,
"can't write mesh" );
166 ERROR( rc,
"failed to create tags ofrac:afrac:ofrad " );
169 #ifdef MOAB_HAVE_HDF5_PARALLEL
171 ERROR( rc,
"can't write mesh 3\n" );
176 ERROR( rc,
"failed to get tag INTFIELD " );
178 std::vector< int > valstest( numv );
179 for(
int k = 0; k < numv; k++ )
181 valstest[k] = my_id + k;
183 int num_tag_storage_length = numv * num_components;
188 ERROR( rc,
"failed to set tag INTFIELD " );
191 ERROR( rc,
"failed reduce tags max " );
198 ERROR( rc,
"can't determine ghosts" );
201 #ifdef MOAB_HAVE_HDF5_PARALLEL
203 ERROR( rc,
"can't write mesh" );
207 ERROR( rc,
"can't de-register app" );
210 ERROR( rc,
"can't finalize" );