[petsc-users] Dynamically resize the existing PetscVector

Zhang, Junchao jczhang at mcs.anl.gov
Mon Dec 17 15:31:21 CST 2018


Or, you can have your own array and then create PETSc vectors with VecCreateGhostWithArray, so that the memory resizing is managed by yourself.
--Junchao Zhang


On Mon, Dec 17, 2018 at 9:15 AM Shidi Yan via petsc-users <petsc-users at mcs.anl.gov<mailto: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.

Thank you for your time.

Kind Regards,
Shidi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20181217/5f3c178b/attachment.html>


More information about the petsc-users mailing list