How to assemble a block matrix from given (PETSc) matrices

Asked by jau on 2013-01-24

Hi,
I want to assemble a block matrix M, consiting of the four (already assembled) matrices A,B,C,D, i. e.
M = [A,B; C,D]
Is there any efficient and easy way to do this or should I rather assemble the entire system? In my current code (C++) I have already assembled the PETSc matrices A, B, C and D and want to solve the block system at once.

Thank you in advance!!

Question information

Language:
English Edit question
Status:
Solved
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Solved by:
Anders Logg
Solved:
2013-01-28
Last query:
2013-01-28
Last reply:
2013-01-26
Huadong GAO (mathsgao) said : #1

Hi,

I suggest you go to the following webpage

https://launchpad.net/cbc.block

it is about how to deal with block matrix.

jau (j-a-u) said : #2

Hi,
thanks for the hint. However, cbc.block seems to only support python, but my code is written in C++. Is there anything like cbc.block in C++ or any other way to handle block matrices?

Best Anders Logg (logg) said : #3

On Thu, Jan 24, 2013 at 04:20:56PM -0000, jau wrote:
> Question #220041 on DOLFIN changed:
> https://answers.launchpad.net/dolfin/+question/220041
>
> Status: Answered => Open
>
> jau is still having a problem:
> Hi, thanks for the hint. However, cbc.block seems to only support
> python, but my code is written in C++. Is there anything like
> cbc.block in C++ or any other way to handle block matrices?

Not at the moment.

--
Anders

jau (j-a-u) said : #4

Thanks Anders Logg, that solved my question.