On Thu, Jan 3, 2019 at 7:36 AM Yingjie Wu via petsc-users < petsc-users@mcs.anl.gov> wrote:
> Thanks for your reply. > I read the article you provided. This is my first contact with the > quasi-Newton method. > I have some problem: > 1. From the point of view of algorithm, the quasi-Newton method does not > need to be solved by linear equations, so why would KSP be used? > It is solving the equations, but we know the analytical answer. KSP is our abstraction for linear equation solver, so we also use it in this case. > 2. Where and how to use preconditioner in quasi-Newton method? > You do not need a PC here. Note that this is only going to work well if you have a good initial guess for the inverse of your Jacobian. The optimization people who invented have that (it is the identity). In Jed's paper, they use a V-cycle as the good initial guess. Thanks, Matt > Thanks, > Yingjie > > Jed Brown <j...@jedbrown.org> 于2018年12月27日周四 上午10:11写道: > >> Yingjie Wu via petsc-users <petsc-users@mcs.anl.gov> writes: >> >> > I my opinion, the difficulty in constructing my Jacobian matrix is >> complex >> > coefficient.(eg, thermal conductivity* λ* , density ) >> > For example, in temperature equation(T): >> > ∇(*λ*∇T) - ∇(ρ* Cp* u ) + Q = 0 >> > *λ* is thermal conductivity , ρ* is density Cp* is specific heat , u is >> > velocity, Q is source. >> > *λ = *1.9*(1.0e-3)*pow(T+273.0-150.0,1.29) function of T >> > ρ= >> > >> (0.4814*P/1.0e3/(T+273.15))/(1.0+0.446*(1.0e-2)*P/1.0e3/(pow(T+273.15,1.2))) >> > function of T and P >> > >> > In theory, the coefficient contain variable. So it is complicated to >> > calculate the element of Jacobian. >> > In my snes_mf_operator method, I treat λ,ρ as constant. In every >> nonlinear >> > step, I use the solution update the λ,ρ and thus update the >> > preconditioning matrix. At each residual function call(in >> > SNESFormFunction), I also update the coefficient to ensure the >> correction >> > of the residual function. >> >> If those Jacobian entries are really that hard to get right, you can try >> using quasi-Newton as an alternative to -snes_mf_operator; similar to >> >> >> https://jedbrown.org/files/BrownBrune-LowRankQuasiNewtonRobustJacobianLagging-2013.pdf >> >> >> In general, I would start with an exact Jacobian (computed by coloring, >> AD, or just in one specific material/configuration). Test Newton using >> direct solvers to see your "best case" convergence (globalization may be >> needed). Test fieldsplit using direct solvers on the blocks so you know >> how much error is attributable to that approximation. Only then look at >> backing off on the approximation of the Jacobian and the preconditioner. >> > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>