[petsc-users] Dynamically resize the existing PetscVector

Matthew Knepley knepley at gmail.com
Mon Dec 17 13:08:26 CST 2018


On Mon, Dec 17, 2018 at 10:14 AM Shidi Yan via petsc-users <
petsc-users at mcs.anl.gov> wrote:

> Hello,
>
> I am working on adaptive moving mesh problems. Therefore, the petsc
> vector size is constantly changing.
> The way I am currently dealing with this change is destroy the petsc
> vector
> first with VecDestroy() and create a new vector with VecCreateGhost().
> But I think this is not a really efficient way. So I am wondering if there
> is
> any way to resize the existing PetscVector dynamically.
>

That is the most efficient way to do it. If you have measurable performance
degradation (I think
this is unlikely), we could look into memory pooling for the allocation.

  Thanks,

    Matt


> Thank you for your time.
>
> Kind Regards,
> Shidi
>


-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20181217/44a472f7/attachment.html>


More information about the petsc-users mailing list