|
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. Thanks, Vijay No virus found in this outgoing message. |