[petsc-users] Question about PCFieldSplit

Patrick Sanan patrick.sanan at gmail.com
Tue Apr 20 05:09:23 CDT 2021


That's great - if you run into issues that I can help with in the meantime, let me know. Even if you can't share the code, maybe you could share a screen or something like that. This would undoubtedly be helpful for me in seeing how people use the code "in the wild" : )

> Am 20.04.2021 um 08:29 schrieb Tang, Qi <tangqi at msu.edu>:
> 
> Patrick,
> We were able to get field split working in DMStag with the dummy solver approach I described. Let us know when you add the capability and we will be happy to test it. Meanwhile, please take your time to merge it.
> 
> Thanks,
> Qi
> 
> 
> 
>> On Apr 18, 2021, at 11:51 PM, Tang, Qi <tangqi at msu.edu <mailto:tangqi at msu.edu>> wrote:
>> 
>> Thanks a lot, Patrick. We appreciate your help.
>> 
>> Qi
>> 
>> 
>> 
>>> On Apr 18, 2021, at 11:30 PM, Patrick Sanan <patrick.sanan at gmail.com <mailto:patrick.sanan at gmail.com>> wrote:
>>> 
>>> We have this functionality in a branch, which I'm working on cleaning up to get to master. It doesn't use PETScSection. Sorry about the delay!
>>> 
>>> You can only use PCFieldSplitSetDetectSaddlePoint when your diagonal entries being zero or non-zero defines the splits correctly. 
>>> 
>>>> Am 17.04.2021 um 21:09 schrieb Matthew Knepley <knepley at gmail.com <mailto:knepley at gmail.com>>:
>>>> 
>>>> On Fri, Apr 16, 2021 at 8:39 PM Jorti, Zakariae via petsc-users <petsc-users at mcs.anl.gov <mailto:petsc-users at mcs.anl.gov>> wrote:
>>>> Hello,
>>>> 
>>>> 
>>>> 
>>>> I have a DMStag grid with one dof on each edge and face center. 
>>>> 
>>>> I want to use a PCFieldSplit preconditioner on a Jacobian matrix that I assume is already split but I am not sure how to determine the fields. 
>>>> 
>>>> In the DMStag examples (ex2.c and ex3.c), the function PCFieldSplitSetDetectSaddlePoint is used to determine those fields based on zero diagonal entries. In my case, I have a Jacobian matrix that does not have zero diagonal entries. 
>>>> 
>>>> Can I use that PCFieldSplitSetDetectSaddlePoint in this case? 
>>>> 
>>>> If not, how should I do? 
>>>> 
>>>> Should I do like this example (https://www.mcs.anl.gov/petsc/petsc-master/src/ksp/ksp/tutorials/ex43.c.html <https://urldefense.com/v3/__https://www.mcs.anl.gov/petsc/petsc-master/src/ksp/ksp/tutorials/ex43.c.html__;!!HXCxUKc!jbBwV2h9luOW4dtBcNh6n_W1ULQnSVeXpxl0Ef1752s4Hlef-nC2JcnksFSO3Q$>): 
>>>> 
>>>> const PetscInt Bfields[1] = {0},Efields[1] = {1};
>>>> 
>>>> KSPGetPC(ksp,&pc);
>>>> 
>>>> PCFieldSplitSetBlockSize(pc,2);
>>>> 
>>>> PCFieldSplitSetFields(pc,"B",1,Bfields,Bfields); PCFieldSplitSetFields(pc,"E",1,Efields,Efields); 
>>>> 
>>>> where my B unknowns are defined on face centers and E unknowns are defined on edge centers?
>>>> 
>>>> That will not work.That interface only works for colocated fields that you get from DMDA.
>>>> 
>>>> Patrick, does DMSTAG use PetscSection? Then the field split would be automatically calculated. If not, does it maintain the
>>>> field division so that it could be given to PCFIELDSPLIT as ISes?
>>>> 
>>>>   Thanks,
>>>> 
>>>>      Matt
>>>> One last thing, I do not know which field comes first. Is it the one defined for face dofs or edge dofs.
>>>> 
>>>> 
>>>> 
>>>> Thank you.
>>>> 
>>>> Best regards,
>>>> 
>>>> 
>>>> 
>>>> Zakariae
>>>> 
>>>> 
>>>> 
>>>> 
>>>> -- 
>>>> What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.
>>>> -- Norbert Wiener
>>>> 
>>>> https://www.cse.buffalo.edu/~knepley/ <https://urldefense.com/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!HXCxUKc!jbBwV2h9luOW4dtBcNh6n_W1ULQnSVeXpxl0Ef1752s4Hlef-nC2JcmGgSwfag$>
>> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20210420/a2a10f4d/attachment-0001.html>


More information about the petsc-users mailing list