Hi All,<br>I have a question as follows:<br><br>In order to use MatSetValuesBlocked() for a MPIAIJ matrix. I need to call MatSetBlockSize() when I create the matrix.<br><br>so I did the following. Here the blocksize = 5;<br>
<br><br>Mat *A;<br>....<br> MatCreate(MPI_COMM_WORLD,A);<br> MatSetSizes(*A,m*blocksize,n*blocksize,M*blocksize,N*blocksize);<br> MatSetType(*A,MATMPIAIJ);<br> MatSetBlockSize(*A,blocksize);<br> ierr=MatMPIAIJSetPreallocation(*A,0,ourlens_ptws,0,offlens_ptws); CHKERRQ(ierr); <br>
<br> ierr = MatAssemblyBegin(*A,MAT_FINAL_ASSEMBLY);CHKERRQ(ierr);<br> ierr = MatAssemblyEnd(*A,MAT_FINAL_ASSEMBLY);CHKERRQ(ierr); <br> PetscPrintf(PETSC_COMM_WORLD,"the bs BEFORE is %d\n", bs);<br> MatGetBlockSize(*A,&bs);<br>
<br> PetscPrintf(PETSC_COMM_WORLD,"the bs is %d\n", bs);<br> PetscPrintf(PETSC_COMM_WORLD,"the blocksize is %d\n", blocksize);<br>...<br><br>The output I get is:<br><br>the bs BEFORE is 0<br>the bs is 1<br>
the blocksize is 5<br><br><br>It seems like the Mat A does not absorb the information blocksize=5 at all. How should I make the function-call sequence correct, if I want to set a blocksize for the MPIAIJ. <br><br>Thanks for any suggestions in advance,<br>
<br>Yan<br>