<div class="gmail_quote">On Wed, Oct 19, 2011 at 10:54, Blaise Bourdin <span dir="ltr"><<a href="mailto:bourdin@math.lsu.edu">bourdin@math.lsu.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi,<br>
<br>
I am trying to use TS to solve a simple transient problem in an unstructured finite element f90 code.<br>
<br>
1. Section 6.1.1 of the manual refers to a TSSetMatrices function that can be used to set the RHS and LHS matrices, but I can;t find it. Is this section outdated?<br></blockquote><div><br></div><div>Yes, I must have missed this section when updating the documentation.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
2. Since we are using unstructured finite elements, the LHS matrix is not the identity. As far as I understand, we have two possible choices:<br>
- Use a mass lumping approximation of the variational identity matrix (mass matrix), M, and use M^{-1}K for the RHS matrix instead of K.<br></blockquote><div><br></div><div>You can also write this as a special case of the choice below where you use -ksp_type preonly -pc_type jacobi.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
- Use an IMEX method where the implicit matrix is the variational identity M.<br>
Is this right? What is the recommended way?<br></blockquote><div><br></div><div>I would just do this because it's the most flexible. See the user's manual section on IMEX methods. If you are interested in adaptive error control, then you should also check out -ts_type rosw in petsc-dev. In any case, you can write your mass matrix as well as any stiff terms that you want to treat implicitly into TSSetIFunction(), provide an (approximate) Jacobian with TSSetIJacobian(), and put the rest in TSSetRHSFunction(). You can be even more sloppy about it with TSROSW.</div>
<div><br></div><div>Look at src/ts/examples/tutorials/ex22.c (has a Fortran twin, ex22f.F) or ex25.c in petsc-dev.</div><div><br></div></div>