<html>
<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;">
Hi Joe
<div><br>
</div>
<div>I don’t think this function will work for me since it extract particles cell-wise. However, I think I can use this function as basis to build what I have in mind… </div>
<div><br>
</div>
<div>Thanks,</div>
<div>Miguel</div>
<div><br>
</div>
<div>
<div><br>
<blockquote type="cite">
<div>On May 8, 2025, at 6:43 PM, Joseph Pusztay <josephpu@buffalo.edu> wrote:</div>
<br class="Apple-interchange-newline">
<div>
<div class="elementToProof" style="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; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt;">
Hi Miguel,</div>
<div class="elementToProof" style="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; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt;">
<br>
</div>
<div class="elementToProof" style="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; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt;">
I believe what you may be looking for is DMSwarmGetCellSwarm which extracts the fields from the swarm for a specified cell</div>
<div class="elementToProof" style="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; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt;">
<br>
</div>
<div class="elementToProof" style="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; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt;">
 <a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/DMSwarm/DMSwarmGetCellSwarm/__;!!G_uCfscf7eWS!cwnn3sRq7di9mEjZz_VPpuzbpto02sSR7pko8ndG7obAmHU1vHXnI8cShm67H2Js9wkWYo1ieIXb4e6qjjIOng$" id="LPlnk824560">https://petsc.org/release/manualpages/DMSwarm/DMSwarmGetCellSwarm/</a></div>
