diff --git a/src/one-body-sample.cc b/src/one-body-sample.cc index cad82dde79796b620508269ecc6dba8b9f1c7273..ef3a3c2945a97f4f324d1765997c2b26d0bd41b1 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