<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Jan 17, 2014 at 5:43 AM, Stephan Kramer <span dir="ltr"><<a href="mailto:s.kramer@imperial.ac.uk" target="_blank">s.kramer@imperial.ac.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Okay, I have checked in preliminary code. It passes the tests for Mat ex18. I have merged it to next. Let me know how<br>
it works for you.<br>
<br>
   Thanks,<br>
<br>
      Matt<br>
<br>
</blockquote>
<br></div>
I've tried it out with various configurations of the test and it seems to work fine for me. I did first hit a segfault due to the uninitialised len variable, but I see that's fixed now. I've also tried it out in our own code (Fluidity) for what we actually want to use it for (getting rid of the ugly hack of setting bcs with big numbers on the diagonal) and it passes all tests. So thanks a lot for your effort: this is very useful for us.<br>

<br>
I think it might be worth it changing the blocksize bs in the example to something bigger than 1, so we test non-trivial block-sizes? Also the nonlocalBC variable is uninitialised. I actually found a bug in my test if you set nonlocalBC = PETSC_TRUE with rank>3. I've pasted the diff below<br>
</blockquote><div><br></div><div>I have made these fixes, added more tests, and put it in the nightly builds.</div><div><br></div><div>  Thanks,</div><div><br></div><div>     Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Cheers<br>
Stephan<br>
<br>
diff --git a/src/mat/examples/tests/ex18.<u></u>c b/src/mat/examples/tests/ex18.<u></u>c<br>
index 2d9ef25..40f3b9e 100644<br>
--- a/src/mat/examples/tests/ex18.<u></u>c<br>
+++ b/src/mat/examples/tests/ex18.<u></u>c<br>
@@ -9,12 +9,12 @@ int main(int argc,char **args)<br>
 {<br>
   Mat            A;<br>
   Vec            x, rhs, y;<br>
-  PetscInt       i,j,k,b,m = 3,n,nlocal=2,bs=1,Ii,J;<br>
+  PetscInt       i,j,k,b,m = 3,n,nlocal=2,bs=2,Ii,J;<br>
   PetscInt       *boundary_nodes, nboundary_nodes, *boundary_indices;<br>
   PetscMPIInt    rank,size;<br>
   PetscErrorCode ierr;<br>
   PetscScalar    v,v0,v1,v2,a0=0.1,a,rhsval, *boundary_values;<br>
-  PetscBool      upwind = PETSC_FALSE, nonlocalBC;<br>
+  PetscBool      upwind = PETSC_FALSE, nonlocalBC = PETSC_TRUE;<br>
<br>
   ierr = PetscInitialize(&argc,&args,(<u></u>char*)0,help);CHKERRQ(ierr);<br>
   ierr = MPI_Comm_rank(PETSC_COMM_<u></u>WORLD,&rank);CHKERRQ(ierr);<br>
@@ -80,11 +80,15 @@ int main(int argc,char **args)<br>
       ierr = PetscMalloc1(nboundary_nodes,&<u></u>boundary_nodes);CHKERRQ(ierr);<br>
       k = 0;<br>
       for (i=size; i<m; i++,k++) {boundary_nodes[k] = n*i;};<br>
-    } else {<br>
-      nboundary_nodes = nlocal+1;<br>
+    } else if (rank<m) {<br>
+      nboundary_nodes = nlocal + 1;<br>
       ierr = PetscMalloc1(nboundary_nodes,&<u></u>boundary_nodes);CHKERRQ(ierr);<br>
       boundary_nodes[0] = rank*n;<br>
       k = 1;<br>
+    } else {<br>
+      nboundary_nodes = nlocal;<br>
+      ierr = PetscMalloc1(nboundary_nodes,&<u></u>boundary_nodes);CHKERRQ(ierr);<br>
+      k = 0;<br>
     };<br>
     for (j=nlocal*rank; j<nlocal*(rank+1); j++,k++) {boundary_nodes[k] = j;};<br>
   } else {<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener
</div></div>