This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

User supplied Jacobian versus automatically calculated Jacobian

+1 vote

Will there be a difference in performance between the two ?
Are there situations where I should prefer one over the other ?

asked Aug 30, 2014 by shriram FEniCS User (1,540 points)

1 Answer

+3 votes
 
Best answer

If you supply the true Jacobian (i.e., not an approximation) the performance in both cases should be near identical. There to be some difference if the UFL/FFC optimisation are more able to work with one expression than another, but I would expect any different to be small.

A typical example of where you will want to supply your own Jacobian is where you want to use an approximate linearisation.

answered Sep 2, 2014 by Garth N. Wells FEniCS Expert (35,930 points)
selected Sep 2, 2014 by shriram
...