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
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
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