still Schur complement

Kathrin Burckhardt tribur at
Mon Mar 17 07:20:09 CDT 2008

Dear all,

My problem, once again and more concrete:

I have given the local Schur matrices Si and I would like to set-up the 
global matrix S without assembling the Si on one processor.

I thought "MATIS" is the suitable matrix type, but I don't succeed in 
using it. My code is:

     IS is;
     ISCreateGeneral(PETSC_COMM_SELF, NPb, &uBId_global[0], &is);
     ISLocalToGlobalMapping mapping;
     ISLocalToGlobalMappingCreateIS(is, &mapping);
     Mat Stot;
     MatSetLocalToGlobalMapping(Stot, mapping);
    //or, alternatively
     for(int i=0; i<NPb; i++)
       for(int j=0; j<NPb; j++)
 	MatSetValuesLocal(Stot, 1, &i, 1, &j, &S(i+1,j+1), ADD_VALUES);

And I got the error

[1]PETSC ERROR: MatSetValuesLocal() line 1471 in 
[1]PETSC ERROR: --------------------- Error Message 
[1]PETSC ERROR: Object is in wrong state!
[1]PETSC ERROR: Object Type not set: Argument # 1!

Can you tell me what's wrong?

More information about the petsc-users mailing list