On Sun, Feb 16, 2014 at 11:50 PM, Caleb Hattingh
<caleb.hatti...@gmail.com> wrote:
> Given a typical DiffustionTerm(coeff=D), and typical CellVariable phi, is
> there an easy way to obtain the Jacobian of such a system?

This is a good question. It would be really nice if FiPy could do
this, but it can't at present. The difficulty is of course that the
coefficients are functions of the variables so this would have to be
automated somehow, probably with sympy.

However, if you know your equation, say it is

   eqn = TransientTerm() == DiffusionTerm(phi**2)

for example and you are solving for "phi", then the "correction
equation" for a Newton step would be

  eqnCorr = TransientTerm() == DiffustionTerm(phi**2) +
ConvectionTerm(2 * delta_phi * phi) + R

where R is the residual calculated from "eqn" and you are now solving
for "delta_phi", the correction to "phi". I don't have any working
code to show you on this, but I know that others have used FiPy in
this way.

If you just want the numerical Jacobian, I would guess that Trilinos
can do this.

-- 
Daniel Wheeler
_______________________________________________
fipy mailing list
fipy@nist.gov
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]

Reply via email to