[petsc-dev] problem with DMGetInterpolation_DA_2D_Q1() for whoever was monkeying with it

Jed Brown jed at 59A2.org
Mon May 16 02:17:16 CDT 2011


On Sun, May 15, 2011 at 20:03, Barry Smith <bsmith at mcs.anl.gov> wrote:

>  Some people did an overhaul of DMGetInterpolation_DA_2D_Q1() a while ago
> either to handle new types of boundary conditions or to handle complicated
> mappings properly.  The also may have worked on the very nice
> src/dm/examples/tests/ex36.c test code


The error dates from revision 0. I don't know why it didn't show up in
earlier tests with ex36.

changeset:   19004:5e10ad9d193b
tag:         tip
user:        Jed Brown <jed at 59A2.org>
date:        Mon May 16 09:17:58 2011 +0200
files:       src/dm/impls/da/dainterp.c
description:
Fix ancient indexing bug in DMGetInterpolation_DA_2D_Q1


diff --git a/src/dm/impls/da/dainterp.c b/src/dm/impls/da/dainterp.c
--- a/src/dm/impls/da/dainterp.c
+++ b/src/dm/impls/da/dainterp.c
@@ -343,7 +343,7 @@
         cols[nc++] = col_shift + idx_c[col+m_ghost_c*dof]/dof;
       }
       /* one right and above */
-      if (j_c*ratioi != j && i_c*ratioj != i) {
+      if (i_c*ratioi != i && j_c*ratioj != j) {
         cols[nc++] = col_shift + idx_c[col+(m_ghost_c+1)*dof]/dof;
       }
       ierr = MatPreallocateSet(row,nc,cols,dnz,onz);CHKERRQ(ierr);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20110516/8c9cf389/attachment.html>


More information about the petsc-dev mailing list