I want to use the slepceigensolver for a matrix from scipy, but i get the following error
PC has not been set up so information may be incomplete
Redundant preconditioner: Not yet setup
Here is my code
if not has_slepc():
raise ValueError('FeNICS has no SLEPC support use scipy strategy')
from petsc4py import PETSc
self.fullA = self.fullA.tocsr()
self.fullE = self.fullE.tocsc()
fullApetsc = PETSc.Mat().createAIJ(size=self.fullA.shape, csr=(self.fullA.indptr, self.fullA.indices, self.fullA.data))
fullEpetsc = PETSc.Mat().createAIJ(size=self.fullE.shape, csr=(self.fullE.indptr, self.fullE.indices, self.fullE.data))
fullApetscdolfin = PETScMatrix(fullApetsc)
fullEpetscdolfin = PETScMatrix(fullEpetsc)
eigensolver = SLEPcEigenSolver(fullApetscdolfin, fullEpetscdolfin)
eigensolver.parameters["spectrum"] = "largest real"
#eigensolver.parameters["solver"] = "subspace"
eigensolver.parameters["tolerance"] = 1e-13
eigensolver.parameters["maximum_iterations"] = 10000
eigensolver.parameters["problem_type"] = "pos_gen_non_hermitian"
eigensolver.parameters["verbose"] = True
# first tow desired eigenvalues
eigensolver.solve(2)
import ipdb
ipdb.set_trace()
a = 2
eigensolver.get_eigenpair(0)
Is it possible to add a preconditioner?
For furhter Information my System comes up from linearized navier stokes equation around a steady state solution.
My fullA Matrix looks like [A,G;G^T,0] and fullE like [M,0;0,0] where M is positive semidefinite.