[petsc-users] Questions abt ex22f

Matthew Knepley knepley at gmail.com
Sun Apr 22 07:53:56 CDT 2012


On Sun, Apr 22, 2012 at 3:31 AM, TAY wee-beng <zonexo at gmail.com> wrote:

>  Hi,
>
> I am using petsc-dev 2012-04-20.
>
> Btw, I'm referring to :
>
>
> http://www.mcs.anl.gov/petsc/petsc-dev/src/ksp/ksp/examples/tutorials/ex22f.F.html
>
> Part of the code is :
>
> call KSPSetFromOptions(ksp,ierr)
>       call KSPSetUp(ksp,ierr)
>       call KSPSolve(ksp,PETSC_NULL_OBJECT,PETSC_NULL_OBJECT,ierr)
>       call KSPDestroy(ksp,ierr)
>       call DMDestroy(da,ierr)
>       call PetscFinalize(ierr)
>
>
>
> Unlike other codes like ex29c or ex45c, there isn't a "call
> KSPGetSolution(ksp,x,ierr)"
>

You need to declare "Vec x", and then you can call KSPGetSolution(ksp, x,
ierr)

   Matt


> Also I want to add "call VecView(x,ierr)" to print out the results, which
> is usally added after the above.
>
> Thank you
>
> Yours sincerely,
>
> TAY wee-beng
>
>
> On 22/4/2012 1:14 AM, Matthew Knepley wrote:
>
> On Sat, Apr 21, 2012 at 6:31 PM, TAY wee-beng <zonexo at gmail.com> wrote:
>
>> Hi,
>>
>> May I know if ex22f is complete? I can't find :
>>
>> call KSPGetSolution(ksp,x,ierr)
>>
>> If I entered it, it says x not found.
>>
>
>  This is correct in petsc-dev. What version are you using?
>
>    Thanks,
>
>      Matt
>
>
>> Thank you!
>>
>> --
>> Yours sincerely,
>>
>> TAY wee-beng
>>
>>
>
>
>  --
> What most experimenters take for granted before they begin their
> experiments is infinitely more interesting than any results to which their
> experiments lead.
> -- Norbert Wiener
>
>


-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120422/678d2258/attachment-0001.htm>


More information about the petsc-users mailing list