LineMinimization and p-Laplace

56 views
Skip to first unread message

J.Y. Merten

unread,
Apr 15, 2021, 6:08:30 AM4/15/21
to deal.II User Group
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


Bruno Turcksin

unread,
Apr 15, 2021, 8:59:29 AM4/15/21
to deal.II User Group
Julie,

There is a tutorial in progress https://github.com/dealii/dealii/pull/11953 that is based on step-15 but uses KINSOL. KINSOL is a package dedicated to non-linear solve. It's probably worth using it in complicated cases like yours.

Best,

Bruno

Jean-Paul Pelteret

unread,
Apr 16, 2021, 5:59:29 PM4/16/21
to dea...@googlegroups.com
Hi Julie,

So as you know from the error message, the assertion on this line is being triggered. The fit function is called from this section of code, 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


--
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.

J.Y. Merten

unread,
Apr 20, 2021, 5:34:08 AM4/20/21
to deal.II User Group
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.187500
DEAL:cg::Convergence step 3 value 1.15076e-17
3 CG steps
DEAL::Bracketing phase: 1
DEAL::1.00000 8.15283e+16 7.41104e+07 0 0 -0.00395508
DEAL::Sectioning phase: 2
DEAL::0.00000 0.0175781 -0.0351563 1 0
DEAL::1.00000 8.15283e+16 7.41104e+07 0 0
DEAL::0.300000 6.60380e+14 6.66994e+06 0 0
DEAL::Sectioning phase: 3
DEAL::0.00000 0.0175781 -0.0351563 1 0
DEAL::0.300000 6.60380e+14 6.66994e+06 0 0
DEAL::0.0900000 5.34907e+12 600294. 0 0
DEAL::Sectioning phase: 4
DEAL::0.00000 0.0175781 -0.0351563 1 0
DEAL::0.0900000 5.34907e+12 600294. 0 0
DEAL::0.0270000 4.33275e+10 54026.5 0 0
DEAL::Sectioning phase: 5
DEAL::0.00000 0.0175781 -0.0351563 1 0
DEAL::0.0270000 4.33275e+10 54026.5 0 0
DEAL::0.00810000 3.50948e+08 4862.35 0 0
DEAL::Sectioning phase: 6
DEAL::0.00000 0.0175781 -0.0351563 1 0
DEAL::0.00810000 3.50948e+08 4862.35 0 0
DEAL::0.00243000 2.84228e+06 437.579 0 0
DEAL::Sectioning phase: 7
DEAL::0.00000 0.0175781 -0.0351563 1 0
DEAL::0.00243000 2.84228e+06 437.579 0 0
DEAL::0.000729000 22986.6 39.3502 0 0
DEAL::Sectioning phase: 8
DEAL::0.00000 0.0175781 -0.0351563 1 0
DEAL::0.000729000 22986.6 39.3502 0 0
DEAL::0.000218700 182.984 3.50952 0 0
DEAL::Sectioning phase: 9
DEAL::0.00000 0.0175781 -0.0351563 1 0
DEAL::0.000218700 182.984 3.50952 0 0
DEAL::6.56100e-05 1.20929 0.283865 0 0
DEAL::Sectioning phase: 10
DEAL::0.00000 0.0175781 -0.0351563 1 0
DEAL::6.56100e-05 1.20929 0.283865 0 0
DEAL::1.96830e-05 0.00110320 -0.00644436 1 1
DEAL::Satisfied both Wolfe conditions.
DEAL:cg::Starting value 0.0469723
DEAL:cg::Convergence step 3 value 7.79533e-08
3 CG steps
DEAL::Bracketing phase: 1
DEAL::1.00000 2.86692e+32 6.48676e+14 0 0 -0.000248220
DEAL::Sectioning phase: 2
DEAL::0.00000 0.00110320 -0.00220640 1 0
DEAL::1.00000 2.86692e+32 6.48676e+14 0 0
DEAL::0.300000 2.32221e+30 5.83808e+13 0 0
DEAL::Sectioning phase: 3
DEAL::0.00000 0.00110320 -0.00220640 1 0
DEAL::0.300000 2.32221e+30 5.83808e+13 0 0
DEAL::0.0900000 1.88099e+28 5.25428e+12 0 0
DEAL::Sectioning phase: 4
DEAL::0.00000 0.00110320 -0.00220640 1 0
DEAL::0.0900000 1.88099e+28 5.25428e+12 0 0
DEAL::0.0270000 1.52360e+26 4.72885e+11 0 0
DEAL::Sectioning phase: 5
DEAL::0.00000 0.00110320 -0.00220640 1 0
DEAL::0.0270000 1.52360e+26 4.72885e+11 0 0
DEAL::0.00810000 1.23412e+24 4.25597e+10 0 0
. . .
DEAL::Sectioning phase: 17
DEAL::0.00000 0.00110320 -0.00220640 1 0
DEAL::1.43489e-08 22.1753 0.178932 0 0
DEAL::4.30467e-09 0.445889 0.0240882 0 0
DEAL::Sectioning phase: 18
DEAL::0.00000 0.00110320 -0.00220640 1 0
DEAL::4.30467e-09 0.445889 0.0240882 0 0
DEAL::1.29140e-09 0.0153440 0.00315777 0 0
DEAL::Sectioning phase: 19
DEAL::0.00000 0.00110320 -0.00220640 1 0
DEAL::1.29140e-09 0.0153440 0.00315777 0 0
DEAL::3.87420e-10 0.00102256 -0.000824328 1 1
DEAL::Satisfied both Wolfe conditions.
DEAL:cg::Starting value 0.0452230
DEAL:cg::Convergence step 3 value 6.54715e-07
3 CG steps
DEAL::Bracketing phase: 1
DEAL::1.00000 2.67799e+30 5.53778e+13 0 0 -0.000230076
DEAL::Sectioning phase: 2
DEAL::0.00000 0.00102256 -0.00204512 1 0
DEAL::1.00000 2.67799e+30 5.53778e+13 0 0
DEAL::0.300000 2.16917e+28 4.98400e+12 0 0
DEAL::Sectioning phase: 3
DEAL::0.00000 0.00102256 -0.00204512 1 0
DEAL::0.300000 2.16917e+28 4.98400e+12 0 0
DEAL::0.0900000 1.75703e+26 4.48560e+11 0 0
DEAL::Sectioning phase: 4
DEAL::0.00000 0.00102256 -0.00204512 1 0
DEAL::0.0900000 1.75703e+26 4.48560e+11 0 0
DEAL::0.0270000 1.42319e+24 4.03704e+10 0 0
DEAL::Sectioning phase: 5
DEAL::0.00000 0.00102256 -0.00204512 1 0
DEAL::0.0270000 1.42319e+24 4.03704e+10 0 0
DEAL::0.00810000 1.15278e+22 3.63333e+09 0 0
DEAL::Sectioning phase: 6
DEAL::0.00000 0.00102256 -0.00204512 1 0
DEAL::0.00810000 1.15278e+22 3.63333e+09 0 0
DEAL::0.00243000 9.33741e+19 3.26998e+08 0 0
DEAL::Sectioning phase: 7
DEAL::0.00000 0.00102256 -0.00204512 1 0
DEAL::0.00243000 9.33741e+19 3.26998e+08 0 0
DEAL::0.000729000 7.56303e+17 2.94293e+07 0 0
DEAL::Sectioning phase: 8
DEAL::0.00000 0.00102256 -0.00204512 1 0
DEAL::0.000729000 7.56303e+17 2.94293e+07 0 0
DEAL::0.000218700 6.12531e+15 2.64847e+06 0 0
DEAL::Sectioning phase: 9
DEAL::0.00000 0.00102256 -0.00204512 1 0
DEAL::0.000218700 6.12531e+15 2.64847e+06 0 0
DEAL::6.56100e-05 4.95950e+13 238314. 0 0
DEAL::Sectioning phase: 10
DEAL::0.00000 0.00102256 -0.00204512 1 0
DEAL::6.56100e-05 4.95950e+13 238314. 0 0
DEAL::1.96830e-05 4.01179e+11 21433.9 0 0
. . .
DEAL::Sectioning phase: 49
DEAL::6.58615e-10 0.000743997 -0.00137850 1 0
DEAL::6.58615e-10 0.000743997 -0.00137850 1 0
DEAL::6.58615e-10 0.000743997 -0.00137850 1 0
DEAL::Sectioning phase: 50
DEAL::6.58615e-10 0.000743997 -0.00137850 1 0
DEAL::6.58615e-10 0.000743997 -0.00137850 1 0
DEAL::6.58615e-10 0.000743997 -0.00137850 1 0
DEAL::Sectioning phase: 51
DEAL::6.58615e-10 0.000743997 -0.00137850 1 0
DEAL::6.58615e-10 0.000743997 -0.00137850 1 0
DEAL::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.second
Additional 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

Jean-Paul Pelteret

unread,
Apr 20, 2021, 3:47:42 PM4/20/21
to dea...@googlegroups.com
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

Merten, J.Y.

unread,
Apr 21, 2021, 2:36:03 PM4/21/21
to dea...@googlegroups.com
Hi Jean,

I was thinking the same. I have followed the example in the namespace reference of LineMinimization 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

deallog

J.Y. Merten

unread,
Apr 28, 2021, 11:31:44 AM4/28/21
to deal.II User Group
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
log

J.Y. Merten

unread,
May 5, 2021, 12:09:37 PM5/5/21
to deal.II User Group
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 :)

Jean-Paul Pelteret

unread,
May 5, 2021, 4:39:51 PM5/5/21
to dea...@googlegroups.com
Hi Julie,

I’m glad to hear that you managed to figure out what the problem was! Thank you for letting us know that you made progress, and that the line search part was in fact working as expected. Good luck with solving the next part of the puzzle :-)

Best,
Jean-Paul

Reply all
Reply to author
Forward
0 new messages