Skip to content
Snippets Groups Projects
Commit 208fa5c0 authored by Sander, Oliver's avatar Sander, Oliver
Browse files

Store mgStep in a non-smart pointer

The interface of Solvers::IterativeSolver used to make its
iterationStep_ member publicly available.  This has changed,
and the iteration step can now only be accessed by a getter
method (which is good).  However, that getter returns a
reference, but not the full smart pointer.

See the discussion at

  https://git.imp.fu-berlin.de/agnumpde/dune-solvers/merge_requests/23
parent 98d34ed3
No related branches found
No related tags found
No related merge requests found
Pipeline #
...@@ -295,12 +295,12 @@ void RiemannianTrustRegionSolver<Basis,TargetSpace>::solve() ...@@ -295,12 +295,12 @@ void RiemannianTrustRegionSolver<Basis,TargetSpace>::solve()
{ {
int rank = grid_->comm().rank(); int rank = grid_->comm().rank();
std::shared_ptr<MonotoneMGStep<MatrixType,CorrectionType> > mgStep; MonotoneMGStep<MatrixType,CorrectionType>* mgStep; // Non-shared pointer -- the innerSolver keeps the ownership
// if the inner solver is a monotone multigrid set up a max-norm trust-region // if the inner solver is a monotone multigrid set up a max-norm trust-region
if (dynamic_cast<LoopSolver<CorrectionType>*>(innerSolver_.get())) { if (dynamic_cast<LoopSolver<CorrectionType>*>(innerSolver_.get())) {
auto loopSolver = std::dynamic_pointer_cast<LoopSolver<CorrectionType> >(innerSolver_); auto loopSolver = std::dynamic_pointer_cast<LoopSolver<CorrectionType> >(innerSolver_);
mgStep = std::dynamic_pointer_cast<MonotoneMGStep<MatrixType,CorrectionType> >(loopSolver->iterationStep_); mgStep = dynamic_cast<MonotoneMGStep<MatrixType,CorrectionType>*>(&loopSolver->getIterationStep());
} }
......
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