[petsc-users] How to get a duoble array into petsc Vec?

Morlighem, Mathieu (334H-Affiliate) Mathieu.Morlighem at jpl.nasa.gov
Thu May 19 09:50:31 CDT 2011


Try this instead:

for(i=0;i<rows;i++)index[i]=i;
ierr=VecSetValues(petscvector,rows,index,doublearray,INSERT_VALUES); CHKERRQ(ierr);

On May 19, 2011, at 7:18 AM, Dürrwang, Jürgen wrote:

Hi,

I am trying to put data form a double c array to an petsc vector. I tried to loop over each element like this petsc Vec[i] = double array[i], but I need a cast for that….has anybody an idea?

Thanks Jürgen


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110519/26c424d2/attachment.htm>


More information about the petsc-users mailing list