Skip to content

[staggered] fix StaggeredNewtonController for use with Dune 2.5

Bernd Flemisch requested to merge fix/staggerednewtoncontroller-for-dune25 into master

The function min of the CollectiveCommunication looks like this in Dune 2.5:

    template<typename T>
    T min (T& in) const
    {
      T out;

In the StaggeredNewtonController this has been called like this:

    const bool converged = solveLinearSystem_...
    int convergedRemote = converged;
    if (this->comm().size() > 1)
        convergedRemote = this->comm().min(converged);

Thus, T is determined to be const bool and setting T out; without initializing it doesn't work (fortunately). Fix by using bool instead of const bool.

In Dune 2.6, the same function looks like that:

    template<typename T>
    T min (const T& in) const

Therefore, T is deduced to be bool and everything works fine. Still does after the change.

Merge request reports