]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix a data type issue. 11336/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Mon, 7 Dec 2020 19:55:35 +0000 (12:55 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Mon, 7 Dec 2020 19:55:35 +0000 (12:55 -0700)
source/lac/slepc_solver.cc

index a65a0962fc1bc75d1bf7e3e0402ede2d44ee384e..19ec32474abdeb22e3ff7977636ca68e2c7b6dfa 100644 (file)
@@ -184,9 +184,16 @@ namespace SLEPcWrappers
     ierr = EPSSolve(eps);
     AssertThrow(ierr == 0, ExcSLEPcError(ierr));
 
-    // get number of converged eigenstates
-    ierr = EPSGetConverged(eps, reinterpret_cast<PetscInt *>(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;

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.