From d0b1d2a22d576aef7149a5fd7f6441b287945f11 Mon Sep 17 00:00:00 2001 From: kronbichler Date: Mon, 13 Oct 2008 13:32:18 +0000 Subject: [PATCH] Changed interface in Trilinos block solver to the one in the Trilinos solver (non-block) class. git-svn-id: https://svn.dealii.org/trunk@17192 0785d39b-7218-0410-832d-ea1e28bc413d --- .../lac/include/lac/trilinos_solver_block.h | 44 ++++++++++++------- deal.II/lac/source/trilinos_solver_block.cc | 13 +++++- 2 files changed, 40 insertions(+), 17 deletions(-) diff --git a/deal.II/lac/include/lac/trilinos_solver_block.h b/deal.II/lac/include/lac/trilinos_solver_block.h index 5b13a870e3..8cd2d6d9c5 100644 --- a/deal.II/lac/include/lac/trilinos_solver_block.h +++ b/deal.II/lac/include/lac/trilinos_solver_block.h @@ -48,6 +48,22 @@ namespace TrilinosWrappers { public: + /** + * Enumeration object that is + * set in the constructor of + * the derived classes and + * tells Trilinos which solver + * to use. This option can also + * be set in the user program, + * so one might use this base + * class instead of one of the + * specialized derived classes + * when the solver should be + * set at runtime. Currently + * enabled options are: + */ + enum SolverBlockName {cg, gmres} solver_name; + /** * Standardized data struct to * pipe additional data to the @@ -92,12 +108,21 @@ namespace TrilinosWrappers /** * Constructor. Takes the * solver control object and - * the MPI communicator over - * which parallel computations - * are to happen. + * creates the solver. */ SolverBlockBase (SolverControl &cn); - + + /** + * Second constructor. This + * constructor takes an enum + * object that specifies the + * solver name and sets the + * appropriate Krylov + * method. + */ + SolverBlockBase (const enum SolverBlockName solver_name, + SolverControl &cn); + /** * Destructor. */ @@ -190,17 +215,6 @@ namespace TrilinosWrappers */ SolverControl &solver_control; - /** - * String object that is set in - * the constructor of the - * derived classes and tells - * Trilinos which solver to - * use. Currently enabled - * options are "cg", - * "gmres". - */ - enum SolverBlockName {cg, gmres} solver_name; - protected: /** diff --git a/deal.II/lac/source/trilinos_solver_block.cc b/deal.II/lac/source/trilinos_solver_block.cc index 122ef6ea75..5021328f0d 100644 --- a/deal.II/lac/source/trilinos_solver_block.cc +++ b/deal.II/lac/source/trilinos_solver_block.cc @@ -60,8 +60,17 @@ namespace TrilinosWrappers SolverBlockBase::SolverBlockBase (SolverControl &cn) : - solver_control (cn), - solver_name (gmres) + solver_name (gmres), + solver_control (cn) + {} + + + + SolverBlockBase::SolverBlockBase (SolverBlockBase::SolverBlockName solver_name, + SolverControl &cn) + : + solver_name (solver_name), + solver_control (cn) {} -- 2.39.5