[petsc-users] SNESNRICHARDSON with LibMesh

Harshad Sahasrabudhe hsahasra at purdue.edu
Wed May 27 12:27:26 CDT 2015


Thanks, if the results are just slightly different with the same options,
then it's not a problem. I'll run my program using both to check.

On Wed, May 27, 2015 at 1:25 PM, Matthew Knepley <knepley at gmail.com> wrote:

> On Wed, May 27, 2015 at 12:22 PM, Harshad Sahasrabudhe <
> hsahasra at purdue.edu> wrote:
>
>> Hi Matt,
>>
>> Thanks for your comments. I see that SNESNRICHARDSON has changed a lot
>> from 3.4.3 to 3.5.3. What do I need to do to make the code compatible with
>> both 3.4.3 and 3.5.3?
>>
>
> There are two issues:
>
>   1) Making it compatible, which should be no problem since it is just a
> SNES. We only changed the implementation.
>
>   2) Comparing results. It may well be that 3.4.3 gives slightly different
> results. I would have to look at the exact changes.
>
>   Thanks,
>
>      Matt
>
>
>> Thanks,
>> Harshad
>>
>> On Tue, May 26, 2015 at 4:25 PM, Matthew Knepley <knepley at gmail.com>
>> wrote:
>>
>>> On Tue, May 26, 2015 at 3:07 PM, Harshad Sahasrabudhe <
>>> hsahasra at purdue.edu> wrote:
>>>
>>>> Hi Matt,
>>>>
>>>> Actually I just checked, I don't need to re-init the preconditioner
>>>> LibMesh solver.
>>>>
>>>> The wrapper is interfaced to the mesh and makes it easier to assemble
>>>> the system matrices. It also keeps track of constraints. The wrapper
>>>> function PetscNonlinearSolver::solve updates the system vectors and
>>>> matrices, then calls SNESSolve. Thus, I need to call PetscNonlinearSolver::solve
>>>> instead of SNESSolve in SNESApplyNPC.
>>>>
>>>> Do you mean wrap it in SNESSHELL?
>>>>
>>>
>>> Yes, exactly.
>>>
>>>   Thanks,
>>>
>>>      Matt
>>>
>>>
>>>> Thanks,
>>>> Harshad
>>>>
>>>> On Tue, May 26, 2015 at 3:25 PM, Matthew Knepley <knepley at gmail.com>
>>>> wrote:
>>>>
>>>>> On Tue, May 26, 2015 at 12:42 PM, Harshad Sahasrabudhe <
>>>>> hsahasra at purdue.edu> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I'm using LibMesh for meshing a non-linear equation. I want to use
>>>>>> NRichardson non-linear solver to solve the equation. I have a Newton trust
>>>>>> region non-linear solver as a pre-conditioner. Both these SNES are created
>>>>>> via the LibMesh NonlinearImplicitSystem and PetscNonlinearSolver wrappers.
>>>>>>
>>>>>> I need to re-init the LibMesh NonlinearImplicitSystem each time the
>>>>>> preconditioner is applied. Also, I need the preconditioner to be solved via
>>>>>> the LibMesh wrapper instead of directly through SNESSolve. How can make it
>>>>>> work this way? Any help is appreciated!
>>>>>>
>>>>>
>>>>> I think the easiest way is to have them both look like SNES objects.
>>>>> Then you can just call SNESSetNPC() or use -snes_npc_side left
>>>>> -npc_snes_type newtonls
>>>>>
>>>>> Can you explain what the LibMesh wrapper is doing that you you need?
>>>>> We could wrap that object in a SNES, but it sounds
>>>>> simpler to me to unwrap it.
>>>>>
>>>>>   Thanks,
>>>>>
>>>>>      Matt
>>>>>
>>>>>
>>>>>> Thanks,
>>>>>> Harshad
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> 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
>>>
>>
>>
>
>
> --
> 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/20150527/87fd79b4/attachment.html>


More information about the petsc-users mailing list