[petsc-users] How can I update a global application vector with local petsc results?

Klaus Burkart k_burkart at yahoo.com
Sun Dec 2 05:13:41 CST 2018


Hello,

I use the following routine to transfer the petsc result back to my application which works fine using one core as the local parts of the linear system == global parts: 

    VecGetArray(petsc_x, &array);
    for (i=rstart; i < rend; ++i) { 
        application_x[i] = array[i];
    }
    VecRestoreArray(petsc_x, &array);

As this updates only the local portion of x on each core but nowhere the entire/global application_x vector, multicore simulations don't work correctly.

How can I update the entire/global application_x vector with all local parts on all cores?

Klaus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20181202/2948ccb9/attachment-0001.html>


More information about the petsc-users mailing list