On 25/08/16 12:03, William Booker wrote:
Hi,
I now get the following error
File "compressible_stratified.py", line 137, in <module> print A.M.handle.getValues(1,1) File "PETSc/Mat.pyx", line 738, in petsc4py.PETSc.Mat.getValues (src/petsc4py.PETSc.c:121949) File "PETSc/petscmat.pxi", line 919, in petsc4py.PETSc.matgetvalues (src/petsc4py.PETSc.c:29292) petsc4py.PETSc.Error: error code 56 [0] MatGetValues() line 1845 in /tmp/pip-v0eIT6-build/src/mat/interface/matrix.c [0] No support for this operation for this object type [0] Mat type nest
Which values do you want? It is not clear to me. You have: A = assemble(a, nest=True) Which, because your functionspace is mixed with 2 components, is a 2x2 block matrix: A00 A01 A10 A11 Because you said nest=True, this is stored as 4 separate block matrices. Therefore getting values from the whole thing is not supported by PETSc. If you want the whole matrix A: A = assemble(a, nest=False) vals = A.M.values if you want the 00 block (in this case it doesn't matter if you build with nest=True or False) vals00 = A.M[0, 0].values etc... Lawrence