Skip to content
Snippets Groups Projects
Commit 130b1c8c authored by Oliver Sander's avatar Oliver Sander Committed by sander
Browse files

Don't rely on a non-standard dune-solvers extension to set the matrix of a transfer operator

dune-solvers actually does provide a way to set these matrices directly.
I simply didn't find it until recently.

[[Imported from SVN: r9885]]
parent bb0e72ac
No related branches found
No related tags found
No related merge requests found
...@@ -187,8 +187,9 @@ setup(const GridType& grid, ...@@ -187,8 +187,9 @@ setup(const GridType& grid,
typedef typename TruncatedCompressedMGTransfer<CorrectionType>::TransferOperatorType TransferOperatorType; typedef typename TruncatedCompressedMGTransfer<CorrectionType>::TransferOperatorType TransferOperatorType;
MatrixCommunicator<GUIndex, TransferOperatorType, LeafP1GUIndex> matrixComm(*guIndex_, p1Index, 0); MatrixCommunicator<GUIndex, TransferOperatorType, LeafP1GUIndex> matrixComm(*guIndex_, p1Index, 0);
mmgStep->mgTransfer_.back() = new PKtoP1MGTransfer<CorrectionType> mmgStep->mgTransfer_.back() = new PKtoP1MGTransfer<CorrectionType>;
(Dune::make_shared<TransferOperatorType>(matrixComm.reduceCopy(topTransferOp->getMatrix()))); Dune::shared_ptr<TransferOperatorType> topTransferOperator = Dune::make_shared<TransferOperatorType>(matrixComm.reduceCopy(topTransferOp->getMatrix()));
dynamic_cast<PKtoP1MGTransfer<CorrectionType>*>(mmgStep->mgTransfer_.back())->setMatrix(topTransferOperator);
for (int i=0; i<mmgStep->mgTransfer_.size()-1; i++){ for (int i=0; i<mmgStep->mgTransfer_.size()-1; i++){
// Construct the local multigrid transfer matrix // Construct the local multigrid transfer matrix
...@@ -204,8 +205,9 @@ setup(const GridType& grid, ...@@ -204,8 +205,9 @@ setup(const GridType& grid,
typedef typename TruncatedCompressedMGTransfer<CorrectionType>::TransferOperatorType TransferOperatorType; typedef typename TruncatedCompressedMGTransfer<CorrectionType>::TransferOperatorType TransferOperatorType;
MatrixCommunicator<LevelGUIndex, TransferOperatorType> matrixComm(fineGUIndex, coarseGUIndex, 0); MatrixCommunicator<LevelGUIndex, TransferOperatorType> matrixComm(fineGUIndex, coarseGUIndex, 0);
mmgStep->mgTransfer_[i] = new TruncatedCompressedMGTransfer<CorrectionType> mmgStep->mgTransfer_[i] = new TruncatedCompressedMGTransfer<CorrectionType>;
(Dune::make_shared<TransferOperatorType>(matrixComm.reduceCopy(newTransferOp->getMatrix()))); Dune::shared_ptr<TransferOperatorType> transferOperatorMatrix = Dune::make_shared<TransferOperatorType>(matrixComm.reduceCopy(newTransferOp->getMatrix()));
dynamic_cast<TruncatedCompressedMGTransfer<CorrectionType>*>(mmgStep->mgTransfer_[i])->setMatrix(transferOperatorMatrix);
} }
} }
......
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