Re: Jacobian of a DiffusionTerm

2014-02-20 Thread Daniel Wheeler
On Wed, Feb 19, 2014 at 8:10 PM, Caleb Hattingh wrote: > On 20 February 2014 01:48, Daniel Wheeler wrote: > Thank you very much for your time. Thanks for all the feedback and good luck with your work. -- Daniel Wheeler ___ fipy mailing list fipy@nis

Re: Jacobian of a DiffusionTerm

2014-02-19 Thread Caleb Hattingh
On 20 February 2014 01:48, Daniel Wheeler wrote: > It depends on the boundary condition. If you have natural boundary > conditions, the values should be -1, but with fixed value, the values > are -3. This is because the distance to the edge is dx / 2. > Perfect, I checked the math and that works

Re: Jacobian of a DiffusionTerm

2014-02-19 Thread Daniel Wheeler
On Tue, Feb 18, 2014 at 6:04 PM, Caleb Hattingh wrote: > On 19 February 2014 02:25, Daniel Wheeler wrote: > And this continues all the way down into the bottom right-hand > corner such that J[nx,nx] * dx^2 is again -3. I found this by using > perturbation (forward differencing) to calculate th

Re: Jacobian of a DiffusionTerm

2014-02-18 Thread Caleb Hattingh
On 19 February 2014 02:25, Daniel Wheeler wrote: > The difficulty is of course that the > coefficients are functions of the variables so this would have to be > automated somehow, probably with sympy. > Many thanks for taking the time to respond. I've thought about it a little more. Say your e

Re: Jacobian of a DiffusionTerm

2014-02-18 Thread Daniel Wheeler
On Sun, Feb 16, 2014 at 11:50 PM, Caleb Hattingh 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 dif

Jacobian of a DiffusionTerm

2014-02-16 Thread Caleb Hattingh
Given a typical DiffustionTerm(coeff=D), and typical CellVariable phi, is there an easy way to obtain the Jacobian of such a system? In other words, the matrix of derivatives of all the residuals over all the cell variables. Obviously this will be quite sparse. I am using justResidualVector() to