197 use,
intrinsic :: iso_c_binding
204 real(C_DOUBLE),
pointer :: coords(:,:)
205 TYPE(C_PTR) tmp_ents_ptr, stat_ptr
206 ibase_entityhandle,
pointer :: connect(:), tmp_ents(:)
207 integer nverts, tmp_size, stat_size, i
212 nverts = 2*(nquads+1)
213 allocate(coords(0:2, 0:nverts-1))
218 coords(1,2*i+1) = 1.0
220 coords(2,2*i+1) = 0.0
223 coords(0, nverts-2) = nquads
224 coords(0, nverts-1) = nquads
225 coords(1, nverts-2) = 0.0
226 coords(1, nverts-1) = 1.0
227 coords(2, nverts-2) = 0.0
228 coords(2, nverts-1) = 0.0
231 call imesh_createvtxarr(%val(imesh), %val(nverts), %val(ibase_interleaved), &
232 coords, %val(3*nverts), tmp_ents_ptr, tmp_size, tmp_size, ierr)
234 call c_f_pointer(tmp_ents_ptr, tmp_ents, [nverts])
236 allocate(connect(0:4*nquads-1))
238 connect(4*i+0) = tmp_ents(1+2*i)
239 connect(4*i+1) = tmp_ents(1+2*i+2)
240 connect(4*i+2) = tmp_ents(1+2*i+3)
241 connect(4*i+3) = tmp_ents(1+2*i+1)
244 stat_ptr = c_null_ptr
247 call imesh_createentarr(%val(imesh), %val(imesh_quadrilateral), connect, %val(4*nquads), &
248 tmp_ents_ptr, tmp_size, tmp_size, stat_ptr, stat_size, stat_size, ierr)
253 call imesh_freememory(%val(imesh), tmp_ents_ptr)
254 call imesh_freememory(%val(imesh), stat_ptr)