[petsc-users] Creating a larger matrix from submatrices

Anush Krishnan anush at bu.edu
Fri Nov 8 19:54:19 CST 2013


Hi all,

I'm trying to solve the Navier-Stokes equations on a staggered grid. I've
created three DA vectors U, V and P to store the values of the x- and
y-components of velocity and the pressure. Each of these has different
global dimensions. I have assembled matrices Gx and Gy to calculate each
component of the gradient of the pressure field:

Gx * P = Rx
Gy * P = Ry

Rx and Ry have the same lengths and distributed structures of U and V.

I would like to create matrix G and vector R such that

G*P = R

where

G = /Gx\
    \Gy/
and

R = /Rx\
    \Ry/

and vector R is created from the DMComposite of the DAs of U and V.

What would be the best way to go about doing this?

Thank you,
Anush
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20131108/dc2e5b61/attachment.html>


More information about the petsc-users mailing list