On 3/14/21 3:23 PM, Andrey Volkov wrote:

The system_matrix.block(0,0) gives access to a single block, namely *M *(correct?). However, is there a way to access/extract _multiple blocks as a whole block matrix_, let us say { [M B], [B 0] } or { [D E], [F G] }?

Sure, I looked at step-20/22, as all I have done so far is based on these tutorials.

Not quite so easily, but ASPECT does this: It simply defines its own 2x2 block matrix class that points to sub-blocks of a larger matrix. See here:

https://github.com/geodynamics/aspect/blob/master/source/simulator/solver.cc#L47-L105

Of course, if you don't actually need access to the M and B blocks individually, you don't have to structure your matrix that way. The structuring of the matrix based on solution variables is your choice, and you can have a 2x2 block pattern for a matrix even if you have 3 solution variables, and then you can put [[M, B],[B, 0]] all into one block.

Best
 W.


--
------------------------------------------------------------------------
Wolfgang Bangerth          email:                 bange...@colostate.edu
                           www: http://www.math.colostate.edu/~bangerth/

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/f29bb9d8-38a7-0410-146d-8f39047b74e4%40colostate.edu.

Reply via email to