[petsc-users] kronecker products

Benjamin Sanderse B.Sanderse at cwi.nl
Thu Nov 4 10:39:00 CDT 2010

I am using a finite volume method on structured grids and things are really simple.
To give you an idea, here is the matrix that calculates du/dx, given a vector with u. For simplicity I use the Matlab way to construct such a thing: 

diagonal       = (1/deltax)*ones(Nx,1);
Dux_1D         = spdiags([-diagonal diagonal],[0 1],Nx-1,Nx); % differencing matrix in 1D
Dux_2D         = kron(speye(Ny),Dux_1D));
Dux_3D         = kron(speye(Nz),Dux_2D));

Here Nx is the number of points in x-direction, Ny in y-direction, and so on. For simplicity I took a uniform Cartesian grid and did not take boundary conditions into account.
Other operators, e.g. involving cross derivatives, are more complicated, but the basic idea should be clear. Notice that here the extension to multi-D is simply with an identity matrix, so both matrices in the kron command are really sparse. 


----- Original Message -----
From: "Jed Brown" <jed at 59A2.org>
To: "PETSc users list" <petsc-users at mcs.anl.gov>
Sent: Thursday, November 4, 2010 4:25:58 PM
Subject: Re: [petsc-users] kronecker products

On Thu, Nov 4, 2010 at 10:18, Benjamin Sanderse <B.Sanderse at cwi.nl> wrote:

> I am not sure if I understand you correctly. During initialization, several
> matrices are formed by kronecker products, and the resulting matrices have
> the size of the number of unknowns; i.e. if n is the number of unknowns then
> the matrices are n x n, although they typically have only a*n nonzero
> elements, with a around 10-20.

I'm curious about the structure of these kronecker products.  For example,
you may have

K = A \otimes B

Is either one of A or B dense?  Are they both large and distributed, or is
one much smaller than the other?  If they are both distributed, what
distribution do you want the vector to have?

A different question is, what problem are you solving?  E.g. if this is a
Galerkin method for stochastic PDE, it gives us some idea about the
structure, and the natural follow-up question is what is the size of the
(reduced how?) stochastic space, and do the stochastic basis functions have
local or global support.


More information about the petsc-users mailing list