<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">Florian:<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
However, trying to preallocate C, which is of type MATSBAIJ fails for me:<br>
<br>
ierr = MatSeqSBAIJSetPreallocation(_matrixC.matrix, n, n, NULL);<br></blockquote><div> ^ </div><div>The 2nd input parameter is block size:</div><div>MatSeqSBAIJSetPreallocation(Mat B,PetscInt bs,PetscInt nz,const PetscInt nnz[]) </div><div>You input block size bs=n, which I guess should be 1.<br></div><div><br></div><div>Hong</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
results in:<br>
<br>
[0]PETSC ERROR: Arguments are incompatible<br>
[0]PETSC ERROR: Cannot change block size 1 to 503<br>
<br>
What would you advise me to do here? How can I make the KSPSolve faster when it is a dense matrix?<br>
<br>
I could guess the preallocation. Create a list of possible basis functions and if they produce sparse or dense matrices. Preallocate full or select MATDENSE type for dense matrices.<br>
<br>
Any ideas?<br>
<br>
Thanks a lot,<br>
Florian<br>
<br>
</blockquote></div><br></div></div>