[petsc-users] TAOGetKSP fails if TAOSolve has not been called.
Barry Smith
bsmith at mcs.anl.gov
Wed Jul 30 19:51:15 CDT 2014
Hmm, which solver are you using? I fixed this for one solver already. Most solvers do return the KSP at this stage. For solvers that do not use a KSP I would prefer that it never be created.
Barry
On Jul 30, 2014, at 6:19 PM, Blaise A Bourdin <bourdin at lsu.edu> wrote:
> Responding to myself to clarify my question:
>
> This is with petsc-maint (3.5) up to date
>
> bourdin at galerkin:tutorials (maint)$ git show
> commit 587bed1b5ce23d03610a5e586bde2d77cb223937
> Merge: ac2cab2 4856ba2
> Author: Satish Balay <balay at mcs.anl.gov>
> Date: Wed Jul 30 09:53:57 2014 -0500
>
> Merge branch 'barry/check-mpi-include' into maint
>
> I see in the release notes of 3.5.1 a reference to TAOSetUp()being needed, but calling TaoSetUp after TAOSetFromOptions but before TaoGetKSP does not make any difference.
>
> Breakpoint 1.1, main (argc=3, argv=0x7fff5fbfe9f8) at /opt/HPC/petsc-3.5/src/tao/unconstrained/examples/tutorials/eptorsion1.c:148
> 148 ierr = TaoSetFromOptions(tao);CHKERRQ(ierr);
> (idb) n
> 150 ierr = TaoSetUp(tao);
> (idb)
> 151 ierr = TaoGetKSP(tao,&ksp);
> (idb)
> 153 ierr = KSPView(ksp,PETSC_VIEWER_STDOUT_WORLD);
> (idb) print tao
> $1 = (struct _p_Tao *) 0x10885c860
> (idb) print ksp
> $2 = (struct _p_KSP *) 0x0
>
>
> On Jul 30, 2014, at 6:09 PM, Blaise A Bourdin <bourdin at lsu.edu> wrote:
>
>> Hi,
>>
>> TAOGetKSP returns a null pointer when called before TAOSolve (swap the calls in eptorsion1.c for instance). Is this expected? I want to override the default KSP in my application.
>>
>> Blaise
>> --
>> Department of Mathematics and Center for Computation & Technology
>> Louisiana State University, Baton Rouge, LA 70803, USA
>> Tel. +1 (225) 578 1612, Fax +1 (225) 578 4276 http://www.math.lsu.edu/~bourdin
>>
>>
>>
>>
>>
>>
>>
>
> --
> Department of Mathematics and Center for Computation & Technology
> Louisiana State University, Baton Rouge, LA 70803, USA
> Tel. +1 (225) 578 1612, Fax +1 (225) 578 4276 http://www.math.lsu.edu/~bourdin
>
>
>
>
>
>
>
More information about the petsc-users
mailing list