Skip to content
Snippets Groups Projects
Commit 9ad97e83 authored by oliver.sander_at_tu-dresden.de's avatar oliver.sander_at_tu-dresden.de
Browse files

Simplify setup of the transfer operators

The setup was needlessly complicated.  I think that's because
it predates the time where std::shared_ptr could be used.
parent f9ec985d
Branches
No related tags found
1 merge request!53Simplify setup of the transfer operators
Pipeline #31757 passed
......@@ -293,6 +293,8 @@ setup(const typename BasisType::GridView::Grid& grid,
std::vector<std::shared_ptr<TruncatedCompressedMGTransfer<CorrectionType>>> transferOperators(isP1Basis ? numLevels-1 : numLevels);
// Here we set up the restriction of the leaf grid space into the leaf grid P1/Q1 space
// TODO: IIRC that move to P1Basis was only implemented because I didn't have general
// prolongation operators between arbitratry FE spaces.
if (not isP1Basis)
{
TransferOperatorType pkToP1TransferMatrix;
......@@ -325,13 +327,8 @@ setup(const typename BasisType::GridView::Grid& grid,
for (int i=0; i<numLevels-1; i++) {
// Construct the local multigrid transfer matrix
TruncatedCompressedMGTransfer<CorrectionType>* newTransferOp = new TruncatedCompressedMGTransfer<CorrectionType>;
newTransferOp->setup(*grid_,i,i+1);
auto op = std::make_shared<TruncatedCompressedMGTransfer<CorrectionType>>();
transferOperators[i] = op;
std::shared_ptr<TransferOperatorType> transferOperatorMatrix = std::make_shared<TransferOperatorType>(newTransferOp->getMatrix());
op->setMatrix(transferOperatorMatrix);
transferOperators[i] = std::make_shared<TruncatedCompressedMGTransfer<CorrectionType> >();
transferOperators[i]->setup(*grid_,i,i+1);
}
mmgStep->setTransferOperators(transferOperators);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment