[petsc-users] Solve the Poisson equation twice with /src/ksp/ksp/examples/tutorials/ex45.c

Matthew Knepley knepley at gmail.com
Thu May 17 15:11:42 CDT 2012


On Thu, May 17, 2012 at 2:43 PM, Zhenglun (Alan) Wei <zhenglun.wei at gmail.com
> wrote:

>  On 5/17/2012 1:11 PM, Matthew Knepley wrote:
>
> On Thu, May 17, 2012 at 1:47 PM, Zhenglun (Alan) Wei <
> zhenglun.wei at gmail.com> wrote:
>
>> Dear All,
>>    I hope you're having a nice day.
>>    I was trying to solve the Poisson equation with
>> /src/ksp/ksp/exmaples/tutorial/ex45.c; however, it always give me the same
>> result. I recalled the PetscLogStages and resolved this problem. However,
>> the process of reconstructing DM costs a lot of computational time. I
>> wonder do I have to use PetscLogStages to solve this problem, since, I
>> thought, this function is only needed for using DMMG. Or as long as DM
>> twice in one program, then I need to call PetscLogStages.
>>
>
>  I cannot understand what you mean. PetscLog functions only affect
> logging.
>
>     Matt
>
>
>> thanks,
>> Alan
>>
>
>
>
>  --
> 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
>
> Dear Dr. Knepley,
>     I'm sorry for confusing you. Here I attached a old version of
> /src/ksp/ksp/examples/tutorials/ex50.c. By adopting its approach of
> PetscLogStage, I can solve Poisson equation twice with two different RHS in
> one program. However, as you may noticed, this method, in ex50.c, is used
> for DMMG. What I understand is that the DMMG has a severe limitation so
> that the PetscLogStage is needed in order to solve the equation twice with
> two different RHS. I wonder if I have to use this approach for KSP? This
> method requires a lot of time to KSPCreate and DMMGCreate3d/2d in order to
> construct the DM. That's why I want to find an alternative way.
>

No, PetscLogStage has nothing to do with solving with different RHS. It is
only there so you can separately time the solves.

   Matt


> thanks,
> Alan
>



-- 
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/20120517/da4b7175/attachment.htm>


More information about the petsc-users mailing list