From 39fa9571274b53d9437d65ee18b88f2b1b8c2a9e Mon Sep 17 00:00:00 2001
From: Oliver Sander <oliver.sander@tu-dresden.de>
Date: Sat, 4 May 2019 16:40:10 +0200
Subject: [PATCH] Store smoother objects in shared pointers

This makes mixed-cosserat-continuum compile again.
---
 dune/gfe/mixedriemanniantrsolver.cc | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dune/gfe/mixedriemanniantrsolver.cc b/dune/gfe/mixedriemanniantrsolver.cc
index 0921d3af..dff40c95 100644
--- a/dune/gfe/mixedriemanniantrsolver.cc
+++ b/dune/gfe/mixedriemanniantrsolver.cc
@@ -122,8 +122,8 @@ setup(const GridType& grid,
 
 
     // Make pre and postsmoothers
-    TrustRegionGSStep<MatrixType00, CorrectionType0>* presmoother0  = new TrustRegionGSStep<MatrixType00, CorrectionType0>;
-    TrustRegionGSStep<MatrixType00, CorrectionType0>* postsmoother0 = new TrustRegionGSStep<MatrixType00, CorrectionType0>;
+    auto presmoother0  = std::make_shared<TrustRegionGSStep<MatrixType00, CorrectionType0> >();
+    auto postsmoother0 = std::make_shared<TrustRegionGSStep<MatrixType00, CorrectionType0> >();
 
     mmgStep0 = new MonotoneMGStep<MatrixType00, CorrectionType0>;
 
@@ -134,8 +134,8 @@ setup(const GridType& grid,
     mmgStep0->setObstacleRestrictor(std::make_shared<MandelObstacleRestrictor<CorrectionType0>>());
     mmgStep0->setVerbosity(Solver::QUIET);
 
-    TrustRegionGSStep<MatrixType11, CorrectionType1>* presmoother1  = new TrustRegionGSStep<MatrixType11, CorrectionType1>;
-    TrustRegionGSStep<MatrixType11, CorrectionType1>* postsmoother1 = new TrustRegionGSStep<MatrixType11, CorrectionType1>;
+    auto presmoother1  = std::make_shared<TrustRegionGSStep<MatrixType11, CorrectionType1> >();
+    auto postsmoother1 = std::make_shared<TrustRegionGSStep<MatrixType11, CorrectionType1> >();
 
     mmgStep1 = new MonotoneMGStep<MatrixType11, CorrectionType1>;
 
-- 
GitLab