Hi all,

just wanna give you an update. LineMinimization was doing what it is 
supposed to do. The problem was p-Laplace and the configuration of a few 
parameters in the code. I am facing another problem but now it is of 
theoretical nature.

Thanks a lot for the reply, Jean and Bruno :)

On Wednesday, April 28, 2021 at 5:31:44 PM UTC+2 J.Y. Merten wrote:

> Hi Jean,
>
> f and g are build correctly according to the manual but I don't understand 
> why it still stagnates in the third iteration (please see the attached 
> log). And
>
> auto perform_linesearch = [&]()
>                     {
>                          const auto res_0 = ls_min_function(0.0);
>                           Assert(res_0.second < 0.0,
>                                  ExcMessage("Gradient should be negative. 
> Current value: " +
>                                              
> std::to_string(res_0.second)));
>                           const auto res_1 = ls_min_function(1.0);
>
>                           if (res_0.second * res_1.second > 0.0)
>                               return 1.0;
>
>                           const double a1        = 1.0; //Initial trial 
> step for the bracketing phase
>                           const double eta       = 0.5; //A parameter in 
> the second Wolfe condition (curvature condition)
>                           const double mu        = 0.49; //A parameter in 
> the first Wolfe condition (sufficient decrease)
>                           const double a_max     = 1.25; //The maximum 
> allowed step size
>                           const double max_evals = 100; //The maximum 
> allowed number of function evaluations
>                           const bool debug_output = true; //A flag to 
> output extra debug information into the deallog static object
>
>                           const auto res = 
> LineMinimization::line_search<double>(...);
>
>                           return res.first; // Final stepsize
>                     };
>
> that if condition has not been fulfilled but from what I see in the 
> console output, ls_min_function(1.0) has been passed down to the 
> LineMinimization::line_search<double>() function, is it supposed to be that 
> way?
>
> Many thanks in advance.
>
> Best wishes, 
> Julie
> On Wednesday, April 21, 2021 at 8:36:03 PM UTC+2 J.Y. Merten wrote:
>
>> Hi Jean, 
>>
>> I was thinking the same. I have followed the example in the namespace 
>> reference of LineMinimization 
>> <https://www.dealii.org/current/doxygen/deal.II/namespaceLineMinimization.html#a0c96260fdb08c83fd9c7d84007e0e937>
>>  
>> and adjusted it to my problem. I'm currently reviewing the part where f and 
>> g are build. A full deallog is attached as well.
>>
>> Thank you so much for the help, it is highly appreciated.
>>
>> Best wishes,
>> Julie
>>
>> On Tue, Apr 20, 2021 at 9:47 PM Jean-Paul Pelteret <jppel...@gmail.com> 
>> wrote:
>>
>>> Hi Julie,
>>>
>>> So I was correct that in that the bracket evaluations converge towards 
>>> one another, until they are equal to machine precision. It would be good if 
>>> you could attach the full log, because I think that one interesting part 
>>> where the values of the “f" and "g" function change sign has been cropped 
>>> out. That leads to another question: How do you choose “f” and “g”, i.e. 
>>> how do you define the function returns these values as line search is 
>>> performing its evaluations?
>>>
>>> Best,
>>> Jean-Paul
>>>
>>> On 20. Apr 2021, at 11:34, J.Y. Merten <j.y.m...@rug.nl> wrote:
>>>
>>> Hi  Bruno and Jean
>>>
>>> Thanks a lot for the answers. Sorry to reply this late, was busy with 
>>> other PhD duties.  I did have a look at KINSOL when encountered the problem 
>>> for the first time, I think it would be a convenient tool for more stable 
>>> nonlinear problems. 
>>>
>>> @Jean:  here is the dealllog output 
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> *Initial residual: 0.1875    Number of active cells:       16    Number 
>>> of degrees of freedom: 25===== Solving torsion function for p = 3 
>>> =====DEAL:cg::Starting value 0.187500DEAL:cg::Convergence step 3 value 
>>> 1.15076e-173 CG stepsDEAL::Bracketing phase: 1DEAL::1.00000 8.15283e+16 
>>> 7.41104e+07 0 0 -0.00395508DEAL::Sectioning phase: 2DEAL::0.00000 0.0175781 
>>> -0.0351563 1 0DEAL::1.00000 8.15283e+16 7.41104e+07 0 0DEAL::0.300000 
>>> 6.60380e+14 6.66994e+06 0 0DEAL::Sectioning phase: 3DEAL::0.00000 0.0175781 
>>> -0.0351563 1 0DEAL::0.300000 6.60380e+14 6.66994e+06 0 0DEAL::0.0900000 
>>> 5.34907e+12 600294. 0 0DEAL::Sectioning phase: 4DEAL::0.00000 0.0175781 
>>> -0.0351563 1 0DEAL::0.0900000 5.34907e+12 600294. 0 0DEAL::0.0270000 
>>> 4.33275e+10 54026.5 0 0DEAL::Sectioning phase: 5DEAL::0.00000 0.0175781 
>>> -0.0351563 1 0DEAL::0.0270000 4.33275e+10 54026.5 0 0DEAL::0.00810000 
>>> 3.50948e+08 4862.35 0 0DEAL::Sectioning phase: 6DEAL::0.00000 0.0175781 
>>> -0.0351563 1 0DEAL::0.00810000 3.50948e+08 4862.35 0 0DEAL::0.00243000 
>>> 2.84228e+06 437.579 0 0DEAL::Sectioning phase: 7DEAL::0.00000 0.0175781 
>>> -0.0351563 1 0DEAL::0.00243000 2.84228e+06 437.579 0 0DEAL::0.000729000 
>>> 22986.6 39.3502 0 0DEAL::Sectioning phase: 8DEAL::0.00000 0.0175781 
>>> -0.0351563 1 0DEAL::0.000729000 22986.6 39.3502 0 0DEAL::0.000218700 
>>> 182.984 3.50952 0 0DEAL::Sectioning phase: 9DEAL::0.00000 0.0175781 
>>> -0.0351563 1 0DEAL::0.000218700 182.984 3.50952 0 0DEAL::6.56100e-05 
>>> 1.20929 0.283865 0 0DEAL::Sectioning phase: 10DEAL::0.00000 0.0175781 
>>> -0.0351563 1 0DEAL::6.56100e-05 1.20929 0.283865 0 0DEAL::1.96830e-05 
>>> 0.00110320 -0.00644436 1 1DEAL::Satisfied both Wolfe 
>>> conditions.DEAL:cg::Starting value 0.0469723DEAL:cg::Convergence step 3 
>>> value 7.79533e-083 CG stepsDEAL::Bracketing phase: 1DEAL::1.00000 
>>> 2.86692e+32 6.48676e+14 0 0 -0.000248220DEAL::Sectioning phase: 
>>> 2DEAL::0.00000 0.00110320 -0.00220640 1 0DEAL::1.00000 2.86692e+32 
>>> 6.48676e+14 0 0DEAL::0.300000 2.32221e+30 5.83808e+13 0 0DEAL::Sectioning 
>>> phase: 3DEAL::0.00000 0.00110320 -0.00220640 1 0DEAL::0.300000 2.32221e+30 
>>> 5.83808e+13 0 0DEAL::0.0900000 1.88099e+28 5.25428e+12 0 0DEAL::Sectioning 
>>> phase: 4DEAL::0.00000 0.00110320 -0.00220640 1 0DEAL::0.0900000 1.88099e+28 
>>> 5.25428e+12 0 0DEAL::0.0270000 1.52360e+26 4.72885e+11 0 0DEAL::Sectioning 
>>> phase: 5DEAL::0.00000 0.00110320 -0.00220640 1 0DEAL::0.0270000 1.52360e+26 
>>> 4.72885e+11 0 0DEAL::0.00810000 1.23412e+24 4.25597e+10 0 0. . .*
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> *DEAL::Sectioning phase: 17DEAL::0.00000 0.00110320 -0.00220640 1 
>>> 0DEAL::1.43489e-08 22.1753 0.178932 0 0DEAL::4.30467e-09 0.445889 0.0240882 
>>> 0 0DEAL::Sectioning phase: 18DEAL::0.00000 0.00110320 -0.00220640 1 
>>> 0DEAL::4.30467e-09 0.445889 0.0240882 0 0DEAL::1.29140e-09 0.0153440 
>>> 0.00315777 0 0DEAL::Sectioning phase: 19DEAL::0.00000 0.00110320 
>>> -0.00220640 1 0DEAL::1.29140e-09 0.0153440 0.00315777 0 0DEAL::3.87420e-10 
>>> 0.00102256 -0.000824328 1 1DEAL::Satisfied both Wolfe 
>>> conditions.DEAL:cg::Starting value 0.0452230DEAL:cg::Convergence step 3 
>>> value 6.54715e-073 CG stepsDEAL::Bracketing phase: 1DEAL::1.00000 
>>> 2.67799e+30 5.53778e+13 0 0 -0.000230076DEAL::Sectioning phase: 
>>> 2DEAL::0.00000 0.00102256 -0.00204512 1 0DEAL::1.00000 2.67799e+30 
>>> 5.53778e+13 0 0DEAL::0.300000 2.16917e+28 4.98400e+12 0 0DEAL::Sectioning 
>>> phase: 3DEAL::0.00000 0.00102256 -0.00204512 1 0DEAL::0.300000 2.16917e+28 
>>> 4.98400e+12 0 0DEAL::0.0900000 1.75703e+26 4.48560e+11 0 0DEAL::Sectioning 
>>> phase: 4DEAL::0.00000 0.00102256 -0.00204512 1 0DEAL::0.0900000 1.75703e+26 
>>> 4.48560e+11 0 0DEAL::0.0270000 1.42319e+24 4.03704e+10 0 0DEAL::Sectioning 
>>> phase: 5DEAL::0.00000 0.00102256 -0.00204512 1 0DEAL::0.0270000 1.42319e+24 
>>> 4.03704e+10 0 0DEAL::0.00810000 1.15278e+22 3.63333e+09 0 0DEAL::Sectioning 
>>> phase: 6DEAL::0.00000 0.00102256 -0.00204512 1 0DEAL::0.00810000 
>>> 1.15278e+22 3.63333e+09 0 0DEAL::0.00243000 9.33741e+19 3.26998e+08 0 
>>> 0DEAL::Sectioning phase: 7DEAL::0.00000 0.00102256 -0.00204512 1 
>>> 0DEAL::0.00243000 9.33741e+19 3.26998e+08 0 0DEAL::0.000729000 7.56303e+17 
>>> 2.94293e+07 0 0DEAL::Sectioning phase: 8DEAL::0.00000 0.00102256 
>>> -0.00204512 1 0DEAL::0.000729000 7.56303e+17 2.94293e+07 0 
>>> 0DEAL::0.000218700 6.12531e+15 2.64847e+06 0 0DEAL::Sectioning phase: 
>>> 9DEAL::0.00000 0.00102256 -0.00204512 1 0DEAL::0.000218700 6.12531e+15 
>>> 2.64847e+06 0 0DEAL::6.56100e-05 4.95950e+13 238314. 0 0DEAL::Sectioning 
>>> phase: 10DEAL::0.00000 0.00102256 -0.00204512 1 0DEAL::6.56100e-05 
>>> 4.95950e+13 238314. 0 0DEAL::1.96830e-05 4.01179e+11 21433.9 0 0*
>>>
>>> *. . . *
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> *DEAL::Sectioning phase: 49DEAL::6.58615e-10 0.000743997 -0.00137850 1 
>>> 0DEAL::6.58615e-10 0.000743997 -0.00137850 1 0DEAL::6.58615e-10 0.000743997 
>>> -0.00137850 1 0DEAL::Sectioning phase: 50DEAL::6.58615e-10 0.000743997 
>>> -0.00137850 1 0DEAL::6.58615e-10 0.000743997 -0.00137850 1 
>>> 0DEAL::6.58615e-10 0.000743997 -0.00137850 1 0DEAL::Sectioning phase: 
>>> 51DEAL::6.58615e-10 0.000743997 -0.00137850 1 0DEAL::6.58615e-10 
>>> 0.000743997 -0.00137850 1 0DEAL::6.58615e-10 0.000743997 -0.00137850 1 
>>> 0--------------------------------------------------------An error occurred 
>>> in line <457> of file 
>>> </home/jmrug/deal.ii-candi/deal.II-v9.1.1/include/deal.II/optimization/line_minimization.h>
>>>  
>>> in function    NumberType dealii::LineMinimization::poly_fit(NumberType, 
>>> NumberType, NumberType, NumberType, NumberType, NumberType, const 
>>> dealii::FiniteSizeHistory<NumberType>&, const 
>>> dealii::FiniteSizeHistory<NumberType>&, const 
>>> dealii::FiniteSizeHistory<NumberType>&, std::pair<_FIter, _FIter>) [with 
>>> NumberType = double]The violated condition was:     bounds.first < 
>>> bounds.secondAdditional information:     Incorrect bounds*
>>>
>>> The last few LS iterations do look strange, they barely changed.
>>>
>>> When run with more dofs on the same mesh (16 cells, 81 dofs) I get 
>>> convergence failure. There is a regularization parameter  epsilon=1e-5,  
>>> with larger epsilon on the same mesh, I get bounds error again. For smaller 
>>> p like 3-5, this epsilon should actually be enough for regularization...
>>>
>>> Any help is highly appreciated.   
>>>
>>> Best wishes,
>>> Julie
>>> On Friday, April 16, 2021 at 11:59:29 PM UTC+2 Jean-Paul Pelteret wrote:
>>>
>>>> Hi Julie,
>>>>
>>>> So as you know from the error message, the assertion on this line 
>>>> <https://github.com/dealii/dealii/blob/master/include/deal.II/optimization/line_minimization.h#L453>
>>>>  is 
>>>> being triggered. The fit function is called from this section of code 
>>>> <https://github.com/dealii/dealii/blob/master/include/deal.II/optimization/line_minimization.h#L692-L697>,
>>>>  
>>>> and the only logical explanation is that the brackets have precisely the 
>>>> same value. If you could provide the output from line_search() algorithm 
>>>> with the debug_output flag enabled, then perhaps is might be possible to 
>>>> tell what’s going on here. Otherwise, if you can provide the failing case 
>>>> then I could try to have a look at it in the coming days to see if I can 
>>>> work out what’s going on.
>>>>
>>>> Best,
>>>> Jean-Paul
>>>>
>>>>
>>>> On 15. Apr 2021, at 12:08, J.Y. Merten <j.y.m...@rug.nl> wrote:
>>>>
>>>> Dear all,
>>>>
>>>> I am trying to solve a p-Laplace Dirichlet problem with zero boundary 
>>>> and used step-15 as the base. The code works well for p=1.1-2.9 with 
>>>> Newton 
>>>> and standard linesearch procedure. But when p>=3 the program diverges, 
>>>> continuation method brought me to p=2.99 but not beyond. Recently I have 
>>>> used the LineMinimization class and got this error after a few iterations:
>>>>
>>>> using poly_fit and these param:
>>>> const double a1        = 1.0; 
>>>> const double eta       = 0.9; 
>>>> const double mu        = 1e-4;
>>>> const double a_max     = 1.25; 
>>>> const double max_evals = 100; 
>>>> const bool debug_output = true;
>>>>
>>>>   --------------------------------------------------------
>>>> An error occurred in line <457> of file 
>>>> </home/user/deal.ii-candi/deal.II-v9.1.1/include/deal.II/optimization/line_minimization.h>
>>>>  
>>>> in function
>>>>     NumberType dealii::LineMinimization::poly_fit(NumberType, 
>>>> NumberType, NumberType, NumberType, NumberType, NumberType, const 
>>>> dealii::FiniteSizeHistory<NumberType>&, const 
>>>> dealii::FiniteSizeHistory<NumberType>&, const 
>>>> dealii::FiniteSizeHistory<NumberType>&, std::pair<_FIter, _FIter>) [with 
>>>> NumberType = double]
>>>> The violated condition was: 
>>>>     bounds.first < bounds.second
>>>> Additional information: 
>>>>     Incorrect bounds
>>>>
>>>> I have looked into the source code and understood these bounds are 
>>>> meant for the sectioning and bracketing intervals. I tried different 
>>>> settings of the param and still get this error. I am running out of ideas 
>>>> how to debug this...
>>>>
>>>> Any help is highly appreciated.
>>>>
>>>> Thanks a lot and best wishes,
>>>> Julie
>>>>
>>>>
>>>>
>>>> -- 
>>>> 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+un...@googlegroups.com.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/dealii/d8844ccc-1f9e-4669-ad03-c71abf33eadbn%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/dealii/d8844ccc-1f9e-4669-ad03-c71abf33eadbn%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>>>
>>>>
>>> -- 
>>> 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+un...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/dealii/e8683619-0608-4f4c-a988-0c4d76ce082en%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/dealii/e8683619-0608-4f4c-a988-0c4d76ce082en%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>>
>>> -- 
>>> 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+un...@googlegroups.com.
>>>
>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/dealii/C94EDCB9-7CBC-446F-ABB3-19DA18703541%40gmail.com
>>>  
>>> <https://groups.google.com/d/msgid/dealii/C94EDCB9-7CBC-446F-ABB3-19DA18703541%40gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>

-- 
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/0131ce9a-26ee-4af7-8d14-b68a225adceen%40googlegroups.com.

Reply via email to