[petsc-users] kronecker products

Jed Brown jed at 59A2.org
Thu Nov 4 17:23:11 CDT 2010


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

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

Just form the matrix, this isn't a good way to build it in parallel.

Jed
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20101104/5048d22b/attachment.htm>


More information about the petsc-users mailing list