<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi Miguel,</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
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-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
 <a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/DMSwarm/DMSwarmGetCellSwarm/__;!!G_uCfscf7eWS!ZNzXAukaJWoy9gfF0ZpkipSh7IvFVWu9UsybjhiA8z5_GHxWHwJ60oFlfUGwwh73aGqUO3XB4W8Mo4B5m7I4YoqhM1c$" id="LPlnk824560">https://petsc.org/release/manualpages/DMSwarm/DMSwarmGetCellSwarm/</a></div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Best,</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Joe</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> MIGUEL MOLINOS PEREZ <mmolinos@us.es><br>
<b>Sent:</b> Thursday, May 8, 2025 10:22 AM<br>
<b>To:</b> Matthew Knepley <knepley@gmail.com><br>
<b>Cc:</b> petsc-users@mcs.anl.gov <petsc-users@mcs.anl.gov>; Joseph Pusztay <josephpu@buffalo.edu><br>
<b>Subject:</b> Re: [petsc-users] Problems with the null-space removal</font>
<div> </div>
</div>
<div style="line-break:after-white-space">
<table border="0" cellspacing="0" cellpadding="0" width="100%" align="left" 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; border:0!important; display:table!important; width:100%!important; table-layout:fixed!important; border-collapse:seperate!important; float:none!important; border-spacing:0px 0px!important">
<tbody 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; 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: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; padding:7px 2px 7px 2px!important; background-color:#A6A6A6!important; width:0px!important">
</td>
<td valign="middle" width="100%" bgcolor="#EAEAEA" cellpadding="7px 5px 7px 15px" color="#212121" 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; width:100%!important; background-color:#EAEAEA!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:#212121!important; text-align:left!important; word-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 mmolinos@us.es. <a href="https://urldefense.us/v3/__https://aka.ms/LearnAboutSenderIdentification__;!!G_uCfscf7eWS!ZNzXAukaJWoy9gfF0ZpkipSh7IvFVWu9UsybjhiA8z5_GHxWHwJ60oFlfUGwwh73aGqUO3XB4W8Mo4B5m7I4Ts0tzdM$" 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" color="#212121" 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; width:75px!important; background-color:#EAEAEA!important; padding:7px 5px 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:#212121!important; text-align:left!important; word-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:1px solid 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:1px solid 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:1px solid 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:1px solid 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!ZNzXAukaJWoy9gfF0ZpkipSh7IvFVWu9UsybjhiA8z5_GHxWHwJ60oFlfUGwwh73aGqUO3XB4W8Mo4B5m7I4JFyZnvY$" 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!ZNzXAukaJWoy9gfF0ZpkipSh7IvFVWu9UsybjhiA8z5_GHxWHwJ60oFlfUGwwh73aGqUO3XB4W8Mo4B5m7I4JFyZnvY$" originalsrc="https://petsc.org/release/src/snes/tutorials/ex9.c.html" target="_blank" style="text-decoration:none"><font color="#808080" style="">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!ZNzXAukaJWoy9gfF0ZpkipSh7IvFVWu9UsybjhiA8z5_GHxWHwJ60oFlfUGwwh73aGqUO3XB4W8Mo4B5m7I4JFyZnvY$" 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><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!ZNzXAukaJWoy9gfF0ZpkipSh7IvFVWu9UsybjhiA8z5_GHxWHwJ60oFlfUGwwh73aGqUO3XB4W8Mo4B5m7I4JQuaiJo$" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</body>
</html>