<div class="elementToProof" style="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; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt;">
<br>
</div>
<div class="elementToProof" style="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; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt;">
Best,</div>
<div class="elementToProof" style="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; font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt;">
Joe</div>
<div id="appendonsend" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; 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>
<hr tabindex="-1" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; display: inline-block; width: 1464.109375px;">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; 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; float: none; display: inline !important;"></span>
<div id="divRplyFwdMsg" dir="ltr" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; 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;">
<font face="Calibri, sans-serif" style="font-size: 11pt;"><b>From:</b><span class="Apple-converted-space"> </span>MIGUEL MOLINOS PEREZ <<a href="mailto:mmolinos@us.es">mmolinos@us.es</a>><br>
<b>Sent:</b><span class="Apple-converted-space"> </span>Thursday, May 8, 2025 10:22 AM<br>
<b>To:</b><span class="Apple-converted-space"> </span>Matthew Knepley <<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>><br>
<b>Cc:</b><span class="Apple-converted-space"> </span><a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a><span class="Apple-converted-space"> </span><<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>>; Joseph Pusztay <<a href="mailto:josephpu@buffalo.edu">josephpu@buffalo.edu</a>><br>
<b>Subject:</b><span class="Apple-converted-space"> </span>Re: [petsc-users] Problems with the null-space removal</font>
<div> </div>
</div>
<div style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; 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; line-break: after-white-space;">
<table border="0" cellspacing="0" cellpadding="0" width="100%" align="left" style="background: revert !important; bottom: revert !important; color: revert !important; direction: revert !important; font-size: revert !important; height: revert !important; letter-spacing: revert !important; line-height: revert !important; margin: revert !important; opacity: revert !important; order: revert !important; outline: revert !important; overflow: revert !important; padding: revert !important; position: revert !important; tab-size: revert !important; text-align: revert !important; text-indent: revert !important; text-orientation: revert !important; text-overflow: revert !important; text-transform: revert !important; top: revert !important; vertical-align: revert !important; visibility: revert !important; white-space: revert !important; word-break: revert !important; word-spacing: revert !important; writing-mode: revert !important; zoom: revert !important; border: 0px !important; display: table !important; width: 1494px; table-layout: fixed !important; float: none !important; border-spacing: 0px !important;">
<tbody style="background: revert !important; border: revert !important; bottom: revert !important; color: revert !important; direction: revert !important; font-size: revert !important; height: revert !important; letter-spacing: revert !important; line-height: revert !important; margin: revert !important; opacity: revert !important; order: revert !important; outline: revert !important; overflow: revert !important; padding: revert !important; position: revert !important; tab-size: revert !important; table-layout: revert !important; text-align: revert !important; text-indent: revert !important; text-orientation: revert !important; text-overflow: revert !important; text-transform: revert !important; top: revert !important; vertical-align: revert !important; visibility: revert !important; white-space: revert !important; width: revert !important; word-break: revert !important; word-spacing: revert !important; writing-mode: revert !important; zoom: revert !important; display: block !important;">
<tr style="background: revert !important; border: revert !important; bottom: revert !important; color: revert !important; direction: revert !important; display: revert !important; font-size: revert !important; height: revert !important; letter-spacing: revert !important; line-height: revert !important; margin: revert !important; opacity: revert !important; order: revert !important; outline: revert !important; overflow: revert !important; padding: revert !important; position: revert !important; tab-size: revert !important; table-layout: revert !important; text-align: revert !important; text-indent: revert !important; text-orientation: revert !important; text-overflow: revert !important; text-transform: revert !important; top: revert !important; vertical-align: revert !important; visibility: revert !important; white-space: revert !important; width: revert !important; word-break: revert !important; word-spacing: revert !important; writing-mode: revert !important; zoom: revert !important;">
<td valign="middle" width="1px" bgcolor="#A6A6A6" cellpadding="7px 2px 7px 2px" style="background-image: revert !important; background-position: revert !important; background-size: revert !important; background-repeat: revert !important; background-attachment: revert !important; background-origin: revert !important; background-clip: revert !important; border: revert !important; bottom: revert !important; color: revert !important; direction: revert !important; display: revert !important; font-size: revert !important; height: revert !important; letter-spacing: revert !important; line-height: revert !important; margin: revert !important; opacity: revert !important; order: revert !important; outline: revert !important; overflow: revert !important; position: revert !important; tab-size: revert !important; table-layout: revert !important; text-align: revert !important; text-indent: revert !important; text-orientation: revert !important; text-overflow: revert !important; text-transform: revert !important; top: revert !important; vertical-align: revert !important; visibility: revert !important; white-space: revert !important; word-break: revert !important; word-spacing: revert !important; writing-mode: revert !important; zoom: revert !important; padding: 7px 2px !important; background-color: rgb(166, 166, 166) !important; width: 0px !important;">
</td>
<td valign="middle" width="100%" bgcolor="#EAEAEA" cellpadding="7px 5px 7px 15px" style="background-image: revert !important; background-position: revert !important; background-size: revert !important; background-repeat: revert !important; background-attachment: revert !important; background-origin: revert !important; background-clip: revert !important; border: revert !important; bottom: revert !important; direction: revert !important; display: revert !important; height: revert !important; letter-spacing: revert !important; line-height: revert !important; margin: revert !important; opacity: revert !important; order: revert !important; outline: revert !important; overflow: revert !important; position: revert !important; tab-size: revert !important; table-layout: revert !important; text-indent: revert !important; text-orientation: revert !important; text-overflow: revert !important; text-transform: revert !important; top: revert !important; vertical-align: revert !important; visibility: revert !important; white-space: revert !important; word-break: revert !important; word-spacing: revert !important; writing-mode: revert !important; zoom: revert !important; width: 1460px; background-color: rgb(234, 234, 234) !important; padding: 7px 5px 7px 15px !important; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif !important; font-size: 12px !important; font-weight: normal !important; color: rgb(33, 33, 33) !important; text-align: left !important; overflow-wrap: break-word !important;">
<div style="background: revert !important; border: revert !important; bottom: revert !important; color: revert !important; direction: revert !important; display: revert !important; font-size: revert !important; height: revert !important; letter-spacing: revert !important; line-height: revert !important; margin: revert !important; opacity: revert !important; order: revert !important; outline: revert !important; overflow: revert !important; padding: revert !important; position: revert !important; tab-size: revert !important; table-layout: revert !important; text-align: revert !important; text-indent: revert !important; text-orientation: revert !important; text-overflow: revert !important; text-transform: revert !important; top: revert !important; vertical-align: revert !important; visibility: revert !important; white-space: revert !important; width: revert !important; word-break: revert !important; word-spacing: revert !important; writing-mode: revert !important; zoom: revert !important;">
You don't often get email from<span class="Apple-converted-space"> </span><a href="mailto:mmolinos@us.es">mmolinos@us.es</a>.<span class="Apple-converted-space"> </span><a href="https://urldefense.us/v3/__https://aka.ms/LearnAboutSenderIdentification__;!!G_uCfscf7eWS!cwnn3sRq7di9mEjZz_VPpuzbpto02sSR7pko8ndG7obAmHU1vHXnI8cShm67H2Js9wkWYo1ieIXb4e7o0gso8g$" style="background: revert !important; color: revert !important; direction: revert !important; display: revert !important; font-size: revert !important; opacity: revert !important; visibility: revert !important;">Learn
 why this is important</a></div>
</td>
<td valign="middle" align="left" width="75px" bgcolor="#EAEAEA" cellpadding="7px 5px 7px 5px" style="background-image: revert !important; background-position: revert !important; background-size: revert !important; background-repeat: revert !important; background-attachment: revert !important; background-origin: revert !important; background-clip: revert !important; border: revert !important; bottom: revert !important; direction: revert !important; display: revert !important; height: revert !important; letter-spacing: revert !important; line-height: revert !important; margin: revert !important; opacity: revert !important; order: revert !important; outline: revert !important; overflow: revert !important; position: revert !important; tab-size: revert !important; table-layout: revert !important; text-indent: revert !important; text-orientation: revert !important; text-overflow: revert !important; text-transform: revert !important; top: revert !important; vertical-align: revert !important; visibility: revert !important; white-space: revert !important; word-break: revert !important; word-spacing: revert !important; writing-mode: revert !important; zoom: revert !important; width: 75px !important; background-color: rgb(234, 234, 234) !important; padding: 7px 5px !important; font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif !important; font-size: 12px !important; font-weight: normal !important; color: rgb(33, 33, 33) !important; text-align: left !important; overflow-wrap: break-word !important;">
</td>
</tr>
</tbody>
</table>
<div>This function “ DMSwarmCreatreSubswarm” is published somewhere? I can’t find it in the main branch of PETSc.
<div><br>
</div>
<div>Thanks,</div>
<div>Miguel<br>
<div><br>
<blockquote type="cite">
<div>On May 6, 2025, at 9:03 AM, MIGUEL MOLINOS PEREZ <mmolinos@us.es> wrote:</div>
<br class="x_Apple-interchange-newline">
<div>
<div style="line-break: after-white-space;">
<blockquote type="cite">
<div dir="ltr">
<div class="x_gmail_quote x_gmail_quote_container">Oh, so you want to turn off some Swarm nodes? Joe has a DMSwarmCreatreSubswarm() function somewhere. This might work.</div>
</div>
</blockquote>
<div>
<div dir="ltr">
<div class="x_gmail_quote x_gmail_quote_container"><br>
</div>
<div class="x_gmail_quote x_gmail_quote_container">This would be awesome! </div>
<div class="x_gmail_quote x_gmail_quote_container"><br>
</div>
<div class="x_gmail_quote x_gmail_quote_container">Thanks,</div>
<div class="x_gmail_quote x_gmail_quote_container">Miguel</div>
</div>
</div>
<div><br>
<blockquote type="cite">
<div>On 5 May 2025, at 21:43, Matthew Knepley <knepley@gmail.com> wrote:</div>
<br class="x_Apple-interchange-newline">
<div>
<div dir="ltr">
<div dir="ltr">On Mon, May 5, 2025 at 2:08 PM MIGUEL MOLINOS PEREZ <<a href="mailto:mmolinos@us.es">mmolinos@us.es</a>> wrote:</div>
<div class="x_gmail_quote x_gmail_quote_container">
<blockquote class="x_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>Hi Matt, thank you for your response!<br id="x_m_-1640743572746169310lineBreakAtBeginningOfMessage">
<div><br>
<blockquote type="cite">
<div>
<div dir="ltr">
<div class="x_gmail_quote">
<div>The most likely thing is that the nullspace is slightly wrong, or the convergence test is not accounting for the nullspace somehow.</div>
<div><br>
</div>
<div>However, since so many equations are inactive, I would consider projecting the problem. I might either</div>
<div><br>
</div>
<div>1) Select a subset of the mesh to phrase the problem on. In you use DMPlex, you could use DMPlexFilter().</div>
</div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>I’am using a DMSwarm mesh so I can’t use this function.</div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>Oh, so you want to turn off some Swarm nodes? Joe has a DMSwarmCreatreSubswarm() function somewhere. This might work.</div>
<div> </div>
<blockquote class="x_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>
<div>
<blockquote type="cite">
<div>
<div dir="ltr">
<div class="x_gmail_quote">
<div>2) Use a constraint to get a subsystem for Newton using SNESVI. The SNESVIRS will project the linear system onto a subspace without the constraints.</div>
</div>
</div>
</div>
</blockquote>
</div>
<div><br>
</div>
<div>I assume you meant <span style="color: rgb(44, 54, 63); background-color: rgb(255, 255, 255);"><b>SNESVINEWTONRSLS (former SNESVI)</b></span>.</div>
</div>
</blockquote>
<div><br>
</div>
<div>This is a subtype of SNESVI as it is a particular implementation.</div>
<div> </div>
<blockquote class="x_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>
<div>I’ve been digging on this approach. However,I don’t think this fits my problem since I can not define the list of active nodes using upper and lower limits like in:</div>
</div>
</blockquote>
<div><br>
</div>
<div>The way I am thinking, you must have some test to determine what nodes are active. I was supposing that test depending on the solution at those nodes. If that is true, you can use that test as the constraint.</div>
<div><br>
</div>
<div>  Thanks,</div>
<div><br>
</div>
<div>     Matt</div>
<div> </div>
<blockquote class="x_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>
<div><br>
</div>
<div style="display: block;">
<div role="link" style="display: inline-block;"><a rel="nofollow" href="https://urldefense.us/v3/__https://petsc.org/release/src/snes/tutorials/ex9.c.html__;!!G_uCfscf7eWS!cwnn3sRq7di9mEjZz_VPpuzbpto02sSR7pko8ndG7obAmHU1vHXnI8cShm67H2Js9wkWYo1ieIXb4e4lWpaVMQ$" originalsrc="https://petsc.org/release/src/snes/tutorials/ex9.c.html" dir="ltr" role="button" width="300" target="_blank" style="border-radius: 10px; font-family: -apple-system, Helvetica, Arial, sans-serif; display: block; width: 300px; overflow: hidden; text-decoration: none;">
<table cellpadding="0" cellspacing="0" border="0" width="300" style="table-layout: fixed; border-collapse: collapse; width: 300px; background-color: rgb(229, 230, 233); font-family: -apple-system, Helvetica, Arial, sans-serif;">
<tbody>
<tr>
<td>
<table bgcolor="#E5E6E9" cellpadding="0" cellspacing="0" width="300" style="table-layout: fixed; font-family: -apple-system, Helvetica, Arial, sans-serif; background-color: rgb(229, 230, 233);">
<tbody>
<tr>
<td style="padding: 8px 0px;">
<div style="max-width: 100%; margin: 0px 16px; overflow: hidden;">
<div style="font-weight: 400; font-size: 11px; overflow: hidden; text-overflow: ellipsis; text-align: left;">
<a rel="nofollow" href="https://urldefense.us/v3/__https://petsc.org/release/src/snes/tutorials/ex9.c.html__;!!G_uCfscf7eWS!cwnn3sRq7di9mEjZz_VPpuzbpto02sSR7pko8ndG7obAmHU1vHXnI8cShm67H2Js9wkWYo1ieIXb4e4lWpaVMQ$" originalsrc="https://petsc.org/release/src/snes/tutorials/ex9.c.html" target="_blank" style="text-decoration: none;"><font color="#808080">petsc.org</font></a></div>
</div>
</td>
<td width="32" style="padding: 0px 12px 0px 0px;"><a rel="nofollow" href="https://urldefense.us/v3/__https://petsc.org/release/src/snes/tutorials/ex9.c.html__;!!G_uCfscf7eWS!cwnn3sRq7di9mEjZz_VPpuzbpto02sSR7pko8ndG7obAmHU1vHXnI8cShm67H2Js9wkWYo1ieIXb4e4lWpaVMQ$" originalsrc="https://petsc.org/release/src/snes/tutorials/ex9.c.html" target="_blank"><img width="32" height="32" style="display: inline-block; width: 32px; height: 32px;"></a></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</a></div>
</div>
<div> </div>
<div><br>
</div>
<div>Thanks,</div>
<div>Miguel</div>
<br>
</div>
</blockquote>
</div>
<div><br clear="all">
</div>
<div><br>
</div>
<span class="x_gmail_signature_prefix">--<span class="Apple-converted-space"> </span></span><br>
<div dir="ltr" class="x_gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener</div>
<div><br>
</div>
<div><a href="https://urldefense.us/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!cwnn3sRq7di9mEjZz_VPpuzbpto02sSR7pko8ndG7obAmHU1vHXnI8cShm67H2Js9wkWYo1ieIXb4e4V5fp3Rw$" target="_blank">https://www.cse.buffalo.edu/~knepley/</a></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</body>
</html>