PCGetType question

Vijay S. Mahadevan vijay.m at gmail.com
Fri Feb 8 00:11:17 CST 2008

Hi all,


I’ve been trying to figure out how exactly to find out the PCType for a
given PC context. Here’s the sample code I’ve been trying to execute but to
no avail.


Method 1:


PetscTruth isshell ;


PetscTypeCompare((PetscObject)pc, PCSHELL, &isshell);


PetscPrintf(PETSC_COMM_SELF, " PETSC_IS_SHELL = %D", isshell) ;


Result: The isshell variable is always false even when I set –pc_type shell
option. Why ?


Method 2:


PCType currpcType ;


ierr = PCGetType(pc, &currpcType) ;


if(currpcType == PCSHELL)

    isshell = PETSC_TRUE ;


PetscPrintf(PETSC_COMM_SELF, " PETSC_IS_SHELL = %D", isshell) ;


Result: Again, the isshell variable is always false even when I set –pc_type
shell option. Also, my currpcType string is a null string. 


Any ideas on what I am doing wrong on either one of these cases. I just
spent a while trying to figure out if there was a bug in some other part of
my code while the isshell variable is never set in the first place. Any help
would be appreciated.





No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.19.21/1265 - Release Date: 2/7/2008
11:17 AM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20080208/c8fd0f3c/attachment.htm>

More information about the petsc-users mailing list