Dear Mihai,

> 
> I am trying to code up an implicit method for a DG discretization, and
> came upon example 37 in the tutorial programs. Is there a simpler way
> to implement the matrix free product for a solver? That is, suppose I
> define my own class MatrixFree that inherits from SparseMatrix<double>
> and I only override the operations below:

I don't see the point in letting MatrixFree inherit from
SparseMatrix<double> because there will be nothing in common with the
matrix. A solver actually just needs an operation vmult(), nothing else.
In step-37, the operation Tvmult() is needed for implementing the
multigrid preconditioner. So you would override the only function that
is needed if you use SparseMatrix as base class. I'd start off with a
class like in step-37 and throw away everything that you do not need,
e.g. the parallelism with WorkStream, the initialize function, and the
computation of the diagonal (which is present in step-37 because the
Chebyshev smoother for multigrid needs to use diag(row)).

Best,
Martin


_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii

Reply via email to