But when I to try to run the 'initialize' or 'factorize' functions on my
SparseMatrixEZ, the linker throws an error (undefined reference to `void
dealii::SparseDirectUMFPACK::initialize<dealii::SparseMatrixEZ<double> >
(dealii::SparseMatrixEZ<double>  const&,
dealii::SparseDirectUMFPACK::AdditionalData)'), even though the
functions are templated by the type of matrix (template<class Matrix>),
so I guess I'm missing something.

Yes, this function is instantiated at the very bottom of the file for
particular matrix types. You'll have to add the instantiation for
SparseMatrixEZ there.

When you do that, you'll probably run into trouble because the factorize
function makes use of some things the SparseMatrixEZ class does not have.
Specifically, what I see is this:

There are calls to matrix.get_sparsity_pattern().row_length(row-1);
The SMEZ does not have a sparsity pattern. The usual solution would
be to replace these calls by
     get_row_length(matrix, row-1)
and write functions like so:

     template<typename Matrix>
     unsigned int get_row_length (const Matrix&m, unsigned int row) {
       return m.get_sparsity_pattern().row_length(row-1);
     }

     unsigned int get_row_length (const SparseMatrixEZ&m, unsigned int row) {
        ...do the appropriate thing for the SMEZ...
     }

There may be other reasons why this function in its current form doesn't
compile for SparseMatrixEZ arguments -- see how far you get!

Well, I am not totally familiar with the "explicit instantiations" at the bottom of lac/sparse_direct.cc, but I followed your instructions, and added some "n_nonzero_elements" and "get_row_length" functions in the SparseMatrix, BlockSparseMatrix and SparseMatrixEZ classes, and it works like a charm!

According to your previous posts, I'll soon download the "current subversion repository" and send you the "context diff".

Thanks a lot,
Martin.


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

Reply via email to