<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Sat, Dec 22, 2018 at 1:18 PM Sajid Ali 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"><div dir="ltr"><div>Hi, <br><br></div>I have a few questions about ex13 from TS explaining how to solve the following PDE in 2D :<pre width="80"><font color="#B22222">u_t = uxx + uyy</font></pre>

<div><div>1) Can I get a reference/explanation for how the RHSJacobian function is derived ?<br></div></div></div></blockquote><div><br></div><div>Its Finite Differences, so maybe the Strikwerda book?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div></div><div>2) If the problem is linear, why is<a name="m_-6140302565210628055_line147"> TSSetProblemType never set to TS_LINEAR?<br></a></div></div></div></blockquote><div><br></div><div>That is the default.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><a name="m_-6140302565210628055_line147"></a></div><div>3) Since this is just a 2D version of ex3, can't this be set up by only providing a function for the evaluation for TSSetRHSJacobian with the TSSetRHSFunction set to TSComputeRHSFunctionLinear ? </div></div></div></blockquote><div><br></div><div>It could. This way, we could do a nonlinear perturbation if we wanted.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div>If this is the case and a matrix could be written that equivalently states the problem as u_t = A(t)*u, then how would one make such a matrix A(t) ? (In essence, what I'm asking is how does petsc define 2D vectors. Would A(t) be the familiar block tridiagonal matrix ?)</div></div></div></blockquote><div><br></div><div>This uses a DMDA, so it has that numbering.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div>4) In lines 153/154, why does the outer loop iterate over columns and the inner loop iterate over rows? Does this again have something to do with how petsc stores 2d vectors?</div></div></div></blockquote><div><br></div><div>PETSc does not prescribe how you store them. We choose to do it this way because it matched BLAS.</div><div><br></div><div>  Thanks,</div><div><br></div><div>    Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div>Thank You,<br></div><div><div dir="ltr" class="gmail-m_-6140302565210628055gmail_signature"><div dir="ltr"><div style="font-size:12.8px">Sajid Ali<br></div><div style="font-size:12.8px">Applied Physics<br></div><div style="font-size:12.8px">Northwestern University</div></div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>