← Back to team overview

dolfin team mailing list archive

Re: Fwd: [Branch ~dolfin-core/dolfin/main] Rev 6347: Fix problem with default values for linear solver and preconditioner,

 

On Thu, Oct 20, 2011 at 02:16:34PM +0100, Garth N. Wells wrote:
> On 20 October 2011 12:36, Anders Logg <logg@xxxxxxxxx> wrote:
> > On Thu, Oct 20, 2011 at 11:46:58AM +0100, Garth N. Wells wrote:
> >> On 20 October 2011 11:28, Anders Logg <logg@xxxxxxxxx> wrote:
> >> > The problem was the newly added check that the preconditioner must be
> >> > set to "none" when a direct method is used. This wasn't checked
> >> > before.
> >> >
> >> > The default values have now been changed (in LinearSolver,
> >> > LinearVariationalSoler and NonlinearVariationalSolver) to
> >> >
> >> >  "default"
> >> >  "none"
> >> >
> >>
> >> Does this mean that a user who selects an iterative solver will, by
> >> default, not employ any preconditioning?
> >
> > Yes.
> >
> > That will be suboptimal. Perhaps we could change the values to
> >
> >  default, default
> >
> > but then we need to check that the backends handle "default" for
> > preconditioners.
> >
> > Can you have a look at LinearSolver.cpp and check the logic?
> >
>
> I would rather roll back to how it was. We can make changes for 1.1.
>
> The change undid changes that we made a long time ago to resolve some
> issues. It may have been suboptimal, but what the recent change seeks
> to address is minor. I don't see the need for a change just before 1.0
> that can have a big impact (looks like tests are now failing). The
> real solution is to carefully re-assess the solver interfaces. An
> option is to treat all solvers as iterative, and make LU a
> preconditioner. This is for post 1.0.

I think it's just a matter of changing a line or two in
LinearSolver.cpp to get things right.

What default options do we want?

LU by default?

And if a Krylov method is used, then ILU preconditioning by default?

--
Anders



> Garth
>
> >
> >
> >> Garth
> >>
> >>
> >>
> >> > This will result in LU being chosen in LinearSolver.cpp.
> >> >
> >> > All the logic for this is in the constructor of LinearSolver.cpp if
> >> > more tuning is needed.
> >> >
> >> >
> >> >
> >> > On Thu, Oct 20, 2011 at 10:22:45AM +0100, Garth N. Wells wrote:
> >> >> What was the problem that has been 'fixed'?
> >> >>
> >> >> Garth
> >> >>
> >> >> ---------- Forwarded message ----------
> >> >> From:  <noreply@xxxxxxxxxxxxx>
> >> >> Date: 20 October 2011 10:11
> >> >> Subject: [Branch ~dolfin-core/dolfin/main] Rev 6347: Fix problem with
> >> >> default values for linear solver and preconditioner,
> >> >> To: Garth Wells <gnw20@xxxxxxxxx>
> >> >>
> >> >>
> >> >> ------------------------------------------------------------
> >> >> revno: 6347
> >> >> committer: Anders Logg <logg@xxxxxxxxx>
> >> >> branch nick: work
> >> >> timestamp: Thu 2011-10-20 11:09:10 +0200
> >> >> message:
> >> >>  Fix problem with default values for linear solver and preconditioner,
> >> >>  now set to "default" and "none".
> >> >> modified:
> >> >>  dolfin/fem/LinearVariationalSolver.h
> >> >>  dolfin/fem/NonlinearVariationalSolver.h
> >> >>  dolfin/la/LinearSolver.h
> >> >>
> >> >>
> >> >
> >> >> === modified file 'dolfin/fem/LinearVariationalSolver.h'
> >> >> --- dolfin/fem/LinearVariationalSolver.h      2011-06-22 10:01:17 +0000
> >> >> +++ dolfin/fem/LinearVariationalSolver.h      2011-10-20 09:09:10 +0000
> >> >> @@ -18,7 +18,7 @@
> >> >>  // Modified by Marie E. Rognes, 2011.
> >> >>  //
> >> >>  // First added:  2011-01-14 (2008-12-26 as VariationalProblem)
> >> >> -// Last changed: 2011-06-22
> >> >> +// Last changed: 2011-10-20
> >> >>
> >> >>  #ifndef __LINEAR_VARIATIONAL_SOLVER_H
> >> >>  #define __LINEAR_VARIATIONAL_SOLVER_H
> >> >> @@ -53,8 +53,8 @@
> >> >>      {
> >> >>        Parameters p("linear_variational_solver");
> >> >>
> >> >> -      p.add("linear_solver", "lu");
> >> >> -      p.add("preconditioner", "default");
> >> >> +      p.add("linear_solver", "default");
> >> >> +      p.add("preconditioner", "none");
> >> >>        p.add("symmetric", false);
> >> >>        p.add("reset_jacobian", true);
> >> >>
> >> >>
> >> >> === modified file 'dolfin/fem/NonlinearVariationalSolver.h'
> >> >> --- dolfin/fem/NonlinearVariationalSolver.h   2011-08-24 22:15:11 +0000
> >> >> +++ dolfin/fem/NonlinearVariationalSolver.h   2011-10-20 09:09:10 +0000
> >> >> @@ -18,7 +18,7 @@
> >> >>  // Modified by Marie E. Rognes, 2011.
> >> >>  //
> >> >>  // First added:  2011-01-14 (2008-12-26 as VariationalProblem.h)
> >> >> -// Last changed: 2011-06-22
> >> >> +// Last changed: 2011-10-20
> >> >>
> >> >>  #ifndef __NONLINEAR_VARIATIONAL_SOLVER_H
> >> >>  #define __NONLINEAR_VARIATIONAL_SOLVER_H
> >> >> @@ -57,8 +57,8 @@
> >> >>      {
> >> >>        Parameters p("nonlinear_variational_solver");
> >> >>
> >> >> -      p.add("linear_solver",  "lu");
> >> >> -      p.add("preconditioner", "default");
> >> >> +      p.add("linear_solver",  "default");
> >> >> +      p.add("preconditioner", "none");
> >> >>        p.add("symmetric", false);
> >> >>        p.add("reset_jacobian", true);
> >> >>
> >> >>
> >> >> === modified file 'dolfin/la/LinearSolver.h'
> >> >> --- dolfin/la/LinearSolver.h  2011-10-07 12:24:30 +0000
> >> >> +++ dolfin/la/LinearSolver.h  2011-10-20 09:09:10 +0000
> >> >> @@ -44,8 +44,8 @@
> >> >>    public:
> >> >>
> >> >>      /// Create linear solver
> >> >> -    LinearSolver(std::string method = "lu",
> >> >> -                 std::string preconditioner = "ilu");
> >> >> +    LinearSolver(std::string method = "default",
> >> >> +                 std::string preconditioner = "none");
> >> >>
> >> >>      /// Destructor
> >> >>      ~LinearSolver();
> >> >>
> >> >
> >> >> _______________________________________________
> >> >> Mailing list: https://launchpad.net/~dolfin
> >> >> Post to     : dolfin@xxxxxxxxxxxxxxxxxxx
> >> >> Unsubscribe : https://launchpad.net/~dolfin
> >> >> More help   : https://help.launchpad.net/ListHelp
> >> >
> >> >
> >
>
>
>


Follow ups

References