<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;"><div><br></div>Look at SNESSetUp_NASM() src/snes/nasm/nasm.c and see the if (dm) case. It calls DMCreateDomainDecomposition() to get subdms and then calls DMCreateDomainDecompositionScatters() to get the scatters that would be passed to SNESNASMSetSubdomains(). Then it builds the subsnes. These are<div>the ingredients needed to construct the objects passed to SNESNASMSetSubdomains(). </div><div><br></div><div>One could argue that this code fragment would be better if it did not interact directly with the internals of &nasm->oscatter etc but instead created the objects and then (in the routine) called SNESNASMSetSubdomains() but anyways it is how it ended up.</div><div><br></div><div> Barry</div><div><br><div><br><blockquote type="cite"><div>On Jun 23, 2023, at 3:40 AM, Karin&NiKo <niko.karin@gmail.com> wrote:</div><br class="Apple-interchange-newline"><div><div dir="ltr">Dear Barry,<div>I have started looking at the code but I miss an example using SNESNASMSetSubdomains. In fact I do not even find a single use of the function in PETSc.</div><div>Could someone provide me with an example ?</div><div>Thanks,</div><div>Nicolas</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le ven. 23 juin 2023 à 02:17, Barry Smith <<a href="mailto:bsmith@petsc.dev" target="_blank">bsmith@petsc.dev</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><br></div> A test would be great.<br><div><br><blockquote type="cite"><div>On Jun 22, 2023, at 3:20 PM, Karin&NiKo <<a href="mailto:niko.karin@gmail.com" target="_blank">niko.karin@gmail.com</a>> wrote:</div><br><div><div dir="ltr">Thank you Barry. I will try this.<div>Should I provide a test in src/binding/petsc4py/test/test_snes.py ?</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le jeu. 22 juin 2023 à 20:41, Barry Smith <<a href="mailto:bsmith@petsc.dev" target="_blank">bsmith@petsc.dev</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><br></div> You are not missing anything. The petsc4py stub for SNESNASMSetSubdomains() has not been written. You could add it by adding to<div><div style="margin:0px;font-style:normal;font-variant:normal;font-stretch:normal;line-height:normal;font-kerning:auto;font-feature-settings:normal"><span style="font-variant-ligatures:no-common-ligatures">src/petsc4py/PETSc/SNES.pyx and </span>src/petsc4py/PETSc/petscsnes.pxi and then make a merge request <a href="https://petsc.org/release/developers/contributing/" target="_blank">https://petsc.org/release/developers/contributing/</a> to get it into PETSc.</div><div><br><blockquote type="cite"><div>On Jun 22, 2023, at 1:54 PM, Karin&NiKo <<a href="mailto:niko.karin@gmail.com" target="_blank">niko.karin@gmail.com</a>> wrote:</div><br><div><div dir="ltr">Dear PETSc team,<div><br></div><div>I would like to play with aspin-type nonlinear solvers. I have found several tests like snes/tutorials/ex19.c but they all use DA, which I don't want to use since I need to stick at the algebraic level.</div><div>Then, I started looking at petsc4py/demo/ode/heat.py and tried to set up things.</div><div>Unfortunately, I get the error "DM has no default decomposition defined. Set subsolves manually with SNESNASMSetSubdomains()" which, I think, I do understand.</div><div>But I do not find any implementation of the SNESNASMSetSubdomains in petsc4py. </div><div>Am I missing something ? </div><div>Thanks,</div><div>Nicolas</div></div>
</div></blockquote></div><br></div></div></blockquote></div>
</div></blockquote></div><br></div></blockquote></div>
</div></blockquote></div><br></div></body></html>