Ben, Thanks a bunch. I still havent had a chance to look at the code or compile, run it yet but I hope it will run without any glitches. I will modify my existing code along the same lines and see where it leads me. Again, appreciate your effort in adding this example !!
Derek, I understand your point of view but even Petsc can work with just residuals to obtain the Jacobian matrix (numerical Jacobian). But when the dof's are in the order of millions in a 3D case and I wouldnt even bother finding the numerical Jacobian and then eventually solving it. Doing it matrix-free with good preconditioners to reduce linear iterations can provide great CPU improvements. I agree about not tying LibMesh too much to PETSc but since there is a PetscNonlinearSolver class, I definitely want to use its full potential when solving nonlinear problems. And hence exposure to the actual snes object either through a property or function is necessary to have better control of how the nonlinear system is being solved. And that was my original request ! There could always be a class for TrilinosNonlinearSolver or ...NonlinearSolver that could solve the system with Newton or FPI scheme from the corresponding packages but nevertheless, user needs control of the base objects. Transparency here could affect performance. Just my 2 cents. Vijay -----Original Message----- From: Derek Gaston [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 23, 2008 10:40 AM To: Benjamin Kirk Cc: Vijay M; [email protected] Subject: Re: [Libmesh-devel] [Libmesh-users] Support for Matrix-free algorithms This is an interesting development... One thing I would warn against is tying ourselves too close to Petsc. I am currently waiting on a project to get green lighted where I will be tying Trilinos into libMesh... where we will have access to other matrix free solvers (like NOX, which can work with just residuals... doing finite differenced jacobians). So coming up with a good interface where you actually don't interact with Petsc primitives would be ideal. In most other places in the code you guys have done well at this exact thing... making it pretty easy to tie in a new set of linear/non-linear/transient solvers... no reason to go backwards now! So far, what you have here looks great! Just some food for thought... Derek On Jan 23, 2008 8:39 AM, Benjamin Kirk <[EMAIL PROTECTED]> wrote: > Here is a really, really raw example, the comments are not clear right now, > but I wanted to keep you informed. This requires the latest svn branch to > work. > > Unpack it in the ./examples directory and run make. > > Run it as > > $ ./ex19-dbg -snes_view -r 4 > for a successive approximation which will converge linearly, and > > $ ./ex19-dbg -snes_view -r 4 -snes_mf_operator > for a matrix-free approach in the iterative solver which will converge > quadratically. > > > Anyway, I do have a question regarding using PETSc object with LibMesh. I > > have been trying to use Petsc objects Mats, Vecs and SNES solver with > > Libmesh but the one thing I cant seem figure out is how to set the > > nonlinear_solver public attribute of say a NonlinearImplicitSystem object to > > a PETSc SNES object which I have created and initialized separately. Since, > > the SNES object used in the wrapper PetscNonlinearSolver is private, I don¹t > > understand how this can be done. > > > > Have I missed something and taken a completely wrong path on this ? I would > > very much appreciate any comments that you can provide to help me out here. > > The user interface is totally up for discussion since I am the only one who > as exercised it to date. (I am sure Roy will have some comments!) It seems > to me the right approach will be to add a method which gives the user access > to the SNES object? From there the KSP, Mat, Vec, PC, etc... can be > accessed. This would be similar to the approach used in the > PetscLinearSolver. > > -Ben > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Libmesh-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/libmesh-devel > > No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.516 / Virus Database: 269.19.9/1239 - Release Date: 1/23/2008 10:24 AM No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.516 / Virus Database: 269.19.9/1239 - Release Date: 1/23/2008 10:24 AM ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Libmesh-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/libmesh-devel
