HeeHo Park writes:
> Yes, this works.
>
> u = da.getVecArray(U)
> for i in range(mstart, mend):
> u[i] = np.sin(np.pi*i*6.*h) + 3.*np.sin(np.pi*i*2.*h)
>
> The code above also worked without restoreVecArray. I guess the u just
> points at the array U.
It won't be
Yes, this works.
u = da.getVecArray(U)
for i in range(mstart, mend):
u[i] = np.sin(np.pi*i*6.*h) + 3.*np.sin(np.pi*i*2.*h)
The code above also worked without restoreVecArray. I guess the u just
points at the array U.
I think your code is clearer to understand what is happening.
Thank
On Wed, Feb 14, 2018 at 6:05 PM, HeeHo Park wrote:
> I just found a user group on PETSc website. Can someone please answer the
> question below?
>
I think it will work using
with da.getVecArray(U) as u
for i in range(mstart, mend):
u[i] =
I just found a user group on PETSc website. Can someone please answer the
question below?
Thanks!
-- Forwarded message --
From: HeeHo Park
Date: Wed, Feb 14, 2018 at 5:04 PM
Subject: what is the equivalent DMDAVecRestoreArray() function in petsc4py?
To: