← Back to team overview

dolfin team mailing list archive

[Question #149001]: How to obtain factorized matrices

 

New question #149001 on DOLFIN:
https://answers.launchpad.net/dolfin/+question/149001

Hi,

I have to compute the LU-Factorization of a matrix.
I know that with solver = LUSolver(A) and solver.parameters["reuse_factorization"] = True one can tell the solver to reuse the factorization, but how can I obtain the factorized matrices?

Thanks,
Patricia


********************************************************
from dolfin import *
import numpy
from numpy import array
# Optimization options for the form compiler
parameters["form_compiler"]["cpp_optimize"] = True
parameters["form_compiler"]["optimize"] = True
mesh = UnitSquare(64,64)
V0 = FunctionSpace(mesh, "DG", 0)
V2 = FunctionSpace(mesh, "CG", 2)
u = TrialFunction(V2)
v = TestFunction(V2)
a0 = (dot(grad(u),grad(v)) + u*v)*dx + 0.25*(u*v)*ds
f0 = v*dx
A, F = assemble_system(a0,f0)
# Create linear solver and factorize matrix
solver = LUSolver(A)
solver.parameters["reuse_factorization"] = True

-- 
You received this question notification because you are a member of
DOLFIN Team, which is an answer contact for DOLFIN.