diff --git a/dune/gfe/riemanniantrsolver.cc b/dune/gfe/riemanniantrsolver.cc index 5d8ea2c37075ac739233ac9e8c90fb48d0e087d6..2834be948c61c412ae84347cb74d7c927478fcdb 100644 --- a/dune/gfe/riemanniantrsolver.cc +++ b/dune/gfe/riemanniantrsolver.cc @@ -132,25 +132,14 @@ setup(const GridType& grid, assembler_->getNeighborsPerVertex(indices); indices.exportIdx(*hessianMatrix_); - // ////////////////////////////////////////////////////////// - // Create obstacles - // ////////////////////////////////////////////////////////// + // //////////////////////////////////// + // Create the transfer operators + // //////////////////////////////////// - hasObstacle_.resize(numLevels); #if defined THIRD_ORDER || defined SECOND_ORDER BasisType basis(grid_->leafGridView()); - hasObstacle_.back().resize(basis.size(), true); - - for (int i=0; i<hasObstacle_.size()-1; i++) - hasObstacle_[i].resize(grid_->size(i+1, gridDim),true); -#else - for (size_t i=0; i<hasObstacle_.size(); i++) - hasObstacle_[i].resize(grid_->size(i, gridDim),true); #endif - // //////////////////////////////////// - // Create the transfer operators - // //////////////////////////////////// for (size_t k=0; k<mmgStep->mgTransfer_.size(); k++) delete(mmgStep->mgTransfer_[k]); @@ -179,6 +168,15 @@ setup(const GridType& grid, mmgStep->mgTransfer_[i] = newTransferOp; } #endif + + // ////////////////////////////////////////////////////////// + // Create obstacles + // ////////////////////////////////////////////////////////// + + hasObstacle_.resize(numLevels); + hasObstacle_.back().resize(basis.size(), true); + for (int i=0; i<hasObstacle_.size()-1; i++) + hasObstacle_[i].resize(dynamic_cast<TruncatedCompressedMGTransfer<CorrectionType>* >(mmgStep->mgTransfer_[i])->getMatrix().M(),true); }