On Wed, May 26, 2010 at 11:33 PM, Hong Zhang <span dir="ltr"><<a href="mailto:hzhang@mcs.anl.gov">hzhang@mcs.anl.gov</a>></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>
> I am a new user of PETSC and I have a hopefully not too embarassing<br>
> question. I am trying to integrate and timestep the 3D acoustic wave<br>
> equation:<br>
><br>
> u_tt = ( c2 ) * LAPLACIAN( u )<br>
><br>
> Does any of the timestepping operators in PETSc work with a second-order<br>
> derivative with the one above? Normally, I would just expand u_tt as a<br>
> finite difference approximation using Leapfrog (or CN or RK ...) and<br>
> explicitly solve for the u field at timestep n+1. However I would like to<br>
> use the vector-matrix formulation in PETSc -my goal is to be able to solve<br>
> the acoustic wave equation explicitly or implicitly (the user would decide<br>
> 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">
> Thanks,<br>
> Mark<br>
><br>
> --<br>
> Mark Patrick Cheeseman<br>
><br>
> Research Scientist<br>
> KSL (KAUST Supercomputing Laboratory)<br>
> Building 1, Office #126<br>
> King Abdullah University of Science & Technology<br>
> Thuwal 23955-6900<br>
> Kingdom of Saudi Arabia<br>
><br>
> EMAIL : <a href="mailto:mark.cheeseman@kaust.edu.sa">mark.cheeseman@kaust.edu.sa</a><br>
> PHONE : +966 (2) 808 0221 (office)<br>
> +966 (54) 470 1082 (mobile)<br>
> SKYPE : mark.patrick.cheeseman<br>
><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>