[dune-pdelab] How to get nonzero per row in the initialisation of BCRSMatrixBackend?
Gregor Corbin
corbin at mathematik.uni-kl.de
Tue Jul 23 12:09:09 CEST 2019
Hi,
thanks for the clarification Jö and Steffen.
Am 23.07.19 um 12:05 schrieb Muething, Dr. Steffen:
>
>> Am 23.07.2019 um 12:00 schrieb Jö Fahlke <jorrit at jorrit.de>:
>>
>> Signierter PGP-Teil
>> Am Di, 23. Jul 2019, 11:22:52 +0200 schrieb Gregor Corbin:
>>> 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).
>> That's basically correct. Though overestimating should primarily lead to
>> wasting some memory. That in turn can lead to slower code in some
>> circumstances, but that should be rare.
> Over- or underestimating this number is not a big deal. Underestimating the number can
> cause a serious slowdown during *pattern construction* (when you create a new matrix),
> while overestimating it uses more memory than necessary during this step. After the matrix
> has been built, there is no difference in performance or memory usage.
>
> Cheers
> Steffen
>
>> Regards,
>> Jö.
>>
>>> 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
>> --
>> Jorrit (Jö) Fahlke, Institute for Computational und Applied Mathematics,
>> University of Münster, Orleans-Ring 10, D-48149 Münster
>> Tel: +49 251 83 35146 Fax: +49 251 83 32729
>>
>> This message is protected by DoubleROT13 encryption
>> Attempting to decode it violates the DMCA/WIPO acts
>>
>>
> --------------------------------
> Steffen Müthing
> Interdisciplinary Center for Scientific Computing
> Heidelberg University
>
> Im Neuenheimer Feld 205
> 69120 Heidelberg
> Germany
>
> +49 6221 54 14516
> steffen.muething at iwr.uni-heidelberg.de
>
-------------- 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/d5cabbbd/attachment.sig>
More information about the dune-pdelab
mailing list