On Jul 10, 2012, at 11:29 AM, Jed Brown wrote:

> On Tue, Jul 10, 2012 at 1:22 PM, TAY wee-beng <zonexo at gmail.com> wrote:
> Do you mean DMDAVecGetArrayDOFF90 ? I tried to compile but it gives the error 
> during linking:
> 
> 1>dm_test2d.obj : error LNK2019: unresolved external symbol 
> DMDAVECGETARRAYDOFF90 referenced in function MAIN__
> 
> Matt was suggesting that someone should implement this function, it doesn't 
> exist currently.
> 
> Fortran makes this stuff really painful and we don't know how to make it do 
> something reasonable without depending on your types. You can write your own 
> DMDAVecGetArrayF90WithYourType(), but sadly, it requires some circus tricks 
> to make work. (We can't put this in PETSc because we don't know what your 
> field type is.)
>  
> 

In my Fortran code, I simply use VecGetArrayF90 on a vector created with, for 
example, DMGetGlobalVector, and it
works perfectly fine for DOF>1. You might want to look at this example:

http://www.mcs.anl.gov/petsc/petsc-current/src/snes/examples/tutorials/ex5f90.F.html

Note that for DOF> 1, the indexing is like vec(3,xs:xe,ys:ye,zs:ze) for 
example..


Randy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120710/06712985/attachment.html>

Reply via email to