[petsc-users] a fieldsplit question

Barry Smith bsmith at mcs.anl.gov
Thu Jun 15 20:15:09 CDT 2017


> On Jun 15, 2017, at 8:13 PM, Ju Liu <liujuy at gmail.com> wrote:
> 
> I see. Suppose I have the following code:
> 
> const PetscInt pfield[1] = {0}, vfields[] = {1,3}, tfield[1] = {2};
> PCFieldSplitSetBlockSize(upc,5);
> PCFieldSplitSetFields(upc,"u",3,vfields,vfields);
> PCFieldSplitSetFields(upc,"pp",1,pfield,pfield);
> PCFieldSplitSetFields(upc,"t",1,tfield,tfield);
> 
> Then the A_00 matrix corresponds to the index of vfields, A_11 with pfield, and A_22 with tfield. It depends on the order one calls the PCFieldSplitSetFields function. Is that right?

  Yes. Note that since you give them all names you can refer to them by name for setting solver options like -fieldsplit_u_ksp_type etc.


> 
> Thanks!
> 
> Ju
> 
> 2017-06-15 18:09 GMT-07:00 Barry Smith <bsmith at mcs.anl.gov>:
> 
> > On Jun 15, 2017, at 7:46 PM, Ju Liu <liujuy at gmail.com> wrote:
> >
> > Hi PETSc team:
> >
> > Suppose I provide three index sets {0}, {1,3}, {2} for PCFieldSplitSetFields to construct a field split PC. Conceputally, the matrix is split into 3x3 blocks. Is it true that the index set {0} always corresponds to the block with index 0? What is the block index for the sets {1,3}?
> >
> 
>    Not sure what you mean by "block index" but the three fields are just defined in the order that you provide the values, so in this case the 0th field is {0}, the 1st is {1,3} and the 2nd is {2}. If you provided them in the order {2},{1,3},{0} then the three fields are first {2}, then {1,3} then {0}
> 
> 
> > Thanks!
> >
> > Ju
> 
> 
> 
> 
> -- 
> Ju Liu, Ph.D.
> Postdoctoral Research Fellow
> Stanford School of Medicine
> http://ju-liu.github.io/



More information about the petsc-users mailing list