Re: [Libmesh-users] Recycling preconditioned in system_of_equations7.C

2016-11-29 Thread Roy Stogner
On Tue, 29 Nov 2016, Salazar De Troya, Miguel wrote: On 11/17/16, 7:56 AM, "Roy Stogner" wrote: I'd say: Add a DiffSolver::linear_solver() API for returning a reference to a LinearSolver, and add NewtonSolver and PetscDiffSolver implementations. For the PETSc case, that LinearSolver would

Re: [Libmesh-users] Recycling preconditioned in system_of_equations7.C

2016-11-29 Thread Salazar De Troya, Miguel
On 11/17/16, 7:56 AM, "Roy Stogner" wrote: >I'd say: > >Add a DiffSolver::linear_solver() API for returning a reference to a >LinearSolver, and add NewtonSolver and PetscDiffSolver >implementations. For the PETSc case, that LinearSolver would need to grab the KSP from the SNES so we can reuse th

Re: [Libmesh-users] Recycling preconditioned in system_of_equations7.C

2016-11-17 Thread Roy Stogner
On Wed, 16 Nov 2016, Salazar De Troya, Miguel wrote: LinearSolver does not have the capability to have null spaces attached to it. In my opinion, wouldn’t it be a good idea to have a Solver class from which all the solvers can inherit common things like attaching null spaces or setting up the p

Re: [Libmesh-users] Recycling preconditioned in system_of_equations7.C

2016-11-17 Thread Roy Stogner
On Wed, 16 Nov 2016, Salazar De Troya, Miguel wrote: The TimeSolver in DifferentiableSystem has both a DiffSolver and a LinearSolver. The DiffSolver is used in the regular primal/forward solve() and the LinearSolver in the adjoint_solve(). It would be convenient to reuse the forward preconditio

Re: [Libmesh-users] Recycling preconditioned in system_of_equations7.C

2016-11-16 Thread Salazar De Troya, Miguel
LinearSolver does not have the capability to have null spaces attached to it. In my opinion, wouldn’t it be a good idea to have a Solver class from which all the solvers can inherit common things like attaching null spaces or setting up the preconditioner? On 11/16/16, 8:50 AM, "Salazar De Troya,

Re: [Libmesh-users] Recycling preconditioned in system_of_equations7.C

2016-11-16 Thread Salazar De Troya, Miguel
A slight tangent but still related to this topic of reusing the preconditioner: The TimeSolver in DifferentiableSystem has both a DiffSolver and a LinearSolver. The DiffSolver is used in the regular primal/forward solve() and the LinearSolver in the adjoint_solve(). It would be convenient to reus

Re: [Libmesh-users] Recycling preconditioned in system_of_equations7.C

2016-11-15 Thread Roy Stogner
On Tue, 15 Nov 2016, Salazar De Troya, Miguel wrote: What would be a good place to insert PetscDiffSolver::init()? Maybe in DifferentiableSystem::init() after the user initialization?  I believe so. --- Roy--

Re: [Libmesh-users] Recycling preconditioned in system_of_equations7.C

2016-11-15 Thread Salazar De Troya, Miguel
edu>> Cc: Miguel Salazar mailto:salazardet...@llnl.gov>>, "libmesh-users@lists.sourceforge.net<mailto:libmesh-users@lists.sourceforge.net>" mailto:libmesh-users@lists.sourceforge.net>> Subject: Re: [Libmesh-users] Recycling preconditioned in system_of_equations7.C

Re: [Libmesh-users] Recycling preconditioned in system_of_equations7.C

2016-11-15 Thread Kong, Fande
In petsc_nonlinear_solver, there is the same issue. After each solve, SNES will get destroyed.Unfortunately, there are already a lot of applications built on this wrong interface. However, we should fix this in some point. Fande, On Tue, Nov 15, 2016 at 12:36 PM, Roy Stogner wrote: > > On

Re: [Libmesh-users] Recycling preconditioned in system_of_equations7.C

2016-11-15 Thread Roy Stogner
On Tue, 15 Nov 2016, Salazar De Troya, Miguel wrote: I am modifying PetscDiffSolve to be able to reuse the preconditioner. However, every time PetscDiffSolver::solve() is called, a new SNES is created by calling PetscDiffSolver::init(), why is this? I'm not sure, but if I had to bet money the

Re: [Libmesh-users] Recycling preconditioned in system_of_equations7.C

2016-11-15 Thread Salazar De Troya, Miguel
orge.net<mailto:libmesh-users@lists.sourceforge.net>" mailto:libmesh-users@lists.sourceforge.net>> Subject: Re: [Libmesh-users] Recycling preconditioned in system_of_equations7.C On Fri, Nov 11, 2016 at 3:00 PM, Roy Stogner mailto:royst...@ices.utexas.edu>> wrote: On Th

Re: [Libmesh-users] Recycling preconditioned in system_of_equations7.C

2016-11-14 Thread John Peterson
On Fri, Nov 11, 2016 at 3:00 PM, Roy Stogner wrote: > > On Thu, 10 Nov 2016, Salazar De Troya, Miguel wrote: > > > This example runs several linear solves because there is a nonlinear > > solver below a continuation scheme. I figured that it would be > > possible to reuse the preconditioner and s

Re: [Libmesh-users] Recycling preconditioned in system_of_equations7.C

2016-11-11 Thread Roy Stogner
On Thu, 10 Nov 2016, Salazar De Troya, Miguel wrote: > This example runs several linear solves because there is a nonlinear > solver below a continuation scheme. I figured that it would be > possible to reuse the preconditioner and see savings so I included > the lines: > > LinearSolver * linear_

[Libmesh-users] Recycling preconditioned in system_of_equations7.C

2016-11-10 Thread Salazar De Troya, Miguel
Hi This example runs several linear solves because there is a nonlinear solver below a continuation scheme. I figured that it would be possible to reuse the preconditioner and see savings so I included the lines: LinearSolver * linear_solver = system.get_linear_solver(); linear_solver->reuse_