From e6c336061811a778da11b15f83e2cec0cb1a3dc4 Mon Sep 17 00:00:00 2001 From: young Date: Sun, 20 Oct 2013 21:26:51 +0000 Subject: [PATCH] Fix SLEPc wrapper to the generic solver. 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 | 4 +++- deal.II/include/deal.II/lac/slepc_solver.h | 12 ++++++------ deal.II/source/lac/slepc_solver.cc | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/deal.II/include/deal.II/lac/petsc_vector_base.h b/deal.II/include/deal.II/lac/petsc_vector_base.h index 9299fa59d1..010b35dc46 100644 --- a/deal.II/include/deal.II/lac/petsc_vector_base.h +++ b/deal.II/include/deal.II/lac/petsc_vector_base.h @@ -1019,8 +1019,10 @@ namespace PETScWrappers const PetscInt petsc_i = index; + PetscScalar cast_value = static_cast (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; diff --git a/deal.II/include/deal.II/lac/slepc_solver.h b/deal.II/include/deal.II/lac/slepc_solver.h index 184164369d..2ce90aa9fb 100644 --- a/deal.II/include/deal.II/lac/slepc_solver.h +++ b/deal.II/include/deal.II/lac/slepc_solver.h @@ -86,7 +86,7 @@ DEAL_II_NAMESPACE_OPEN void SolverBase::solve (const PETScWrappers::MatrixBase &A, const PETScWrappers::MatrixBase &B, - std::vector &eigenvalues, + std::vector &eigenvalues, std::vector &eigenvectors, const unsigned int n_eigenpairs) { ... } @@ -154,7 +154,7 @@ namespace SLEPcWrappers template void solve (const PETScWrappers::MatrixBase &A, - std::vector &eigenvalues, + std::vector &eigenvalues, std::vector &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 &eigenvalues, + std::vector &eigenvalues, std::vector &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 void SolverBase::solve (const PETScWrappers::MatrixBase &A, - std::vector &eigenvalues, + std::vector &eigenvalues, std::vector &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 &eigenvalues, + std::vector &eigenvalues, std::vector &eigenvectors, const unsigned int n_eigenpairs) { diff --git a/deal.II/source/lac/slepc_solver.cc b/deal.II/source/lac/slepc_solver.cc index 6ea1e27454..5eaa92efca 100644 --- a/deal.II/source/lac/slepc_solver.cc +++ b/deal.II/source/lac/slepc_solver.cc @@ -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; } -- 2.39.5