[petsc-users] Questions on setting value through VecGetArrayF90
Jed Brown
jedbrown at mcs.anl.gov
Tue Aug 13 13:14:45 CDT 2013
Danyang Su <danyang.su at gmail.com> writes:
> Hi All,
>
> I have the following codes, it can be compiled but it always throw out
> error when running. I also tried the example ex44f.F90, it although
> throw out similar error.
>
> call
> DMDAGetInfo(da,PETSC_NULL_INTEGER,mx,PETSC_NULL_INTEGER, &
> PETSC_NULL_INTEGER,PETSC_NULL_INTEGER,PETSC_NULL_INTEGER, &
> PETSC_NULL_INTEGER,PETSC_NULL_INTEGER,PETSC_NULL_INTEGER, &
> PETSC_NULL_INTEGER,PETSC_NULL_INTEGER,PETSC_NULL_INTEGER, &
> PETSC_NULL_INTEGER,ierr)
> call
> DMDAGetCorners(da,xs,PETSC_NULL_INTEGER,PETSC_NULL_INTEGER, &
> xm,PETSC_NULL_INTEGER,PETSC_NULL_INTEGER,ierr)
> call VecGetArrayF90(b,vecpointer,ierr)
> do i = xs, xs+xm-1
> *vecpointer(i)=b_in(i+1) !!!Error here*
If you want to use global indices like this, you need
DMDAVecGetArrayF90. See src/dm/examples/tutorials/ex11f90.F and
src/snes/examples/tutorials/ex5f90.F for two ways to do this.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20130813/50aba9b6/attachment.pgp>
More information about the petsc-users
mailing list