[petsc-users] Fieldsplit for 4 fields
Tang, Qi
tangqi at msu.edu
Mon Mar 14 16:02:40 CDT 2022
Matt and Patrick
If I replace
PCFieldSplitSetDetectSaddlePoint<https://petsc.org/main/docs/manualpages/PC/PCFieldSplitSetDetectSaddlePoint.html#PCFieldSplitSetDetectSaddlePoint>(pc,PETSC_TRUE<https://petsc.org/main/docs/manualpages/Sys/PETSC_TRUE.html#PETSC_TRUE>);
in https://petsc.org/main/src/dm/impls/stag/tutorials/ex3.c.html
with
const PetscInt ufield[] = {0,1,2},pfield[] = {3};
PCFieldSplitSetBlockSize(pc,4);
PCFieldSplitSetFields(pc,"u",3,ufield,ufield);
PCFieldSplitSetFields(pc,"p",1,pfield,pfield);
It does not work. It seems petsc just divide all the dofs by four and assign “components” one by one. I am not sure that is the right thing to do with dmstag.
This would divide everything into two components of the same size, which is not correct either.
const PetscInt ufield[] = {0},pfield[] = {1};
PCFieldSplitSetBlockSize(pc,2);
PCFieldSplitSetFields(pc,"u”,1,ufield,ufield);
PCFieldSplitSetFields(pc,"p",1,pfield,pfield);
Is there an alternative solution to this?
Qi
On Mar 12, 2022, at 5:49 PM, Tang, Qi <tangqi at msu.edu<mailto:tangqi at msu.edu>> wrote:
Thanks a lot, Matt.
1) Are you using DMStag? If so, the field split might be able to be automated.
I think this is true only if I have one component on each vertex/face/edge. I have two dofs on vertex, corresponding to component 0 and 1. They are mixed together as I understand.
Meanwhile, I am testing the three field version using automated split and two nested fieldsplit (so pc will handle vertex dofs together). I expect it will work.
2) Checking the division:
I am trying to do
Schur complement {1, 2, 3} and {0}
Multiplicative {1} and {2, 3}
Schur complement {2} and {3}
The first level is a saddle point problem and the last level is parabolization. I know the diagonal operator for {1} and Schur complement for {3} works well with amg.
Qi
On Mar 12, 2022, at 3:21 PM, Matthew Knepley <knepley at gmail.com<mailto:knepley at gmail.com>> wrote:
On Fri, Mar 11, 2022 at 3:32 PM Tang, Qi <tangqi at msu.edu<mailto:tangqi at msu.edu>> wrote:
Hi,
I am trying to solve a four field system with three nested fieldsplit (I am in petsc/dmstag directly). I think I have all the IS info in the original system. I am wondering how to set up IS for the split system.
Some questions first:
1) Are you using DMStag? If so, the field split might be able to be automated.
2) Checking the division:
Schur complement {1, 2, 3} and {0}
Multiplicative {1,2} and {3}
Schur complement {1} and {2}
Thanks,
Matt
More specifically, I would like to call something like this
-pc_type fieldsplit -pc_fieldsplit_type schur -pc_fieldsplit_0_fields 0 -pc_fieldsplit_1_fields 1,2,3
-fieldsplit_1_ksp_type fgmres -fieldsplit_1_pc_type fieldsplit -fieldsplit_1_pc_fieldsplit_type multiplicative
-fieldsplit_1_fieldsplit_1_ksp_type fgmres -fieldsplit_1_fieldsplit_1_pc_type fieldsplit -fieldsplit_1_fieldsplit_1_pc_fieldsplit_type schur
I know the first level probably would work. But the second and third levels would not.
We have two components living on one type of dofs. So the natural split 0,1,2,3 do not work. Therefore, at the first level I am setting up split through
PCFieldSplitSetIS(pc, “i", myis[i]);
How could I know the sub ISs and set it up correctly? Thanks.
Qi Tang
T5 at LANL
--
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!mFfBXSXv1xb00aJzISaY9ymPjPF_fX30APRsXjauIJzSwgpBxk1pdgI22I9PEg$>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20220314/5ec39def/attachment.html>
More information about the petsc-users
mailing list