On Tue, 9 Nov 2010, Jed Brown wrote:
On Tue, Nov 9, 2010 at 14:41, Tim Kroeger <[email protected]> wrote: I had a look into src/mat/impls/submat/submat.c (of petsc-3.1-p4) and found that MatMultAdd_SubMatrix() internally calls MatMult() (line 155), not MatMultAdd(). Later in that method, some VecAYPX() is called (line 159), which might do the required addition. Can you please confirm whether
Ah, I missed that you called MatGetSubMatrix on a MatShell in which you hadn't implemented MatGetSubMatrix, therefore you had a MatSubMatrix.
Sorry for not pointing this our more clearly.
Looking at MatMultAdd_SubMatrix, I see that the code is wrong if v2==v3. We don't have "weighted scatters", so I think it needs to get another work vector for a correct answer with "left scaling" and v2==v3. I'll fix this in 3.1 and -dev, but I might not get to it today.
Okay, I implemented a workaround on user side (using a temporary vector and MatMult()). This seems to resolve the problem now. I'll leave it like this in the libMesh part, so that libMesh remains compatible with PETSc-3.1-p4. Nevertheless, if you fix this within a few days and launch PETSc-3.1-p5 with this fix (or just send me a patch), let me know, I can then test it. Best Regards, Tim -- Dr. Tim Kroeger CeVis -- Center of Complex Systems and Visualization University of Bremen [email protected] Universitaetsallee 29 [email protected] D-28359 Bremen Phone +49-421-218-7710 Germany Fax +49-421-218-4236