<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div dir="ltr">Or, you can have your own array and then create PETSc vectors with VecCreateGhostWithArray, so that the memory resizing is managed by yourself.
<div>
<div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">
<div dir="ltr">--Junchao Zhang</div>
</div>
</div>
<br>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr">On Mon, Dec 17, 2018 at 9:15 AM Shidi Yan via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Hello,<br>
<br>
I am working on adaptive moving mesh problems. Therefore, the petsc<br>
vector size is constantly changing. <br>
The way I am currently dealing with this change is destroy the petsc vector <br>
first with VecDestroy() and create a new vector with VecCreateGhost().<br>
But I think this is not a really efficient way. So I am wondering if there is<br>
any way to resize the existing PetscVector dynamically. <br>
<br>
Thank you for your time.<br>
<br>
Kind Regards,<br>
Shidi<br>
</blockquote>
</div>
</body>
</html>