From: Guido Kanschat Date: Fri, 2 Jul 2010 16:22:12 +0000 (+0000) Subject: fix problems with solver selector X-Git-Tag: v8.0.0~5858 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5d1471d3519427bbc84275f9013b30bf606acdc8;p=dealii.git fix problems with solver selector git-svn-id: https://svn.dealii.org/trunk@21445 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/include/lac/solver_control.h b/deal.II/lac/include/lac/solver_control.h index 70a8832bf0..12a1a7694d 100644 --- a/deal.II/lac/include/lac/solver_control.h +++ b/deal.II/lac/include/lac/solver_control.h @@ -473,6 +473,15 @@ class ReductionControl : public SolverControl const bool log_history = false, const bool log_result = true); + /** + * Initialize with a + * SolverControl object. The + * result will emulate + * SolverControl by setting + * #reduce to zero. + */ + ReductionControl(const SolverControl& c); + /** * Assign a SolverControl object * to ReductionControl. The @@ -625,16 +634,6 @@ SolverControl::log_result () const } -inline -ReductionControl& -ReductionControl::operator= (const SolverControl& c) -{ - SolverControl::operator=(c); - set_reduction(0.); - return *this; -} - - inline double ReductionControl::reduction () const { diff --git a/deal.II/lac/include/lac/solver_selector.h b/deal.II/lac/include/lac/solver_selector.h index 9459a8cb33..cb5ad94fb3 100644 --- a/deal.II/lac/include/lac/solver_selector.h +++ b/deal.II/lac/include/lac/solver_selector.h @@ -255,8 +255,8 @@ template SolverSelector::SolverSelector(const std::string &solver_name, SolverControl &control, VectorMemory &) : - solver_name(solver_name), - control(control) + control(control), + solver_name(solver_name) {} diff --git a/deal.II/lac/source/solver_control.cc b/deal.II/lac/source/solver_control.cc index 9b873e632f..1e7d18deb8 100644 --- a/deal.II/lac/source/solver_control.cc +++ b/deal.II/lac/source/solver_control.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006 by the deal.II authors +// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2010 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -266,6 +266,23 @@ ReductionControl::ReductionControl(const unsigned int n, {} +ReductionControl::ReductionControl (const SolverControl& c) + : + SolverControl(c) +{ + set_reduction(0.); +} + + +ReductionControl& +ReductionControl::operator= (const SolverControl& c) +{ + SolverControl::operator=(c); + set_reduction(0.); + return *this; +} + + ReductionControl::~ReductionControl() {}