## Re: [Libmesh-users] Solving for the increment with Newton method

 Re: [Libmesh-users] Solving for the increment with Newton method From: Lorenzo Botti - 2009-10-15 16:39:55 ```Ups, I've already answered to the first question. Lorenzo ```

 [Libmesh-users] Solving for the increment with Newton method From: Lorenzo Botti - 2009-10-12 15:33:32 ```Hi all, I'm solving the incompressible NS equations with a fully implicit dg code and I would like to know if there is an easy way to solve for the increment instead of the solution itself. Sometimes with non-linear fluxes building the residual on the rhs is easier than summing it to the product J*U^(n-1) as you do in ex13. The problem is that petsc_linear_solver use to initialize the solution vector to the previous solution and clearly the previous increment is not a good guess. I'm using a transient_system but maybe there is a best framework to do that. Thanks Lorenzo ```
 Re: [Libmesh-users] Solving for the increment with Newton method From: Roy Stogner - 2009-10-12 15:57:25 ```On Mon, 12 Oct 2009, Lorenzo Botti wrote: > I'm solving the incompressible NS equations with a fully implicit dg code > and I would like > to know if there is an easy way to solve for the increment instead of the > solution itself. > I'm using a transient_system but maybe there is a best framework to do that. The simplest change might be for you to use a TransientSystem and solve it with the PetscNonlinearSolver; that expects you to build just the global residual and Jacobian for your time step. A more radical change might be for you to create a FEMSystem subclass; that framework doesn't even require you to worry about the time stepping, just to build the differential and the algebraic parts of element and side residuals in separate methods. --- Roy ```
 Re: [Libmesh-users] Solving for the increment with Newton method From: John Peterson - 2009-10-12 16:02:16 ```On Mon, Oct 12, 2009 at 10:57 AM, Roy Stogner wrote: > > On Mon, 12 Oct 2009, Lorenzo Botti wrote: > >> I'm solving the incompressible NS equations with a fully implicit dg code >> and I would like >> to know if there is an easy way to solve for the increment instead of the >> solution itself. > >> I'm using a transient_system but maybe there is a best framework to do that. > > The simplest change might be for you to use a > TransientSystem and solve it with the > PetscNonlinearSolver; that expects you to build just the global > residual and Jacobian for your time step.  A more radical change might > be for you to create a FEMSystem subclass; that framework doesn't even > require you to worry about the time stepping, just to build the > differential and the algebraic parts of element and side residuals in > separate methods. FYI: FEMSystem example in ex18. -- John ```
 Re: [Libmesh-users] Solving for the increment with Newton method From: Lorenzo Botti - 2009-10-12 19:39:42 ```Thanks for the suggestions, I'm going to try both the possibilities. Lorenzo Il giorno 12/ott/2009, alle ore 18.01, John Peterson ha scritto: > On Mon, Oct 12, 2009 at 10:57 AM, Roy Stogner > wrote: >> >> On Mon, 12 Oct 2009, Lorenzo Botti wrote: >> >>> I'm solving the incompressible NS equations with a fully implicit >>> dg code >>> and I would like >>> to know if there is an easy way to solve for the increment instead >>> of the >>> solution itself. >> >>> I'm using a transient_system but maybe there is a best framework >>> to do that. >> >> The simplest change might be for you to use a >> TransientSystem and solve it with the >> PetscNonlinearSolver; that expects you to build just the global >> residual and Jacobian for your time step. A more radical change >> might >> be for you to create a FEMSystem subclass; that framework doesn't >> even >> require you to worry about the time stepping, just to build the >> differential and the algebraic parts of element and side residuals in >> separate methods. > > FYI: FEMSystem example in ex18. > > -- > John ```
 Re: [Libmesh-users] Solving for the increment with Newton method From: Lorenzo Botti - 2009-10-15 10:50:37 ```Ok, I'm trying with NonlinearImplicitSystem in the first place. I have a couple of questions... Is it possible to compute and get the L2 norm of the increment as in example 13, it's a good indication of how the residual is decreasing and it's cheaper to compute compared to the residual norm? Would it be possible to add a metod initial_linear/nonlinear_residual() to Linear/NonlinearImplicitSystem? Actually for a LinearImplicitSystem I need to do std::cout<<"initial linear residual = "<<(dynamic_cast*>(ns_system.linear_solver.get()))->get_initial_residual()< > Thanks for the suggestions, I'm going to try both the possibilities. > > Lorenzo > > > Il giorno 12/ott/2009, alle ore 18.01, John Peterson ha scritto: > > > On Mon, Oct 12, 2009 at 10:57 AM, Roy Stogner >> wrote: >> >>> >>> On Mon, 12 Oct 2009, Lorenzo Botti wrote: >>> >>> I'm solving the incompressible NS equations with a fully implicit dg >>>> code >>>> and I would like >>>> to know if there is an easy way to solve for the increment instead of >>>> the >>>> solution itself. >>>> >>> >>> I'm using a transient_system but maybe there is a best framework to do >>>> that. >>>> >>> >>> The simplest change might be for you to use a >>> TransientSystem and solve it with the >>> PetscNonlinearSolver; that expects you to build just the global >>> residual and Jacobian for your time step. A more radical change might >>> be for you to create a FEMSystem subclass; that framework doesn't even >>> require you to worry about the time stepping, just to build the >>> differential and the algebraic parts of element and side residuals in >>> separate methods. >>> >> >> FYI: FEMSystem example in ex18. >> >> -- >> John >> > > ```
 Re: [Libmesh-users] Solving for the increment with Newton method From: Lorenzo Botti - 2009-10-15 16:39:55 ```Ups, I've already answered to the first question. Lorenzo ```