Richard,
Nice! Can I ask you to play with this some more? I think you can make that
code even more minimal:
* Remove all of the commented out stuff -- for the purposes of reproducing the
problem it shouldn't matter.
* Move the matrix initialization code out of the main loop. You want to show
that it's the mmult that is the problem, but you're having a lot of other code
in there as well that could in principle be the issue. If you move the
initialization of the individual factors out of the loop and only leave
whatever is absolutely necessary for the mmult in the loop, then you've
reduced the number of places where one needs to look.
* I bet you could trim down the list of #includes by a good bit :-)
You seem to be using a pretty old version of deal.II. There are a number of
header files that no longer exist, and some code that doesn't compile for me.
For your reference, attached is a version that compiles on the current master
branch (though with a number of warnings). That said, it seems like the memory
doesn't explode for me -- which raises the question of which version of
deal.II and PETSc you use. For me, this is deal.II dev and PETSc 3.7.5.
> Am I doing anything wrong or is this supposed to be used differently?
> I am using dealii v.9.0.1 installed via candi, so maybe the old version is the
> reason.
Possible -- no need to chase an old bug that has already been fixed if you can
simply upgrade.
> Bonus question:
> Is there a way similar to hand the sparsity patterns over to the mmult function?
> (For the dealii::SparseMatrix there is, which is why I am asking)
DynamicSparsityPattern has compute_mmult_pattern, which should give you a
sparsity pattern you can then use to initialize the resulting PETSc matrix.
Best
W.
--
------------------------------------------------------------------------
Wolfgang Bangerth email:
bang...@colostate.edu
www:
http://www.math.colostate.edu/~bangerth/