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
the ingredients needed to construct the objects passed to 
SNESNASMSetSubdomains(). 

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.

  Barry


> On Jun 23, 2023, at 3:40 AM, Karin&NiKo <[email protected]> wrote:
> 
> Dear Barry,
> 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.
> Could someone provide me with an example ?
> Thanks,
> Nicolas
> 
> Le ven. 23 juin 2023 à 02:17, Barry Smith <[email protected] 
> <mailto:[email protected]>> a écrit :
>> 
>>   A test would be great.
>> 
>>> On Jun 22, 2023, at 3:20 PM, Karin&NiKo <[email protected] 
>>> <mailto:[email protected]>> wrote:
>>> 
>>> Thank you Barry. I will try this.
>>> Should I provide a test in src/binding/petsc4py/test/test_snes.py ?
>>> 
>>> Le jeu. 22 juin 2023 à 20:41, Barry Smith <[email protected] 
>>> <mailto:[email protected]>> a écrit :
>>>> 
>>>>   You are not missing anything. The petsc4py stub for 
>>>> SNESNASMSetSubdomains() has not been written. You could add it by adding to
>>>> src/petsc4py/PETSc/SNES.pyx and src/petsc4py/PETSc/petscsnes.pxi and then 
>>>> make a merge request  https://petsc.org/release/developers/contributing/ 
>>>> to get it into PETSc.
>>>> 
>>>>> On Jun 22, 2023, at 1:54 PM, Karin&NiKo <[email protected] 
>>>>> <mailto:[email protected]>> wrote:
>>>>> 
>>>>> Dear PETSc team,
>>>>> 
>>>>> 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.
>>>>> Then, I started looking at petsc4py/demo/ode/heat.py and tried to set up 
>>>>> things.
>>>>> Unfortunately, I get the error "DM has no default decomposition defined.  
>>>>> Set subsolves manually with SNESNASMSetSubdomains()" which, I think, I do 
>>>>> understand.
>>>>> But I do not find any implementation of the SNESNASMSetSubdomains in 
>>>>> petsc4py. 
>>>>> Am I missing something ? 
>>>>> Thanks,
>>>>> Nicolas
>>>> 
>> 

Reply via email to