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

Replace addToDiagonal by += in IPDG assembler

The code erroneously used the addToDiagonal method from the
dune-matrix-vector module to add two objects of type
FieldMatrix<T,1,1>.  That worked nicely, until recently
the addToDiagonal input data checks were tightened:
Now the matrix type and the value to be added to the diagonal
can only be of the same type if both are number types.
As FM<,1,1> is not a number type the test in
dunefunctionsipdgassemblertest.cc started not to compile
anymore.

Fix this by replacing addToDiagonal by operator+=.
parent e159f494
No related branches found
No related tags found
1 merge request!90Make mass assembler work with vector-valued bases
......@@ -216,18 +216,10 @@ class InteriorPenaltyDGAssembler : public LocalAssembler<GridType, TrialLocalFE,
// Depending on which elements i and j belong to, perform different operations.
// In particular, i (resp. j) < insizeSize corresponds to functions from the inner element
// while the others correspond to the outer element
if (i < insideSize){
if(j< insideSize)
Dune::MatrixVector::addToDiagonal(localMatrix[i][j], mc[0][0][i][j]);
if (i < insideSize)
localMatrix[i][j] += (j< insideSize) ? mc[0][0][i][j] : mc[0][1][i][j-insideSize];
else
Dune::MatrixVector::addToDiagonal(localMatrix[i][j], mc[0][1][i][j-insideSize]);
}
else {
if(j< insideSize)
Dune::MatrixVector::addToDiagonal(localMatrix[i][j], mc[1][0][i-insideSize][j]);
else
Dune::MatrixVector::addToDiagonal(localMatrix[i][j], mc[1][1][i-insideSize][j-insideSize]);
}
localMatrix[i][j] += (j< insideSize) ? mc[1][0][i-insideSize][j] : mc[1][1][i-insideSize][j-insideSize];
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment