<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<div class="">
<div class="">Matt and Dave,</div>
<div class=""><br class="">
</div>
<div class="">Thanks, this is consistent with what we found. If Patrick or someone can add some basic coloring option with DMStag, that would be very useful for our project.</div>
<div class=""><br class="">
</div>
<div class="">Qi</div>
<div class=""></div>
<div class=""><br class="">
</div>
<br class="Apple-interchange-newline">
</div>
<div><br class="">
<blockquote type="cite" class="">
<div class="">On Dec 13, 2021, at 11:52 AM, Dave May <<a href="mailto:dave.mayhem23@gmail.com" class="">dave.mayhem23@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class=""><br class="Apple-interchange-newline">
<br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; 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;" class="">
<div class="gmail_quote" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; 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 dir="ltr" class="gmail_attr">On Mon, 13 Dec 2021 at 19:29, Matthew Knepley <<a href="mailto:knepley@gmail.com" class="">knepley@gmail.com</a>> wrote:<br class="">
</div>
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">
<div dir="ltr" class="">
<div dir="ltr" class="">On Mon, Dec 13, 2021 at 1:16 PM Dave May <<a href="mailto:dave.mayhem23@gmail.com" target="_blank" class="">dave.mayhem23@gmail.com</a>> wrote:<br class="">
</div>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">
<div class=""><br class="">
</div>
<div class=""><br class="">
<div class="gmail_quote">
<div dir="ltr" class="">On Sat 11. Dec 2021 at 22:28, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank" class="">knepley@gmail.com</a>> wrote:<br class="">
</div>
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">
<div dir="ltr" class="">
<div dir="ltr" class="">On Sat, Dec 11, 2021 at 1:58 PM Tang, Qi <<a href="mailto:tangqi@msu.edu" target="_blank" class="">tangqi@msu.edu</a>> wrote:<br class="">
</div>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">
<div class="">
<div class="">
<div class="">Hi,</div>
<div class="">Does anyone have comment on finite difference coloring with DMStag? We are using DMStag and TS to evolve some nonlinear equations implicitly. It would be helpful to have the coloring Jacobian option with that.</div>
</div>
</div>
</blockquote>
<div class=""><br class="">
</div>
<div class="">Since DMStag produces the Jacobian connectivity,<span class="Apple-converted-space"> </span></div>
</div>
</div>
</blockquote>
<div dir="auto" class=""><br class="">
</div>
<div dir="auto" class="">This is incorrect.</div>
<div dir="auto" class="">The DMCreateMatrix implementation for DMSTAG only sets the number of nonzeros (very inaccurately). It does not insert any zero values and thus the nonzero structure is actually not defined. </div>
<div dir="auto" class="">That is why coloring doesn’t work.</div>
</div>
</div>
</blockquote>
<div class=""><br class="">
</div>
<div class="">Ah, thanks Dave.</div>
<div class=""><br class="">
</div>
<div class="">Okay, we should fix that.It is perfectly possible to compute the nonzero pattern from the DMStag information.</div>
</div>
</div>
</blockquote>
<div class=""><br class="">
</div>
<div class="">Agreed. The API for DMSTAG is complete enough to enable one to<br class="">
</div>
<div class="">loop over the cells, and for all quantities defined on the cell (centre, face, vertex),<span class="Apple-converted-space"> </span><br class="">
</div>
<div class="">insert values into the appropriate slot in the matrix.<span class="Apple-converted-space"> </span><br class="">
</div>
<div class="">Combined with MATPREALLOCATOR, I believe a compact and readable</div>
<div class="">code should be possible to write for the preallocation (cf DMDA).</div>
<div class=""><br class="">
</div>
<div class="">I think the only caveat with the approach of using all quantities defined on the cell is<span class="Apple-converted-space"> </span><br class="">
</div>
<div class="">It may slightly over allocate depending on how the user wishes to impose the boundary condition,</div>
<div class="">or slightly over allocate for says Stokes where there is no pressure-pressure coupling term.<br class="">
</div>
<br class="">
<div class="">Thanks,</div>
<div class="">Dave<br class="">
</div>
<div class=""><br class="">
</div>
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">
<div dir="ltr" class="">
<div class="gmail_quote">
<div class=""><br class="">
</div>
<div class="">Paging Patrick :)</div>
<div class=""><br class="">
</div>
<div class="">  Thanks,</div>
<div class=""><br class="">
</div>
<div class="">    Matt</div>
<div class=""> </div>
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">
<div class="">
<div class="gmail_quote">
<div dir="auto" class="">Thanks,</div>
<div dir="auto" class="">Dave</div>
<div dir="auto" class=""><br class="">
</div>
<div dir="auto" class=""><br class="">
</div>
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">
<div dir="ltr" class="">
<div class="gmail_quote">
<div class="">you can use -snes_fd_color_use_mat. It has many options. Here is an example of us using that:</div>
<div class=""><br class="">
</div>
<div class="">  <a href="https://urldefense.com/v3/__https://gitlab.com/petsc/petsc/-/blob/main/src/snes/tutorials/ex19.c*L898__;Iw!!HXCxUKc!h_StfE5Flul2AzB6sJ3ooEa2GBhV-GZ4s8KWEB2soynkpcpilsVmmHUbsYezUA$" target="_blank" class="">https://gitlab.com/petsc/petsc/-/blob/main/src/snes/tutorials/ex19.c#L898</a></div>
<div class=""><br class="">
</div>
<div class="">  Thanks,</div>
<div class=""><br class="">
</div>
<div class="">     Matt</div>
</div>
</div>
<div dir="ltr" class="">
<div class="gmail_quote">
<div class=""> </div>
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">
<div class="">
<div class="">
<div class="">Thanks,</div>
<div class="">Qi</div>
<br class="">
</div>
<div class=""><br class="">
<blockquote type="cite" class="">
<div class="">On Oct 15, 2021, at 3:07 PM, Jorti, Zakariae via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank" class="">petsc-users@mcs.anl.gov</a>> wrote:</div>
<br class="">
<div class="">
<div id="gmail-m_7696459302862227828gmail-m_-9165402783976890343m_-4991657993501344730gmail-m_5615423000566682887divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none; font-family: Calibri, Helvetica, sans-serif;" class="">
<div style="margin-top: 0px; margin-bottom: 0px;" class="">Hello,</div>
<div style="margin-top: 0px; margin-bottom: 0px;" class=""><br class="">
</div>
<div style="margin-top: 0px; margin-bottom: 0px;" class="">Does the Jacobian approximation <span style="font-size: 12pt;" class="">using coloring and finite differencing of the function evaluation work in DMStag? </span><span style="font-size: 12pt;" class="">  </span></div>
<div style="margin-top: 0px; margin-bottom: 0px;" class="">Thank you.</div>
<div style="margin-top: 0px; margin-bottom: 0px;" class="">Best regards,</div>
<div style="margin-top: 0px; margin-bottom: 0px;" class=""><br class="">
</div>
<div style="margin-top: 0px; margin-bottom: 0px;" class="">Zakariae </div>
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</blockquote>
</div>
<br clear="all" class="">
<div class=""><br class="">
</div>
--<span class="Apple-converted-space"> </span><br class="">
<div dir="ltr" class="">
<div dir="ltr" class="">
<div class="">
<div dir="ltr" class="">
<div class="">
<div dir="ltr" class="">
<div class="">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br class="">
-- Norbert Wiener</div>
<div class=""><br class="">
</div>
<div class=""><a href="https://urldefense.com/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!HXCxUKc!h_StfE5Flul2AzB6sJ3ooEa2GBhV-GZ4s8KWEB2soynkpcpilsVmmHUXuu3a8g$" target="_blank" class="">https://www.cse.buffalo.edu/~knepley/</a><br class="">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</blockquote>
</div>
<br clear="all" class="">
<div class=""><br class="">
</div>
--<span class="Apple-converted-space"> </span><br class="">
<div dir="ltr" class="">
<div dir="ltr" class="">
<div class="">
<div dir="ltr" class="">
<div class="">
<div dir="ltr" class="">
<div class="">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br class="">
-- Norbert Wiener</div>
<div class=""><br class="">
</div>
<div class=""><a href="https://urldefense.com/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!HXCxUKc!h_StfE5Flul2AzB6sJ3ooEa2GBhV-GZ4s8KWEB2soynkpcpilsVmmHUXuu3a8g$" target="_blank" class="">https://www.cse.buffalo.edu/~knepley/</a></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</blockquote>
</div>
<br class="">
</body>
</html>