Wolfgang, thanks a lot for your help. Now my implementation with BlockMatrixArray & TransposeMatrix works just fine.
Coming back to this topic with another question: -- can the SparseDirectUMFPACK class be made to work with a BlockMatrixArray (or some other type of block matrix)? I already have my matrix blocks assembled, I enter them into the BlockMatrixArray, and I solve my system using SolverGMRES. My problem is relatively small, so I'd like to test a direct sparse solver as well. Can i use the blocks that I assembled, or do I need to think of another approach to do this? Thanks! -- Mihai ________________________________ Von: Wolfgang Bangerth <[email protected]> An: [email protected] CC: mihai alexe <[email protected]> Gesendet: Mittwoch, den 19. Januar 2011, 8:33:29 Uhr Betreff: Re: [deal.II] block matrix assembly and solve > I have A, B and C already assembled as SparseMatrix<double>, and I am > thinking of using the BlockMatrix class, that is, to have M as a > BlockMatrix with 4 blocks (organized as a 2x2 grid). Trouble is, I cannot > seem to find the transpose operation for a SparseMatrix to create the > "A^T" block... my guess that can be avoided somehow but I cannot see how > to do that in the context of the BlockMatrix classes. If the *sparsity pattern* of A is symmetric, then you could just create a second matrix (say, AT) with the same sparsity pattern and fill it by using an iterator over the matrix elements of A and writing their value into the transpose element of AT. > If I were to use an iterative solver (GMRES) instead of UMFPACK, could I > have "M" to be some generic matrix type (derived from > SparseMatrix<double>) for which I override the vmult operation to do what > I want? Or is this not a good approach? You can definitely do that. An alternative is to use the BlockMatrixArray class together with the TransposeMatrix class. Best W. ------------------------------------------------------------------------- Wolfgang Bangerth email: [email protected] www: http://www.math.tamu.edu/~bangerth/
_______________________________________________ dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii
