Hello to everyone,<br><br>I&#39;ve been working for some time on this piece of code for estimating large-scale and general jacobian matrices via finite differences whose sparsity patterns can be determined a priori. It basically uses a parallel graph coloring heuristic to find a good vertex coloring for the column intersection graph relative to the jacobian matrix at hand.<br>
<br>Now, I&#39;d like to integrate that code into PETSc, but the problem is that I don&#39;t know exactly how. So after spending a lot of time sifting through and trying to grasp &quot;the logic&quot; of PETSc source code, especially, the source code to the MatFDColoring module, I came up with a &quot;tacky&quot; solution proposal: firstly, I would call my code in order to obtain the coloring in parallel, and then I would have a routine (which would have to be embedded in PETSc code base) that, on each processor, would build the &quot;MatFDColoring&quot; data structure based on two things, the coloring found and the sparsity pattern of the jacobian matrix in question.<br>
<br>It seems to me that this might work out, though I&#39;m not entirely sure. What do you guys think? Is there an easier and/or more &quot;elegant&quot; way to do this?<br><br>Thanks in advance,<br><br>Rafael<br>