<div class="gmail_quote">On Thu, Nov 4, 2010 at 10:39, Benjamin Sanderse <span dir="ltr"><<a href="mailto:B.Sanderse@cwi.nl">B.Sanderse@cwi.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div id=":4z5">I am using a finite volume method on structured grids and things are really simple.<br>
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:<br>
<br>
diagonal = (1/deltax)*ones(Nx,1);<br>
Dux_1D = spdiags([-diagonal diagonal],[0 1],Nx-1,Nx); % differencing matrix in 1D<br>
Dux_2D = kron(speye(Ny),Dux_1D));<br>
Dux_3D = kron(speye(Nz),Dux_2D));<br></div></blockquote><div><br></div><div>Just form the matrix, this isn't a good way to build it in parallel.</div><div><br></div><div>Jed</div></div>