← Back to team overview

dolfin team mailing list archive

Re: [HG] Fix check for Hypre in KrylovSolver.

 

On Thu, Mar 16, 2006 at 10:50:22AM +0100, Garth N. Wells wrote:
> On Thu, 2006-03-16 at 01:44 +0100, Garth N. Wells wrote:
> > On Wed, 2006-03-15 at 21:23 +0100, DOLFIN wrote:
> > > One or more new changesets pushed to the primary DOLFIN repository.
> > > A short summary of the last three changesets is included below.
> > > 
> > > changeset:   1790:0a088cefbdb6496b48cbbdc3b51ed7782f3e22f7
> > > tag:         tip
> > > user:        "Garth N. Wells <g.n.wells@xxxxxxxxxx>"
> > > date:        Wed Mar 15 21:23:04 2006 +0100
> > > files:       src/demo/nls/nonlinearpoisson/main.cpp src/kernel/la/KrylovSolver.cpp
> > > description:
> > > Fix check for Hypre in KrylovSolver.
> > > 
> > > Selecting Hypre AMG through the constructor of KrylovSolver leads to an error when attempting to solve. Needs further investigation.
> > > 
> > 
> 
> This appears to be a PETSc problem when destroying a solver before it
> has been used to solve a linear system.
> 
> The problem can be avoided by not calling init(0,0) (as well as
> readParameters()) in the KrylovSolver constructor. As far as I can see,
> there is no need to call init(0,0) in the constructor. It creates a
> PETSc solver, which is then deleted by KrylovSolver::init() the first
> time KrylovSolver::solve() is called. Can the call be removed from the
> constructor?
> 
> Garth

Aha. We had the following in the init() function before. I couldn't
understand why it was there in the first place so I removed it. Seems
we need it.

  // Don't reinitialize on first solve
  if ( ksp != 0 && this->M == 0 && this->N == 0 )
  {
    this->M = M;
    this->N = N;
    return;
  }

Does it work if you put it back?

I think we need to do init() in the constructor so that it is possible
to call KrylovSolver::solver() and do stuff with the KSP pointer if
someone should want to do that.

/Anders



Follow ups

References