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 <[email protected]> wrote: > > 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 then I'd put 95% on "a mistake > I came up with out of nowhere" and 5% on "a mistake in other PETSc > interface code that I foolishly copied". > > I don’t understand this coupling. I believe the solver should be >> initialized elsewhere or maybe include a flag to avoid >> reinitialization? >> > > My vote would be for "initialized elsewhere"; I doubt anyone has come > to depend on the current behavior. > > Thanks, > --- > Roy > ------------------------------------------------------------ > ------------------ > > _______________________________________________ > Libmesh-users mailing list > [email protected] > https://urldefense.proofpoint.com/v2/url?u=https-3A__lists. > sourceforge.net_lists_listinfo_libmesh-2Dusers&d=CwICAg&c= > 54IZrppPQZKX9mLzcGdPfFD1hxrcB__aEkJFOKJFd00&r=DUUt3SRGI0_ > JgtNaS3udV68GRkgV4ts7XKfj2opmiCY&m=xNXeEvyNvTyqPvt3aMQk6HdqpBMCy5 > L-ru8W7GkeiCw&s=6z8cV-VoR339V-T_Ng6W3tWo52jX9LuRxBR-9D_0vG4&e= > > ------------------------------------------------------------------------------ _______________________________________________ Libmesh-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/libmesh-users
