Skip to content
Snippets Groups Projects
Commit 01b26888 authored by Ansgar Burchardt's avatar Ansgar Burchardt
Browse files

[!297] use `weak_ptr`'s `lock()` method to allow case of no coarser level

Merge branch 'bugfix/paamg-hierarchy-weak-ptr-may-be-nullptr' into 'master'

ref:core/dune-istl On the coarsest level, element_->coarser_ is empty and
constructing a shared_ptr from a weak_ptr fails. The lock() method returns an
empty shared_ptr instead.

This fails when iterating over the hierarchy as the end of the iteration
cannot be reached; the problem was previously described by @simon.praetorius
[1].

See merge request [!297]

  [1]: https://lists.dune-project.org/pipermail/dune-devel/2019-March/002441.html
  [!297]: gitlab.dune-project.org/core/dune-istl/merge_requests/297
parents 4509b22d 0ed780fd
No related branches found
No related tags found
1 merge request!297use `weak_ptr`'s `lock()` method to allow case of no coarser level
Pipeline #18998 failed
......@@ -170,7 +170,7 @@ namespace Dune
/** @brief Move to the next coarser level */
void increment()
{
element_ = std::shared_ptr<Element>(element_->coarser_);
element_ = element_->coarser_.lock();
}
/** @brief Move to the next fine level */
......
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