<div dir="ltr">Hi PETSc team:<div><br></div><div>Is there a way to make precise matrix preallocation for an unstructured grid (I am not using the DMPlex object). Or do you have any example code for estimating the dnz & onz data?</div><div><br></div><div>On top of my head, I can do a two-phase calculation. I can first give a rough estimate and do one finite element assembly, then I will call MatGetRow to locate the column indices for nonzero entries. Then in the second step, I will destroy the Mat and create a new Mat with this obtained sparsity pattern.</div><div><br></div><div>Do you have any suggestions?</div><div><br></div><div>Thanks!</div><div><br></div><div>Luis</div></div>