Using SUBSET_NONZERO_PATTERN with MatAXPY

David Knezevic david.knezevic at balliol.ox.ac.uk
Fri Mar 21 10:50:32 CDT 2008


Hello,

I've got a SeqBAIJ matrix A which I am reassembling at each time-step in 
order to solve a time-dependent PDE. I initially set up the sparsity 
pattern of A, and then assemble A at each time step by doing operations 
like the following:

ierr = MatZeroEntries(A);CHKERRQ(ierr);
ierr = MatAXPY(A,const1,B1,DIFFERENT_NONZERO_PATTERN);CHKERRQ(ierr);
ierr = MatAXPY(A,const2,B2,DIFFERENT_NONZERO_PATTERN);CHKERRQ(ierr);

This works fine. However, the sparsity patterns of B1, B2 etc should all 
be subsets of the sparsity pattern of A (which should be retained by 
MatZeroEntries). But changing DIFFERENT_NONZERO_PATTERN to 
SUBSET_NONZERO_PATTERN in the above code causes an error. In particular, 
the code runs fine for the first time step, but on the second time step 
I get the error:

[0]PETSC ERROR: --------------------- Error Message 
------------------------------------
[0]PETSC ERROR: Invalid argument!
[0]PETSC ERROR: Wrong type of object: Parameter # 3!
...
[0]PETSC ERROR: MatAXPY() line 34 in src/mat/utils/axpy.c

I found a description of the same problem here:
http://ganymed.iwr.uni-heidelberg.de/pipermail/dealii/2007/002066.html
but I haven't found an answer. Assistance would be most appreciated.

Best regards,
David





More information about the petsc-users mailing list