Hello Everyone: I am dealing with a eigenvalue problem with SLEPc, but the program reports this error:
[0]PETSC ERROR: --------------------- Error Message -------------------------------------------------------------- [0]PETSC ERROR: Zero pivot in LU factorization: https://petsc.org/release/faq/#zeropivot [0]PETSC ERROR: Zero pivot row 1 value 0. tolerance 2.22045e-14 I have reviewed the documentation. It says that (Frequently Asked Questions (FAQ) — PETSc 3.16.4 documentation <https://petsc.org/release/faq/#zeropivot>) *A zero pivot in LU, ILU, Cholesky, or ICC sparse factorization does not always mean that the matrix is singular. You can use* *-pc_factor_shift_type nonzero -pc_factor_shift_amount [amount] * *or* *-pc_factor_shift_type positive_definite -[level]_pc_factor_shift_type nonzero -pc_factor_shift_amount [amount] * *or* *-[level]_pc_factor_shift_type positive_definite * *to prevent the zero pivot. [level] is “sub” when lu, ilu, cholesky, or icc are employed in each individual block of the bjacobi or ASM preconditioner. [level] is “mg_levels” or “mg_coarse” when lu, ilu, cholesky, or icc are used inside multigrid smoothers or to the coarse grid solver. See PCFactorSetShiftType <https://petsc.org/release/docs/manualpages/PC/PCFactorSetShiftType.html#PCFactorSetShiftType>(), PCFactorSetShiftAmount <https://petsc.org/release/docs/manualpages/PC/PCFactorSetShiftAmount.html#PCFactorSetShiftAmount>().* *This error can also happen if your matrix is singular, see MatSetNullSpace <https://petsc.org/release/docs/manualpages/Mat/MatSetNullSpace.html#MatSetNullSpace>() for how to handle this. If this error occurs in the zeroth row of the matrix, it is likely you have an error in the code that generates the matrix.* So I write the code as follows: *PETScWrappers::PreconditionBlockJacobi::AdditionalData data; PETScWrappers::PreconditionBlockJacobi preconditioner(mpi_communicator, data); SolverControl linear_solver_control (dof_handler.n_dofs(), 1e-9, false, false); PETScWrappers::SolverCG linear_solver(linear_solver_control, mpi_communicator); PCFactorSetShiftType(preconditioner.get_pc(), MAT_SHIFT_NONZERO);// PCFactorSetShiftAmount(preconditioner.get_pc(), 3e-14); linear_solver.initialize(preconditioner); SolverControl solver_control (100, 1e-9,false,false); SLEPcWrappers::SolverKrylovSchur eigensolver(solver_control, mpi_communicator); eigensolver.set_which_eigenpairs(EPS_SMALLEST_REAL); eigensolver.set_problem_type(EPS_GHEP); SLEPcWrappers::TransformationShift spectral_transformation(mpi_communicator); spectral_transformation.set_solver(linear_solver); eigensolver.set_transformation(spectral_transformation); eigensolver.solve(stiffness_matrix, mass_matrix, eigenvalues, eigenfunctions, eigenfunctions.size());* But the error occurs as the same. I don't know how to solve it. Thanks for your help. Best Wishes. -- The deal.II project is located at http://www.dealii.org/ For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en --- You received this message because you are subscribed to the Google Groups "deal.II User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/c7349e82-26bc-4014-a21d-c52311015921n%40googlegroups.com.
