Skip to content
Snippets Groups Projects
Commit 15dc43f2 authored by Bernd Flemisch's avatar Bernd Flemisch
Browse files

[staggered] fix StaggeredNewtonController for use with Dune 2.5

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.
parent f9d21793
No related branches found
No related tags found
1 merge request!779[staggered] fix StaggeredNewtonController for use with Dune 2.5
...@@ -89,8 +89,8 @@ public: ...@@ -89,8 +89,8 @@ public:
// solve by calling the appropriate implementation depending on whether the linear solver // solve by calling the appropriate implementation depending on whether the linear solver
// is capable of handling MultiType matrices or not // is capable of handling MultiType matrices or not
const bool converged = solveLinearSystem_(ls, A, x, b, bool converged = solveLinearSystem_(ls, A, x, b,
std::integral_constant<bool, LinearSolverAcceptsMultiTypeMatrix<LinearSolver>::value>()); std::integral_constant<bool, LinearSolverAcceptsMultiTypeMatrix<LinearSolver>::value>());
// make sure all processes converged // make sure all processes converged
int convergedRemote = converged; int convergedRemote = converged;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment