On Wed, May 26, 2010 at 11:33 PM, Hong Zhang <span dir="ltr">&lt;<a href="mailto:hzhang@mcs.anl.gov">hzhang@mcs.anl.gov</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Mark:<br>
<br>
You need convert your equation into 1st order ODEs and use petsc<br>
TS method (see examples under ~petsc/src/ts/examples/ ),<br>
or use petsc KSP/SNES method with your own time step control.<br>
<font color="#888888"><br>
Hong<br>
</font><div><div></div><div class="h5"><br>
&gt; I am a new user of PETSC and I have a hopefully not too embarassing<br>
&gt; question.  I am trying to integrate and timestep the 3D acoustic wave<br>
&gt; equation:<br>
&gt;<br>
&gt; u_tt = ( c2 ) * LAPLACIAN( u )<br>
&gt;<br>
&gt; Does any of the timestepping operators in PETSc work with a second-order<br>
&gt; derivative with the one above?  Normally, I would just expand u_tt as a<br>
&gt; finite difference approximation using Leapfrog (or CN or RK ...) and<br>
&gt; explicitly solve for the u field at timestep n+1.  However I would like to<br>
&gt; use the vector-matrix formulation in PETSc -my goal is to be able to solve<br>
&gt; the acoustic wave equation explicitly or implicitly (the user would decide<br>
&gt; with a command-line option).<br><br></div></div></blockquote><div><br></div><div>It sounds like you could formulate it to solve for timestep n+1, and then the RHS</div><div>would depend on timestep n (which PETSc would give you), and timestep n-1. You</div>
<div>could save t^{n-1} yourself with a custom Monitor and get it in your RHS function</div><div>through the user context.</div><div><br></div><div>   Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div class="h5">
&gt; Thanks,<br>
&gt; Mark<br>
&gt;<br>
&gt; --<br>
&gt; Mark Patrick Cheeseman<br>
&gt;<br>
&gt; Research Scientist<br>
&gt; KSL (KAUST Supercomputing Laboratory)<br>
&gt; Building 1, Office #126<br>
&gt; King Abdullah University of Science &amp; Technology<br>
&gt; Thuwal 23955-6900<br>
&gt; Kingdom of Saudi Arabia<br>
&gt;<br>
&gt; EMAIL   : <a href="mailto:mark.cheeseman@kaust.edu.sa">mark.cheeseman@kaust.edu.sa</a><br>
&gt; PHONE : +966   (2) 808 0221 (office)<br>
&gt;               +966 (54) 470 1082 (mobile)<br>
&gt; SKYPE : mark.patrick.cheeseman<br>
&gt;<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>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<br>