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

Store and re-use LU factorization

+1 vote

Hi,

I have to solve the same PDE several times with only the right-hand side changing. Is there a way to compute and store the LU factorization of a fenics matrix?

I was looking at PETScLUSolver but I couldn't find an appropriate command.

Thanks,

Ben

closed with the note: The answer is correct
asked Oct 24, 2014 by BC FEniCS Novice (790 points)
closed Oct 27, 2014 by BC

1 Answer

+2 votes
 
Best answer

Hi, this is controlled by parameters of your solver

solver = LUSolver(A)
solver.parameters['reuse_factorization'] = True 
answered Oct 25, 2014 by MiroK FEniCS Expert (80,920 points)
selected Oct 27, 2014 by BC

Really elegant. Great answer and a great feature.

...