From 720ca793fbd37731df1b931d2c58d9e596aec4ae Mon Sep 17 00:00:00 2001
From: Elias Pipping <elias.pipping@fu-berlin.de>
Date: Fri, 16 Dec 2011 18:07:07 +0100
Subject: [PATCH] Use TransferOperatorAssembler

---
 src/one-body-sample.cc | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/one-body-sample.cc b/src/one-body-sample.cc
index cad82dde..ef3a3c29 100644
--- a/src/one-body-sample.cc
+++ b/src/one-body-sample.cc
@@ -53,6 +53,8 @@
 #include <dune/solvers/transferoperators/compressedmultigridtransfer.hh>
 #include <dune/tnnmg/iterationsteps/tnnmgstep.hh>
 
+#include <dune/fufem/assemblers/transferoperatorassembler.hh>
+
 int const dim = 2;
 
 template <class GridView>
@@ -327,12 +329,14 @@ int main(int argc, char *argv[]) {
         linearIterationStep->setSmoother(linearPresmoother, linearPostsmoother);
 
         // {{{ Transfer operators
-        linearIterationStep->mgTransfer_.resize(levels - 1);
-        for (size_t i = 0; i < linearIterationStep->mgTransfer_.size(); i++) {
-          auto newTransferOp = new CompressedMultigridTransfer<VectorType>;
-          newTransferOp->setup(grid, i, i + 1);
-          linearIterationStep->mgTransfer_[i] = newTransferOp;
-        }
+        std::vector<CompressedMultigridTransfer<VectorType> *> transfer_;
+        transfer_.resize(levels - 1);
+        for (auto &x : transfer_)
+          x = new CompressedMultigridTransfer<VectorType>;
+
+        TransferOperatorAssembler<GridType> transferOperatorAssembler(grid);
+        transferOperatorAssembler.assembleOperatorPointerHierarchy(transfer_);
+        linearIterationStep->setTransferOperators(transfer_);
         // }}}
 
         // Now the actual nonlinear solver
-- 
GitLab