<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt; font-family: Verdana,Geneva,sans-serif'>
<p><span>Dear PETSc developers,</span></p>
<div>I have a matrix of the type MATMPIAIJ from which I want to extract small sub-matrices and sub-vectors (number of rows from 1 to 50 maximum) several times. This is a very fundamental step of a preconditioner that I'm writing. After that, I want to solve these sub-systems <span>locally</span><span>. </span></div>
<div> </div>
<div>In my current implementation I use MatGetSubMatrices with MAT_INITIAL_MATRIX to extract the sub-matrices and MatGetRow plus some other artifacts to extract the sub-vectors. However, I see that this procedure is too costly, once it creates and destroys the output variables each time they are called. I thought about using <span>the MAT_REUSE flag, but I can't since the nonzero pattern of the local sub-matrix may change from call to call.</span><span> </span></div>
<div> </div>
<div><span>Can you give me some hint on how to do this task efficiently? I</span><span> appreciate your help!</span></div>
<div> </div>
<div>-- <br />
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">Victor A. P. Magri - PhD student<br /> Dept. of Civil, Environmental and Architectural Eng.<br /> University of Padova<br /> Via Marzolo, 9 - 35131 Padova, Italy</div>
</div>
</body></html>