From 79395dfed2b0d525cd4321142d8e8a6ffa3e0767 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Mon, 7 Dec 2020 12:55:35 -0700 Subject: [PATCH] Fix a data type issue. --- source/lac/slepc_solver.cc | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/source/lac/slepc_solver.cc b/source/lac/slepc_solver.cc index a65a0962fc..19ec32474a 100644 --- a/source/lac/slepc_solver.cc +++ b/source/lac/slepc_solver.cc @@ -184,9 +184,16 @@ namespace SLEPcWrappers ierr = EPSSolve(eps); AssertThrow(ierr == 0, ExcSLEPcError(ierr)); - // get number of converged eigenstates - ierr = EPSGetConverged(eps, reinterpret_cast(n_converged)); - AssertThrow(ierr == 0, ExcSLEPcError(ierr)); + // Get number of converged eigenstates. We need to go around with a + // temporary variable once because the function wants to have a + // PetscInt as second argument whereas the `n_converged` argument + // to this function is just an unsigned int. + { + PetscInt petsc_n_converged = *n_converged; + ierr = EPSGetConverged(eps, &petsc_n_converged); + AssertThrow(ierr == 0, ExcSLEPcError(ierr)); + *n_converged = petsc_n_converged; + } PetscInt n_iterations = 0; PetscReal residual_norm = 0; -- 2.39.5