<div class="gmail_quote">On Thu, Jun 16, 2011 at 14:08, Alexander Grayver <span dir="ltr"><<a href="mailto:agrayver@gfz-potsdam.de">agrayver@gfz-potsdam.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div bgcolor="#ffffff" text="#000000">This matrix is rather grid o values.<br></div></blockquote><div><br></div><div>Okay, then you can manage it with a DA (DMDA in petsc-dev). This will give a better parallel distribution and give you access to entries in convenient ways (e.g. using arrays). See the section of the user's manual Structured Grids Using Distributed Arrays.</div>
<div><br></div><div>In PETSc, the Mat type is for linear operators. A Mat might represent a transformation from one of your grids to another. A given state on the grid is given by a Vec, and DMDA will help you manage that.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div bgcolor="#ffffff" text="#000000">
The operation is very simply, it's scalar. Let's say we have this
matrix A of size MxN and I want to apply thw following operation to
each element of the matrix:<br>
<br>
A(i,j) = log( (A(i,j) - a(j)) / (b(j) - A(i,j)) ), <br>
i=0..M-1 j=0..N-1<br>
<br>
the vectors a,b are just arrays size of N and have them on each
processor. </div></blockquote></div><br><div>This will be very easy using DMDA.</div>