Hi, I want to make use of PETsCLUSolver, and I found some reference code from older version of fenics by doing
Ainv = PETsCLUSolver()
Ainv.set_operator(A)
in which A is a la.Matrix object. However I realised in the new version of fenics, set_operator() is no longer defined. One post I read says to do the following instead
Ainv = PETsCLUSolver(A)
However I get the error that PETsCMatrix object need to be supplied, while A is a la.Matrix.
Is there any easy ways to conver the la.Matrix to PETsCMatrix?
self.Ainv = PETScLUSolver(A)
TypeError: __init__(): incompatible constructor arguments. The following argument types are supported:
1. dolfin.cpp.la.PETScLUSolver(method: str='default')
2. dolfin.cpp.la.PETScLUSolver(comm: MPICommWrapper, method: str='default')
3. dolfin.cpp.la.PETScLUSolver(comm: MPICommWrapper, A: dolfin.cpp.la.PETScMatrix, method: str='default')
4. dolfin.cpp.la.PETScLUSolver(A: dolfin.cpp.la.PETScMatrix, method: str='default')
Invoked with: <dolfin.cpp.la.Matrix object at 0x7fba5d393308>