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

Reply via email to