[dune-pdelab] Vector and Matrix backends for PETSc

Markus Blatt Markus.Blatt at iwr.uni-heidelberg.de
Tue Sep 13 15:12:41 CEST 2011


Hi Steffen,

thanks a lot for the patches. I am just wondering whether a branch for these
changes would have made sense. IMHO there was an interface change
involved (which would have  stired up a heated discussion for a core
module).

Anyway:

Just to sum this up: the main problem is that Petsc needs to setup the
sparsity pattern at once for all rows and one needs to set all local
entries of an element as a small dense matrix. This requires the new
accessor and the internal state.

A few questions:
- Is there another way to setup the pattern?
- Is there another efficient way besides SetValues? 
- Given a maximum number of nonzeros per row and providing this in the
  constructor, would it be possible to set up the pattern and values
  at once (even though this would need to rely on internals of PETSc?


The reason for asking is this:
We were thinking about providing an adapter for easier construction on
ISTL sparse matrices to get rid of the two grid traversal (1. sparsity
pattern, 2. values). Basically this means providing an average (or
upper limit) of the nonzeros per row size when constructing the
adapter. This way all needed space for row, column index and values
would have been set up and the row pointer could already be created. 
Then matrix entries can already be set up. On destruction of the
adapter the data is compressed to get rid off holes in the vectors.


For this task one would need an adapter which lets us set/add matrix
values with column and row index arbitrarily. For ISTL this adapter
could be a friend of the matrix and setup stuff directly. For Petsc we
would need a way besides SetValues.

If there is the possibility to do this I would postpone you changes
and create an interface that suits both approaches well before adding
Petsc support.

Greetings to Oslo from

Markus

-- 
Markus Blatt, Interdisciplinary Center for Scientific Computing,
University Heidelberg, Im Neuenheimer Feld 368, D-69120 Heidelberg
Tel: +49 (0) 6221 548881 Fax: +49 (0) 6221 548884

'Mathematics knows no races or geographic boundaries; for
mathematics, the cultural world is one country' - David Hilbert




More information about the dune-pdelab mailing list