From f168cc07e83fde49705a331d23bf97ebbe963d9e Mon Sep 17 00:00:00 2001 From: guido Date: Tue, 7 Oct 2003 15:06:24 +0000 Subject: [PATCH] FGMRES in SolverSelector git-svn-id: https://svn.dealii.org/trunk@8086 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/include/lac/solver_gmres.h | 9 ++++++-- deal.II/lac/include/lac/solver_selector.h | 28 ++++++++++++++++++++++- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/deal.II/lac/include/lac/solver_gmres.h b/deal.II/lac/include/lac/solver_gmres.h index ffa77bc04c..66768916c4 100644 --- a/deal.II/lac/include/lac/solver_gmres.h +++ b/deal.II/lac/include/lac/solver_gmres.h @@ -301,6 +301,11 @@ class SolverGMRES : public Solver * * FGMRES needs two vectors in each iteration steps yielding a total * of @p{2*AdditionalData::max_basis_size+1} auxiliary vectors. + * + * Caveat: documentation of this class is not up to date. There are + * also a few parameters of GMRES we would like to introduce here. + * + * @author Guido Kanschat, 2003 */ template > class SolverFGMRES : public Solver @@ -818,8 +823,8 @@ SolverFGMRES::solve ( // Generate an object where basis // vectors are stored. - typename SolverGMRES::TmpVectors v (basis_size, this->memory); - typename SolverGMRES::TmpVectors z (basis_size, this->memory); + typename internal::SolverGMRES::TmpVectors v (basis_size, this->memory); + typename internal::SolverGMRES::TmpVectors z (basis_size, this->memory); // number of the present iteration; this // number is not reset to zero upon a diff --git a/deal.II/lac/include/lac/solver_selector.h b/deal.II/lac/include/lac/solver_selector.h index 298b4c0dc3..52775c6f19 100644 --- a/deal.II/lac/include/lac/solver_selector.h +++ b/deal.II/lac/include/lac/solver_selector.h @@ -147,6 +147,13 @@ class SolverSelector : public Subscriptor * info see the @p{Solver} class. */ void set_data(const typename SolverGMRES + ::AdditionalData &data); + + /** + * Set the additional data. For more + * info see the @p{Solver} class. + */ + void set_data(const typename SolverFGMRES ::AdditionalData &data); /** @@ -202,6 +209,11 @@ class SolverSelector : public Subscriptor * Stores the additional data. */ typename SolverGMRES::AdditionalData gmres_data; + + /** + * Stores the additional data. + */ + typename SolverFGMRES::AdditionalData fgmres_data; }; /*@}*/ @@ -255,6 +267,12 @@ SolverSelector::solve(const Matrix &A, gmres_data); solver.solve(A,x,b,precond); } + else if (solver_name=="fgmres") + { + SolverFGMRES solver(*control,*vector_memory, + fgmres_data); + solver.solve(A,x,b,precond); + } else Assert(false,ExcSolverDoesNotExist(solver_name)); } @@ -263,7 +281,7 @@ SolverSelector::solve(const Matrix &A, template std::string SolverSelector::get_solver_names() { - return "richardson|cg|bicgstab|gmres"; + return "richardson|cg|bicgstab|gmres|fgmres"; } @@ -275,6 +293,14 @@ void SolverSelector::set_data( } +template +void SolverSelector::set_data( + const typename SolverFGMRES::AdditionalData &data) +{ + fgmres_data=data; +} + + template void SolverSelector::set_data( const typename SolverRichardson::AdditionalData &data) -- 2.39.5