still Schur complement

Kathrin Burckhardt tribur at vision.ee.ethz.ch
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;
     MatCreate(PETSC_COMM_WORLD,&Stot);
     MatSetLocalToGlobalMapping(Stot, mapping);
     MatSetSizes(Stot,NPb,NPb,NPb_tot,NPb_tot);
     MatSetType(Stot,MATIS);
    //or, alternatively
    //MatCreateIS(PETSC_COMM_WORLD,NPb,NPb,NPb_tot,NPb_tot,mapping,&Stot);
     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 
src/mat/interface/matrix.c
[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