[dune-pdelab] How to get nonzero per row in the initialisation of BCRSMatrixBackend?

Gregor Corbin corbin at mathematik.uni-kl.de
Tue Jul 23 11:22:52 CEST 2019


Hi Ranjeet,

the number of nonzeros in your stiffness matrix depends on the problem
and the discretization. I think it is used internally to optimize the
matrix routines. Do *not* underestimate this number, as it could break
the code. A too generous estimate will lead to slower code. (@Experts:
please correct me if i am wrong).

In tutorial 0 the Poisson equation is solved with P1 elements, i.e., you
have one degree of freedom on every vertex in your triangulation. If you
test the equation with the i-th test function (assuming nice ordering
this is the hat-function on vertex i) you get nonzeros from every ansatz
function j that overlaps with the i-th function. That is, in row i you
get a nonzero for each vertex j that is connected to i with an edge and
for i itself.

So you have to have some additional information on the grid to guess the
number of nonzeros. In tutorial 0 someone decided that in 2D they won't
need triangular grids with more than 7 edges connecting to a single
vertex (1 << dim+1 = 2^dim+1 = 8).

In tutorial 5 a higher order method is used and so there is more than
one basis function per element. This is why the number of non-zeros
depends on the polynomial degree. Because I am not familiar with the
details of this tutorial (and refinement in general) I can't tell you
why they chose this estimate in particular.

Cheers,

Gregor


Am 23.07.19 um 07:03 schrieb Ranjeet kumar:
> Hi,
> I am new to dune-pdelab and currently exploring the tutorials. 
> It will be a great help if you could explain how the number of nonzero
> per rows determined in the initialization BCRSMatrixBackend?  In
> tutorial 0, it is initialized with the *(1<<dim+1)*, whereas in
> tutorial 5 with the *pow(1+2*degree,dim)*? 
>
> Thank you,
> Kind regards,
> Ranjeet
>
> _______________________________________________
> dune-pdelab mailing list
> dune-pdelab at lists.dune-project.org
> https://lists.dune-project.org/mailman/listinfo/dune-pdelab
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dune-project.org/pipermail/dune-pdelab/attachments/20190723/6d40d6b5/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <https://lists.dune-project.org/pipermail/dune-pdelab/attachments/20190723/6d40d6b5/attachment.sig>


More information about the dune-pdelab mailing list