about the use of LU solver

Asked by Dupront

Hello,

I am using the following command that is called repeatedly in a time loop:

"""
solve( A1, u1.vector(), b1, solver_parameters={"symmetric":True, "linear_solver":"mumps", "reuse_factorization":True})
"""

The matrix A1 is supposed to be constant and I want the factorization to be performed
only one time.

Everything is working but it seems to me that the "reuze_factorization" option has not
been taken into account.
If I print the parameters (info(parameters,True)), I read that the value that this parameter
has is "false". Also the time spent in the method solve is always the same at each time step.
I was expecting a real decrease knowing that the factorization is quite expensive.

Could someboby help me with that ?
Thanks

Question information

Language:
English Edit question
Status:
Answered
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
eduardo rodriguez (edu-ampu4) said :
#1

I'm solving a similar problem and I impose the condition before the loop:

solver=LUSolver(A1)
solver.parameters['reuse_factorization']=True

and then inside the loop:

solver.solve(u1.vector(),b1)

I suppose that you can modify the others parameters before the loop too

Revision history for this message
Dupront (michel-dupront) said :
#2

Thank you very much.

Unfortunately it is not working in my script.
I am still trying to make something work ...

Revision history for this message
Jan Blechta (blechta) said :
#3

info(parameters, True) prints this: parameters['lu_solver']['reuse_factorization'].

But changing solver.parameters['reuse_factorization'] does not change global parameter parameters['lu_solver']['reuse_factorization']. Neither do passing {"reuse_factorization": True} to solver.solve() method.

Conversely a change of parameters['lu_solver']['reuse_factorization'] prior to creating LUSolver instance will be inherited in solver.parameters.

Can you help with this problem?

Provide an answer of your own, or ask Dupront for more information if necessary.

To post a message you must log in.