<html aria-label="message body"><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div><br></div> Sorry, it looks like no one has gotten back to you yet.<div><br></div><div> We don't have a mechanism for providing your own CreateColoring() for a DM at this time. The DMShellSetXXX() functionality appears to be the best way to provide the functionality. This would require adding a C DMShellSetCreateColoring() function and then mirroring the functionality over to petsc4py as is done for other DMShellSetXXX functions. </div><div><br></div><div> As a side note, the various DMShellSetXXX() functions currently have an error checker that restricts their use to a DMSHELL. I am not sure that is needed or desirable in the PETSc source, and I suggest we remove it since it is sometimes legitimate to overwrite the default DM operation, as in your situation.</div><div><br></div><div> If this is something you would benefit from, consider making an MR that adds this functionality, or we can try to provide it.</div><div><br></div><div> Barry</div><div><br id="lineBreakAtBeginningOfMessage"><div><br><blockquote type="cite"><div>On Sep 11, 2025, at 7:25 PM, Eirik Jaccheri Høydalsvik via petsc-users <petsc-users@mcs.anl.gov> wrote:</div><br class="Apple-interchange-newline"><div><meta charset="UTF-8"><div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt;">Hi,<br><br>I have made a two-phase flow code which computes motion of two phases in one dimension, where the phases are allowed to intermix. This code relies on a finite difference Jacobian computed using the standard coloring I get from the DMDA object:<br><br> da = PETSc.DMDA().create(<o:p></o:p></span></div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt;"> dim=(N_vertical,),<o:p></o:p></span></div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt;"> dof=3,<o:p></o:p></span></div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt;"> stencil_width=1,<o:p></o:p></span></div><div style="margin: 0in; font-size: 12pt; font-family: Aptos, sans-serif;"><span style="font-size: 11pt;"> )<br><br>I now want to add a variable for the interphase height L_z in addition to a velocity u_v, giving the velocity of the vapor flowing in to the interface. The interface will move throughout the grid, meaning that these two variables will not be coupled to a fixed set of grid cells, but will be coupled to different sets of three grid cells throughout the simulation.<br><br>Questions:<br><br>1. Is it possible to create a custom coloring to efficiently compute the finite difference Jacobian including the interphase height and vapor velocity?<br><br>2. How do I revert to computing the full finite difference Jacobian with the purpose of testing if the interphase model works?<br><br>Best regards,<br>Eirik Jaccheri Høydalsvik<br>Sintef ER and NTNU EPT</span></div></div></div></blockquote></div><br></div></body></html>