<div dir="ltr"><div>Hello everyone,</div><div><br></div><div>I have a few quick questions on BAIJ matrix in petsc.</div><div><br></div><div>1) In the remark of the function MatCreateMPIBAIJWithArrays, it says " bs<span style="white-space:pre-wrap"> </span>- the block size, only a block size of 1 is supported". Why must the block size be 1? Is this a typo? </div><div><br></div><div><a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatCreateMPIBAIJWithArrays.html" target="_blank">http://www.mcs.anl.gov/petsc/<wbr>petsc-current/docs/<wbr>manualpages/Mat/<wbr>MatCreateMPIBAIJWithArrays.<wbr>html</a></div><div><br></div><div>2) In the Line 4040 of the implemention of MatCreateMPIBAIJWithArrays, would the matrix type be matmpibaij instead of matmpiSbaij?</div><div><br></div><a href="http://www.mcs.anl.gov/petsc/petsc-current/src/mat/impls/baij/mpi/mpibaij.c.html#MatCreateMPIBAIJWithArrays" target="_blank">http://www.mcs.anl.gov/petsc/<wbr>petsc-current/src/mat/impls/<wbr>baij/mpi/mpibaij.c.html#<wbr>MatCreateMPIBAIJWithArrays</a><br><div><br></div><div><div>4031: PetscErrorCode  MatCreateMPIBAIJWithArrays(<wbr>MPI_Comm comm,PetscInt bs,PetscInt m,PetscInt n,PetscInt M,PetscInt N,const PetscInt i[],const PetscInt j[],const PetscScalar a[],Mat *mat)</div><div>4032: {</div><div><br></div><div>4036:   if (i[0]) SETERRQ(PETSC_COMM_SELF,PETSC_<wbr>ERR_ARG_OUTOFRANGE,"i (row indices) must start with 0");</div><div>4037:   if (m < 0) SETERRQ(PETSC_COMM_SELF,PETSC_<wbr>ERR_ARG_OUTOFRANGE,"local number of rows (m) cannot be PETSC_DECIDE, or negative");</div><div>4038:   MatCreate(comm,mat);</div><div>4039:   MatSetSizes(*mat,m,n,M,N);</div><div>4040:   MatSetType(*mat,MATMPISBAIJ);</div><div>4041:   MatSetOption(*mat,MAT_ROW_<wbr>ORIENTED,PETSC_FALSE);</div><div>4042:   MatMPIBAIJSetPreallocationCSR(<wbr>*mat,bs,i,j,a);</div><div>4043:   MatSetOption(*mat,MAT_ROW_<wbr>ORIENTED,PETSC_TRUE);</div><div>4044:   return(0);</div><div>4045: }</div></div><div><br></div><div>3) I want to create a petsc matrix M equivalent to the sum of two block csr matrix/array (M1csr, M2csr). What is the best way to achieve it? I am thinking of created two petsc baij matrix (M1baij and M2baij) by calling <wbr>MatCreateMPIBAIJWithArrays twice and then call MATAXPY to get the sum M=M1baij + M2baij. Is there a better way to do it?</div><div><br></div><div>Thank you.</div><div><br></div><div>Best,</div><div>Xiangdong</div></div>