70 #include "moab/MOABConfig.h"
77 integer ierr, my_id, num_procs, pid, i, ix, iy, numv, nume
78 integer dime, lco, mbtype, blockid, npe
80 character :: appname*10
81 character :: outfile*100, wopts*100
83 double precision coordinates(27) , coords_core(27), deltax, deltay
87 integer dimgh, bridge, num_layers
89 data coords_core/ 0., 0., 0.,
98 data ids/1, 2, 3, 6, 7, 8, 11, 12, 13/
99 data connec/ 1, 2, 5, 4,
104 call mpi_init ( ierr )
105 call errorout(ierr,
'fail to initialize MPI')
107 ierr = imoab_initialize()
108 call errorout(ierr,
'fail to initialize iMOAB')
110 call mpi_comm_rank (mpi_comm_world, my_id, ierr)
111 call errorout(ierr,
'fail to get MPI rank')
113 call mpi_comm_size (mpi_comm_world, num_procs, ierr)
114 call errorout(ierr,
'fail to get MPI size')
117 if (my_id .eq. 0)
then
118 print *,
" I'm process ", my_id,
" out of ",
119 & num_procs,
" processes."
124 appname =
'IMTEST'//char(0)
125 ierr = imoab_registerapplication(appname, mpi_comm_world,
127 call errorout(ierr,
'fail to initialize fortran app')
130 deltax=(my_id/2) * 2.
131 deltay = mod(my_id, 2) * 2.
133 iy = mod(my_id,2) * 2
135 coordinates( 3*(i-1) + 1 ) = coords_core(3*(i-1)+1) + deltax
136 coordinates( 3*(i-1) + 2 ) = coords_core(3*(i-1)+2) + deltay
137 coordinates( 3*(i-1) + 3 ) = coords_core(3*(i-1)+3)
140 ids(i) = ids(i) + ix+iy
146 ierr = imoab_createvertices(pid, lco, dime, coordinates);
147 call errorout(ierr,
'fail to create vertices')
153 ierr = imoab_createelements(pid, nume, mbtype, npe,
155 call errorout(ierr,
'fail to create quads')
157 ierr = imoab_resolvesharedentities( pid, numv, ids );
158 call errorout(ierr,
'fail to resolve shared entities')
164 ierr = imoab_determineghostentities( pid, dimgh, num_layers,
166 call errorout(ierr,
'fail to determine ghosts')
169 #ifdef MOAB_HAVE_HDF5
170 outfile =
'wholeF.h5m'//char(0)
171 wopts =
'PARALLEL=WRITE_PART'//char(0)
172 ierr = imoab_writemesh(pid, outfile, wopts)
173 call errorout(ierr,
'fail to write the mesh file')
177 ierr = imoab_deregisterapplication(pid)
178 call errorout(ierr,
'fail to deregister application')
180 ierr = imoab_finalize()
181 call errorout(ierr,
'fail to finalize iMOAB')
184 call mpi_finalize ( ierr )
185 call errorout(ierr,
'fail to finalize MPI')