<div dir="ltr">Dear all,<div><br></div><div>I am trying to form an approximation of the</div><div>Schur complement S = C-E'*(B\E) of a matrix</div><div>A = [B, E ; E', C]. Matrix C is stored as a </div><div>distributed Mat object while matrices B and E </div><div>are locally distributed to each processor (the </div><div>block partitioning comes from a Domain </div><div>Decomposition point-of-view). All matrices B, E,</div><div>and C are sparse.</div><div><br></div><div>I already have a sparse version of -E'*(B\E) </div><div>computed. Moreover, -E'*(B\E)  is block-diagonal.</div><div>The only issue now is how to merge (add) C and </div><div>-E'*(B\E). The way i do the addition right now is </div><div>based on checking every entry of -E'*(B\E) and, </div><div>if larger than a threshold value, add it to C using </div><div>the MatSetValue routine. The above is being done</div><div>in parallel for each diagonal block of -E'*(B\E).</div><div><br></div><div>The code works fine numerically but my approach </div><div>is too slow if -E'*(B\E) is not highly sparse.</div><div><br></div><div>I know that I can set many entries together by</div><div>using the MatSetValues routine but I am not</div><div>sure how to do it because the sparsity pattern of</div><div>each column of -E'*(B\E) differs. Maybe I can </div><div>assemble the sparsified Schur complement</div><div>column-by-column using MatSetValues but is</div><div>there any other idea perhaps?</div><div><br></div><div>Thanks ! :)</div></div>