From 8149b6154ebbd0f882f63c731e9edaf694d3c957 Mon Sep 17 00:00:00 2001 From: young Date: Tue, 14 May 2013 09:16:39 +0000 Subject: [PATCH] handle SLEPc descriptions. git-svn-id: https://svn.dealii.org/trunk@29506 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/include/deal.II/lac/slepc_solver.h | 17 +++++++++-------- deal.II/source/lac/slepc_solver.cc | 14 +++++++------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/deal.II/include/deal.II/lac/slepc_solver.h b/deal.II/include/deal.II/lac/slepc_solver.h index c3e39aad76..d363702a98 100644 --- a/deal.II/include/deal.II/lac/slepc_solver.h +++ b/deal.II/include/deal.II/lac/slepc_solver.h @@ -76,14 +76,14 @@ DEAL_II_NAMESPACE_OPEN * calling sequence requires calling several of SolverBase functions * rather than just one. This freedom is intended for use of the * SLEPcWrappers that require a greater handle on the eigenvalue - * problem solver context. See also the API of: + * problem solver context. See also the API of, for example: @code template void SolverBase::solve (const PETScWrappers::MatrixBase &A, const PETScWrappers::MatrixBase &B, - std::vector &kr, - std::vector &vr, + std::vector &eigenvalues, + std::vector &eigenvectors, const unsigned int n_eigenpairs) { ... } @endcode @@ -157,7 +157,8 @@ namespace SLEPcWrappers /** * Same as above, but here a composite method for solving the - * system $A x=\lambda B x$. + * system $A x=\lambda B x$, for real matrices, vectors, and + * values $A, B, x, \lambda$. */ template void @@ -169,8 +170,8 @@ namespace SLEPcWrappers /** * Same as above, but here a composite method for solving the - * system $A x=\lambda B x$ with real and imaginary parts to the - * eigenvalues/eigenvectors. + * system $A x=\lambda B x$ with real matrices $A, B$ and + * imaginary eigenpairs $x, \lamda$. */ template void @@ -384,8 +385,8 @@ namespace SLEPcWrappers static int convergence_test (EPS eps, - PetscScalar kr, - PetscScalar ki, + PetscScalar real_eigenvalue, + PetscScalar imag_eigenvalue, PetscReal residual_norm, PetscReal *estimated_error, void *solver_control); diff --git a/deal.II/source/lac/slepc_solver.cc b/deal.II/source/lac/slepc_solver.cc index 2821895dbd..4640a0e50c 100644 --- a/deal.II/source/lac/slepc_solver.cc +++ b/deal.II/source/lac/slepc_solver.cc @@ -186,8 +186,7 @@ namespace SLEPcWrappers // get number of converged eigenstates ierr = EPSGetConverged (solver_data->eps, - reinterpret_cast(n_converged) - ); + reinterpret_cast(n_converged)); AssertThrow (ierr == 0, ExcSLEPcError(ierr)); int n_iterations = 0; @@ -220,14 +219,15 @@ namespace SLEPcWrappers void SolverBase::get_eigenpair (const unsigned int index, - double &kr, - PETScWrappers::VectorBase &vr) + double &eigenvalues, + PETScWrappers::VectorBase &eigenvectors) { AssertThrow (solver_data.get() != 0, ExcSLEPcWrappersUsageError()); // get converged eigenpair int ierr = EPSGetEigenpair (solver_data->eps, index, - &kr, PETSC_NULL, vr, PETSC_NULL); + &eigenvalues, PETSC_NULL, + eigenvectors, PETSC_NULL); AssertThrow (ierr == 0, ExcSLEPcError(ierr)); } @@ -299,8 +299,8 @@ namespace SLEPcWrappers int SolverBase::convergence_test (EPS /*eps */, - PetscScalar /*kr */, - PetscScalar /*ki */, + PetscScalar /*real_eigenvalue */, + PetscScalar /*imag_eigenvalue */, PetscReal /*residual_norm */, PetscReal */*estimated_error */, void */*solver_control_x*/) -- 2.39.5