On 03/15/2013 03:49 PM, Roy Stogner wrote: > > On Fri, 15 Mar 2013, Jens Lohne Eftang wrote: > >> What do you mean by that exactly. My Jacobian is A and the residual >> is Ax-b. The linear solver seems to successfully solve x=A\b so I >> don't see how it's possible that something is inconsistent >> (independent of whether my assembly loops are actually correct ... ) > > Sure it's possible. > > A common example: your residual is r(x):=Ax-b; if you instead just > always return "b", then (assuming your A and b are correct and you > don't set any initial guess) the first residual evaluation > r(0)=A*0-b=b will be correct, the first solve will be correct, you'll > get approximately x=inv(A)*b after this step.. but then when the > solver asks for a nonlinear residual to test, you'll be handing it "b" > instead of "A*x-b"="0", and it'll think you haven't converged on the > nonlinear problem at all. So it will try a line search, but that > search will never find a residual reduction no matter how many > intermediate values of "x" it tries. Hmm, ok, and it does seem like that's what happens as my residual doesn't decrease.
But when the residual is computed how can I hand it just "b," ? I thought it would calculate it as A*x-b based on my A and b ...? Jens ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_mar _______________________________________________ Libmesh-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/libmesh-users
