From: Wolfgang Bangerth Date: Mon, 7 Dec 2020 19:55:35 +0000 (-0700) Subject: Fix a data type issue. X-Git-Tag: v9.3.0-rc1~789^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79395dfed2b0d525cd4321142d8e8a6ffa3e0767;p=dealii.git Fix a data type issue. --- 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;