[petsc-users] Variable ordering in PC FieldSplit

Barry Smith bsmith at mcs.anl.gov
Tue Jul 9 21:05:17 CDT 2013


On Jul 9, 2013, at 8:57 PM, Subramanya G <subramanya.g at gmail.com> wrote:

> Hi Barry, 
> Thanks. I've been looking at KSP/ex43.C and from what I understand the following are the main steps. 
>      PCFieldSplitSetBlockSize(pc,3);  // Total number of fields
>      PCFieldSplitSetFields(pc,"u"
> ,2,ufields,ufields); // split into groups  (u and v) 
>      
> PCFieldSplitSetFields(pc,"p",1,pfields,pfields); // p 
> 
> I am unable to see where petsc  expects to know whether the values in node major or variable major order.  

   Yes, this is why I wrote "the code is easier to use with node major" :-).   The SetFields() interface is for simple node major order. To use any other ordering you need to use the PCFieldSplitSetIS() interface to set the fields. Most of the examples use node major. Sorry for the confusion.

   Barry

> 
> Thanks, 
> Subramanya 
> 
> 
> Subramanya G Sadasiva,
> 
> Graduate Research Assistant, 
> Hierarchical Design and Characterization Laboratory,
> School of Mechanical Engineering, 
> Purdue University.
> 
> "The art of structure is where to put the holes"
> Robert Le Ricolais, 1894-1977
> 
> 
> On Tue, Jul 9, 2013 at 9:49 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:
> 
>    PCFieldsplit is officially neutral as to the arrangement. One can define IS's to select any arbitrary subset of variables for each field.
> 
>    Unofficially we generally recommend node major order, it generally is more computationally efficient and the code is a bit easier to use with this default.
> 
>     Barry
> 
> On Jul 9, 2013, at 8:41 PM, subramanya sadasiva <subramanya.g at gmail.com> wrote:
> 
> > I have a small question about the use of PC field split, does it expect variables to be arranged in a particular fashion? Should it be variable major (all degrees of freedom corresponding to the first followed by all degrees of freedom corresponding to the next) or node major ( all degrees of freedom corresponding to each node - with a sub block structure . Is there some way of switching between the two ?
> > Thanks,
> > Subramanya Sadasiva
> 
> 



More information about the petsc-users mailing list