<div dir="ltr">I just found a user group on PETSc website. Can someone please answer the question below?<div><br></div><div>Thanks!<br><div><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">HeeHo Park</b> <span dir="ltr"><<a href="mailto:heeho.park@gmail.com">heeho.park@gmail.com</a>></span><br>Date: Wed, Feb 14, 2018 at 5:04 PM<br>Subject: what is the equivalent DMDAVecRestoreArray() function in petsc4py?<br>To: <a href="mailto:dalcinl@gmail.com">dalcinl@gmail.com</a><br><br><br><div dir="ltr">Hi Lisandro,<div><br></div><div>I cannot find DMDAVecRestoreArray() equivalent in petsc4py. </div><div>I'm trying to set a 1D initial condition like this.</div><div><br></div><div><div>def initial_conditions(ts, U, appctx):</div><div> da = ts.getDM()</div><div> mstart,xm = da.getCorners()</div><div> mstart = mstart[0]</div><div> xm = xm[0]</div><div> M = da.getSizes()[0]</div><div> h = 1.0/M</div><div> mend = mstart + xm</div><div><br></div><div> u = da.getVecArray(U)</div><div> for i in range(mstart, mend):</div><div> u[i] = np.sin(np.pi*i*6.*h) + 3.*np.sin(np.pi*i*2.*h)</div><div><br></div><div> da.getVecRestoreArray(u)</div></div><div><br></div><div>Also, is there a better way to ask questions about petsc4py? a forum? or google-group?</div><div><br></div><div>Thanks,</div><span class="HOEnZb"><font color="#888888"><div><div><br></div>-- <br><div class="m_-7738558342007574623gmail_signature"><div dir="ltr">HeeHo Daniel Park</div></div>
</div></font></span></div>
</div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">HeeHo Daniel Park</div></div>
</div></div></div>