About src/ksp/pc/impls/fieldsplit/fieldsplit.c

Barry Smith bsmith at mcs.anl.gov
Fri Jul 17 18:23:50 CDT 2009


   You NEVER want to be building these linked lists yourself. You  
should use the PCFieldSplit API to construct the fields you want.

    If you are interested in seeing what the result is then run your  
code in the debugger and just look at the various links and fields.

    Barry

On Jul 17, 2009, at 5:18 PM, Ryan Yan wrote:

> Hi All,
> I have some difficulty of understanding the struct PC_FieldSplit.  
> From the definition I can see that it has a data structure like a  
> "list" and each member in the list is representing an object  
> Field(or PC_Field).
>
> Suppose that my matrix has a blocksize of 5.   I want to Set 3  
> Fields,  i.e. field_0 as {0,1},  field_1 as{2,3},and field_3 as {4}.  
> Then can anyone please help me to fill in the following parameter.
>
> PC_FieldSplit *jac = (PC_FieldSplit*)pc->data;
>
> what is jac->nsplit?     3, is my guess, since we have split the  
> matrix into 3 split, namely field_0, field_1, field_2.
>
> PC_FieldSplitLink ilink = jac->head;
>
> what is ilink->nfields? 2, is my guess, since the fields_0 has 2  
> fields inside.
>
> Then ilink=ilink->next; ilink=ilin->next; ilink->nfileds should be 1  
> right?
>
> Thank you very much in advance.
>
> Yan



More information about the petsc-users mailing list