]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix SLEPc wrapper to the generic solver.
authoryoung <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 20 Oct 2013 21:26:51 +0000 (21:26 +0000)
committeryoung <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 20 Oct 2013 21:26:51 +0000 (21:26 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_petscscalar_complex@31355 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/lac/petsc_vector_base.h
deal.II/include/deal.II/lac/slepc_solver.h
deal.II/source/lac/slepc_solver.cc

index 9299fa59d16f24cc55e151b8030424bae62fb966..010b35dc46fc5cdfa4d236c943324b61f9e3f092 100644 (file)
@@ -1019,8 +1019,10 @@ namespace PETScWrappers
 
       const PetscInt petsc_i = index;
 
+      PetscScalar cast_value = static_cast<PetscScalar> (value);
+
       const int ierr
-        = VecSetValues (vector, 1, &petsc_i, &value, INSERT_VALUES);
+        = VecSetValues (vector, 1, &petsc_i, &cast_value, INSERT_VALUES);
       AssertThrow (ierr == 0, ExcPETScError(ierr));
 
       vector.last_action = VectorOperation::insert;
index 184164369d794c371cb022e67135726dac6d5b9e..2ce90aa9fbc237fc9a2cdc89235d60ae146305fe 100644 (file)
@@ -86,7 +86,7 @@ DEAL_II_NAMESPACE_OPEN
   void
   SolverBase::solve (const PETScWrappers::MatrixBase &A,
                      const PETScWrappers::MatrixBase &B,
-                     std::vector<double>             &eigenvalues,
+                     std::vector<PetscScalar>        &eigenvalues,
                      std::vector<OutputVector>       &eigenvectors,
                      const unsigned int               n_eigenpairs)
   { ... }
@@ -154,7 +154,7 @@ namespace SLEPcWrappers
     template <typename OutputVector>
     void
     solve (const PETScWrappers::MatrixBase &A,
-           std::vector<double>             &eigenvalues,
+           std::vector<PetscScalar>        &eigenvalues,
            std::vector<OutputVector>       &eigenvectors,
            const unsigned int               n_eigenpairs = 1);
 
@@ -167,7 +167,7 @@ namespace SLEPcWrappers
     void
     solve (const PETScWrappers::MatrixBase &A,
            const PETScWrappers::MatrixBase &B,
-           std::vector<double>             &eigenvalues,
+           std::vector<PetscScalar>        &eigenvalues,
            std::vector<OutputVector>       &eigenvectors,
            const unsigned int               n_eigenpairs = 1);
 
@@ -204,7 +204,7 @@ namespace SLEPcWrappers
      * default, no target is set.
      */
     void
-    set_target_eigenvalue (const double &this_target);
+    set_target_eigenvalue (const PetscScalar &this_target);
 
     /**
      * Indicate which part of the spectrum is to be computed. By
@@ -748,7 +748,7 @@ namespace SLEPcWrappers
   template <typename OutputVector>
   void
   SolverBase::solve (const PETScWrappers::MatrixBase &A,
-                     std::vector<double>             &eigenvalues,
+                     std::vector<PetscScalar>        &eigenvalues,
                      std::vector<OutputVector>       &eigenvectors,
                      const unsigned int               n_eigenpairs)
   {
@@ -780,7 +780,7 @@ namespace SLEPcWrappers
   void
   SolverBase::solve (const PETScWrappers::MatrixBase &A,
                      const PETScWrappers::MatrixBase &B,
-                     std::vector<double>             &eigenvalues,
+                     std::vector<PetscScalar>        &eigenvalues,
                      std::vector<OutputVector>       &eigenvectors,
                      const unsigned int                  n_eigenpairs)
   {
index 6ea1e27454f43ac1c3e7664d48d6cfa9b5a96f13..5eaa92efcaf4cbed1b8ce6dea0b0171c8e0f84b9 100644 (file)
@@ -92,7 +92,7 @@ namespace SLEPcWrappers
   }
 
   void
-  SolverBase::set_target_eigenvalue (const double &this_target)
+  SolverBase::set_target_eigenvalue (const PetscScalar &this_target)
   {
     target_eigenvalue = this_target;
   }

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.