Skip to content
Snippets Groups Projects
Commit fc99052e authored by Carsten Gräser's avatar Carsten Gräser
Browse files

[test]Test matrix backend with mass and laplace assembler

parent bbc9959a
No related tags found
1 merge request!150Draft: Add support for partial matrix patterns to ISTLMatrixBackend and global assembler
Pipeline #60395 failed
......@@ -21,6 +21,7 @@
#include <dune/fufem/backends/istlmatrixbackend.hh>
#include <dune/fufem/assemblers/dunefunctionsoperatorassembler.hh>
#include <dune/fufem/assemblers/localassemblers/massassembler.hh>
#include <dune/fufem/assemblers/localassemblers/laplaceassembler.hh>
#include <dune/fufem/test/common.hh>
// Due to a formerly unnoticed bug, activate bounds checking:
......@@ -137,13 +138,20 @@ Dune::TestSuite testISTLMatrixBackendForBasisPartialPattern(Matrix& matrix, cons
#endif
auto globalAssembler = Dune::Fufem::DuneFunctionsOperatorAssembler(basis, basis);
auto localAssembler = Dune::Fufem::MassAssembler();
backend.assign(0.0);
globalAssembler.assembleBulkEntries(backend, localAssembler);
{
auto localAssembler = Dune::Fufem::MassAssembler();
backend.assign(0.0);
globalAssembler.assembleBulkEntries(backend, localAssembler);
// ToDo: Check entries e.g. by summing rows up and comparing with integral of basis function (partition of untity).
}
// ToDo: Check entries e.g. by summing rows up and comparing to one (partition of untity).
{
auto localAssembler = Dune::Fufem::LaplaceAssembler();
backend.assign(0.0);
globalAssembler.assembleBulkEntries(backend, localAssembler);
// ToDo: Check entries e.g. by summing rows up and comparing with zero (partition of untity).
}
return suite;
}
......@@ -290,6 +298,7 @@ int main(int argc, char** argv) {
matrix[i][j].setSize(basis.size({i}), basis.size({j}));
suite.subTest(testISTLMatrixBackendForBasis<K, Matrix>(matrix, basis));
}
//****************************************************************************
// Test with sparse matrix and block entries
//****************************************************************************
......@@ -304,6 +313,36 @@ int main(int argc, char** argv) {
suite.subTest(testISTLMatrixBackendForBasis<K, Matrix>(basis));
}
//****************************************************************************
// Test with sparse matrix and DiagonalMatrix blocks
//****************************************************************************
{
using Matrix = BCRSM<DM<K,2>>;
const auto basis = makeBasis(
gridView,
power<2>(
lagrange<1>()
)
);
Matrix matrix = buildMatrixForBasis<Matrix>(basis);
suite.subTest(testISTLMatrixBackendForBasisPartialPattern<K>(matrix, basis));
}
//****************************************************************************
// Test with sparse matrix and ScaledIdentityMatrix blocks
//****************************************************************************
{
using Matrix = BCRSM<SIM<K,2>>;
const auto basis = makeBasis(
gridView,
power<2>(
lagrange<1>()
)
);
Matrix matrix = buildMatrixForBasis<Matrix>(basis);
suite.subTest(testISTLMatrixBackendForBasisPartialPattern<K>(matrix, basis));
}
//****************************************************************************
// Test with MTBM and uniform indices
//****************************************************************************
......
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