[petsc-users] Copying to Vec with boundary cells

Adrian Croucher a.croucher at auckland.ac.nz
Wed Jul 17 18:47:55 CDT 2019


Actually it looks like a simple VecCopy() works in this situation.

It checks the local sizes of the two vectors, and decides they are still 
the same, so is happy to do the copy.

- Adrian

On 18/07/19 10:31 AM, Adrian Croucher wrote:
> hi
>
> I have a Vec created on a distributed DMPlex (using 
> DMCreateGlobalVector() or DMCreateLocalVector()).
>
> I then add FV boundary condition cells to the DMPlex, using 
> DMPlexConstructGhostCells().
>
> I can then create a new Vec on the new DM. What is the best way to 
> copy the values from the old Vec to the new one?
>
> Regards, Adrian
>
-- 
Dr Adrian Croucher
Senior Research Fellow
Department of Engineering Science
University of Auckland, New Zealand
email: a.croucher at auckland.ac.nz
tel: +64 (0)9 923 4611



More information about the petsc-users mailing list