Improve ISTL backend to have sparse-sparse patterns
Summary
Currently, the ISTL Backend is able to create nested BCRSMatrix
blocks by using the backend tag bcrs
. However, only the deepest level of the blocks is treated as sparse by the BCRSPattern
. This is only always true. For example,
using DefaultVBE = PDELab::ISTL::VectorBackend<>;
using LeafGFS = PDELab::GridFucntionSpace<...,DefaultVBE>;
// Sparse vector backend for higher nodes
using SparseVBE = PDELab::ISTL::VectorBackend<PDELab::ISTL::Blocking::bcrs>;
using PGFS1 = PDELab::PowerGridFunctionSpace<k1, LeafGFS, SparseVBE, PDELab::EntityBlockedOrderingTag>;
using PGFS2 = PDELab::PowerGridFunctionSpace<k2, PGFS, SparseVBE>;
using Domain = Dune::PDELab::Backend::Vector<GFSU,double>; // -> BlockVector<BlockVector<FieldVector<double,1>>>
using Range = Dune::PDELab::Backend::Vector<GFSV,double>; // -> BlockVector<BlockVector<FieldVector<double,1>>>
using MB = PDELab::ISTL::BCRSMatrixBackend<>;
using Jacobian = Dune::PDELab::Backend::Matrix<MB,Domain,Range,JF>; // -> BCRSMatrix<BCRSMatrix<FieldMatrix<double,1,1>>>
The problem with the resulting Jacobian
is that the outer block is sparse because it represents the sparsity links between entities, while the inner one represents the sparsity of the PGFS1
nodes. Both may be sparse!
Proposal
Modify BCRSPattern
to hold inner sparsity patterns, and when a new link is created, a sub-pattern should also be created. I will show this in a coming MR.
Edited by Christian Engwer