On 2/22/22 07:48, Yang Liu wrote:

It seems that all the three derived classes of SolverControl have the stopping criteria that are based on the residual l_2 norm. The argument `check_value' in the function SolverControl::check() is provided as the residual l_2 norm. I wonder how to provide the `SolverControl::check()' function a different quantity instead of the l_2 norm.

Like Bruno already said, you probably want to write your own modified version of the CG solver. Alternatively, SolverCG is derived from SolverBase, which has a member function connect() to which you can attach a callback. This way, you will get to see the current iterate in each iteration. The callback doesn't get the residual vector, however, so if that's what you need, you would have to compute that at the cost of one matrix-vector product -- that's expensive of course. But for testing purposes, it might be useful.

Best
 W.

--
------------------------------------------------------------------------
Wolfgang Bangerth          email:                 bange...@colostate.edu
                           www: http://www.math.colostate.edu/~bangerth/

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/6fd63d11-c265-334b-b320-431904594736%40colostate.edu.

Reply via email to