[petsc-users] Dynamically resize the existing PetscVector

Smith, Barry F. bsmith at mcs.anl.gov
Mon Dec 17 16:11:22 CST 2018


  Creating PETSc objects is light weight compared to the numerical operations so I'd be very surprised if that code took even a measurable amount of time.

   Barry


> On Dec 17, 2018, at 9: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. 
> 
> Thank you for your time.
> 
> Kind Regards,
> Shidi



More information about the petsc-users mailing list