<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi All,<br>
<br>
I tried to set the simulation domain using DMDA coordinates,
following the example dm/examples/tutorials/ex3.c. The 1D problem
worked fine but the 2D and 3D failed because of the definition in
coors2d and coords3d. What should I use to define the variable
coords2d and coords3d?<br>
<br>
-->Codes section:<br>
<br>
PetscScalar, pointer :: coords1d(:)<br>
<font color="#ff0000">DMDACoor2d, pointer ::
coords2d(:,:) !Failed in compiling<br>
DMDACoor3d, pointer :: coords3d(:,:,:) !Failed in
compiling</font><br>
Vec :: gc<br>
<br>
!1D domain<br>
call DMGetGlobalVector(dmda_flow%da,gc,ierr)<br>
call DMDAVecGetArrayF90(dmda_flow%da,gc,coords1d,ierr)<br>
do ivx = nvxls,nvxle<br>
coords1d(ivx-ibase) = xglat(ivx)<br>
end do<br>
call DMDAVecRestoreArrayF90(dmda_flow%da,gc,coords1d,ierr)<br>
call DMSetCoordinates(dmda_flow%da,gc,ierr)<br>
call DMRestoreGlobalVector(dmda_flow%da,gc,ierr)<br>
<br>
<br>
!2D domain<br>
call DMGetGlobalVector(dmda_flow%da,gc,ierr)<br>
call DMDAVecGetArrayF90(dmda_flow%da,gc,coords2d,ierr)<br>
do ivx = nvxls,nvxle<br>
coords2d(ivx-ibase,ivy-ibase)%x = xglat(ivx)<br>
coords2d(ivx-ibase,ivy-ibase)%y = yglat(ivy)<br>
end do<br>
call DMDAVecRestoreArrayF90(dmda_flow%da,gc,coords2d,ierr)<br>
call DMSetCoordinates(dmda_flow%da,gc,ierr)<br>
call DMRestoreGlobalVector(dmda_flow%da,gc,ierr)<br>
<br>
Thanks and regards,<br>
<br>
Danyang<br>
</body>
</html>