BlockSparseMatrix and BlockVector with a nested hierarchy of blocks

50 views
Skip to first unread message

Oded Yaakobi

unread,
Dec 13, 2016, 2:22:42 PM12/13/16
to deal.II User Group

Hello,

 

Does anyone know whether it is possible to create BlockSparseMatrix and BlockVector objects with a nested hierarchy of blocks?

 

I will give a concrete example to explain my question. I am interested to model a generalized case of Stokes flow in and around a droplet. My model is described by Eqs. (1), (2), (5) and (6) with the interface matching conditions Eqs. (9) and (10) in the attachment to the post https://groups.google.com/forum/#!topic/dealii/KbaZormL-Dk

For your convenience, the document is attached here again.

 

For simplicity, let’s assume for the moment that the second term in Eq. (9) is absent.

 

In contrast to what I wrote in the document, it now seems to me that a better way to order the primary degrees of freedom in the four blocks is {v_n, v_e, P_i, P_e}. As far as I understand, the resulting block system matrix would have zeros on the lower-right blocks that corresponds to the blocks {P_i, P_i},  {P_i, P_e},  {P_e, P_i}, and {P_e, P_e}. Another property of the matrix is that the off-diagonal blocks {v_n, v_e} and {v_e, v_n} are nonzero due to the interface matching condition for the velocity, Eq. (9).

 

In order to find the solution of the unknown block vector, I would like to follow step-22 and use the Schur complement. However, in order to do so, I should have access to “super-blocks” that each one of them is composed of 4 regular blocks of the BlockSparseMatrix system matrix. For example, the lower-right zero “super-block” is {P_i & P_e , P_i & P_e}. A similar type of access is also required for the BlockVector of unknowns.

 

Does dealii support this functionality?

If not, do you have another suggestion how to obtain the solution of the unknown block vector?

 

Thank you,

Oded


Interface matching conditions - 2.12.2016.pdf

Jean-Paul Pelteret

unread,
Dec 14, 2016, 5:01:48 AM12/14/16
to deal.II User Group
Dear Oded,

I think that the BlockMatrixArray class might offer the functionality that you're looking for? If so then I'm not quite sure what the equivalent class for the BlockVector would be. If there is none, then you have two options at this point:
(1) Manually construct a new BlockVector yourself (you'd basically concatenate blocks to form the superblocks)
(2) Author an equivalent class "BlockVectorArray". I think that this wouldn't be too difficult, because it would essentially mimic BlockMatrixArray but offer the functionality provided by the Vector classes. This might be a nice addition to deal.II, so I'm happy to help you with this if you'd like to give it a go.

Best,
J-P

Wolfgang Bangerth

unread,
Dec 14, 2016, 11:15:45 AM12/14/16
to dea...@googlegroups.com
On 12/14/2016 03:01 AM, Jean-Paul Pelteret wrote:
>
> I think that the BlockMatrixArray
> <https://www.dealii.org/8.4.1/doxygen/deal.II/classBlockMatrixArray.html>
> class might offer the functionality that you're looking for?

Yes, that's exactly the way to go: chop the matrix into its smallest
components, and then build them back together into large groups.


If so then I'm
> not quite sure what the equivalent class for the BlockVector would be. If
> there is none, then you have two options at this point:
> (1) Manually construct a new BlockVector yourself (you'd basically concatenate
> blocks to form the superblocks)
> (2) Author an equivalent class "BlockVectorArray". I think that this wouldn't
> be too difficult, because it would essentially mimic BlockMatrixArray but
> offer the functionality provided by the Vector classes. This might be a nice
> addition to deal.II, so I'm happy to help you with this if you'd like to give
> it a go.

That would indeed be very useful. This class has been missing for over a
decade already. (In other words, it is correct that there is no such class
currently.)

Best
W.


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

Oded Yaakobi

unread,
Dec 16, 2016, 12:37:14 PM12/16/16
to deal.II User Group, bang...@colostate.edu

Dear Jean-Paul and Wolfgang,

 

Thank you for your answers.

 

> I think that the BlockMatrixArray class might offer the functionality that you're looking for?

 

The class BlockMatrixArray is almost what I need, but there is still a hurdle. If I follow step-22, then I should have in my code a line that is analogous to the one that appears there:

 

A_preconditioner->initialize (system_matrix.block(0,0),

typename InnerPreconditioner<dim>::type::AdditionalData());

 

Note that the type of the first argument of the function “initialize” is:

const SparseMatrix< somenumber > &

 

However, in my case, the natural class of the argument that is available to me is BlockMatrixArray that is not derived from SparseMatrix.

 

It is not clear to me how to overcome this issue. Is there a way to transform a BlockMatrixArray object (which is composed of 2*2 SparseMatrix objects) to a SparseMatrix object?

 

I would be happy to know if you have any suggestions.

 

Best,

Oded

Jean-Paul Pelteret

unread,
Dec 20, 2016, 7:48:42 AM12/20/16
to deal.II User Group, bang...@colostate.edu
Hi Oded,

Have you managed to get anywhere with this? I have no particularly creative suggestions for this issue. The only thing I can think of is to derive a new class from SparseMatrix, which would contain your BlockMatrixArray as a member variable, and work with that. There is also the BlockLinearOperator class which appears to have a similar purpose as BlockMatrixArray, but I've never used it so can't comment further on it.

Best,
J-P

Oded Yaakobi

unread,
Dec 20, 2016, 3:09:38 PM12/20/16
to deal.II User Group

Hi Jean-Paul,

 

Thank you for your advises and interest in my problem.

 

Yesterday, I came up with an idea how to circumvent my problem. I simply, use a BlockSparseMatrix object to assemble my coupled generalized Stokes system matrix. I compose it from the following 2*2 blocks {V_V, V_P; P_V, P_P} where “V” stands for the six velocity components of v_n and v_e; and “P” stands for the two pressure components p_i and p_e. As far as I understand, the block P_P includes only zeros. Therefore, it should be relatively straightforward to follow the solution technique of step-22 with the Schur complement.  

 

I am still working on the implementation of my idea, and I hope that it will be successful.

 

Best,

Oded

Reply all
Reply to author
Forward
0 new messages