[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: PCGetType question
- To: petsc-users@xxxxxxxxxxx
- Subject: Re: PCGetType question
- From: "Lisandro Dalcin" <dalcinl@xxxxxxxxx>
- Date: Fri, 8 Feb 2008 10:52:46 -0300
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=+WF55TsZ0gFYw+A1MaNoZzfhQOrJTRpQVVtROEiPJBs=; b=nSPaZscXlsngP/SWy2uPXPg5H+1LxDbs5WodpS2MDFbOXpzBAVS3JgNiRE4Z1SsqUvHOhszlwzetnxoGRWOgfGzRNw6wyBsP5kVi+GL1P56Eq3sjyQsqjAt5JcWqyNs5BLTW1+P2jOOxRK0FWCZw9uFTcCdZthPM1Cm8X8UOUV4=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=j1wH5n94xtYdAm2/o3nHTpN8kHY0p79L4WuZqdCmiww9PvGJc2VnIIesYpnwqa/6/aR/Nq/b6qSAIf7W5oO4U5Gmjz2ihx11aSFfWJceqruzysxepDrVsUXMvQHkGu+d3LjghQIqGb0V6Sai4vyPUAX7TLSg4isJIRXghMPMVB0=
- In-reply-to: <00aa01c86a19$6cbcac50$b63010ac@neutron>
- References: <00aa01c86a19$6cbcac50$b63010ac@neutron>
- Reply-to: petsc-users@xxxxxxxxxxx
- Sender: owner-petsc-users@xxxxxxxxxxx
On 2/8/08, Vijay S. Mahadevan <vijay.m@xxxxxxxxx> wrote:
> 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 ?
Did you call PCSetFromOptions (or KSPSetFromOptions) before calling
PetscTypeCompare()? If not, the option '-pc_type' will not be used
> 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.
PCType is a 'const char*', so you should never compare that with '=='
opertor!!. Again, if you got a null pointer from PCGetType(), my guess
is that you forgot to call XXXSetFromOptions, where XXX is PC, or a
KSP object containing it, or a SNES cointaing the KSP in turn
containing the PC.
--
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594