[petsc-users] SNESSetUp

Matthew Knepley knepley at gmail.com
Fri Oct 11 15:00:16 CDT 2013


On Fri, Oct 11, 2013 at 2:59 PM, Mark F. Adams <mfadams at lbl.gov> wrote:

> I am working on fixing this in Newton, getting the DM.  I've tested and it
> seems to work.  Just need to craft a Proustian comment message for Herr
> Commandant.
>

Mark, this is already fixed. I pushed it.

  Matt


> PetscErrorCode SNESSetWorkVecs(SNES snes,PetscInt nw)
> {
>   PetscErrorCode ierr;
>   DM             dm;
>
>   PetscFunctionBegin;
>   if (snes->work) {ierr =
> VecDestroyVecs(snes->nwork,&snes->work);CHKERRQ(ierr);}
>   snes->nwork = nw;
>
>   ierr = SNESGetDM(snes,&dm);CHKERRQ(ierr);
>   if (dm){
>     Vec vec;
>     ierr = DMCreateGlobalVector(dm,&vec);CHKERRQ(ierr);
>     ierr = VecDuplicateVecs(vec,snes->nwork,&snes->work);CHKERRQ(ierr);
>     ierr = VecDestroy(&vec);CHKERRQ(ierr);
>   }
>   else if (snes->vec_sol) {
>     ierr =
> VecDuplicateVecs(snes->vec_sol,snes->nwork,&snes->work);CHKERRQ(ierr);
>   }
>   else {
>     SETERRQ(PetscObjectComm((PetscObject)snes),PETSC_ERR_SUP,"Can not
> create work vectors.");
>   }
>
>   ierr = PetscLogObjectParents(snes,nw,snes->work);CHKERRQ(ierr);
>   PetscFunctionReturn(0);
> }
>
>
> On Oct 11, 2013, at 2:11 PM, Matthew Knepley <knepley at gmail.com> wrote:
>
> On Thu, Oct 10, 2013 at 2:41 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:
>
>>
>> On Oct 10, 2013, at 2:37 PM, "Mark F. Adams" <mfadams at lbl.gov> wrote:
>>
>> >>
>> >> That's what I suggested below.  I can test this now if you like.
>> >>
>> >> Excellent. I just pushed to next.
>> >
>> > It is almost done but SNESSetWorkVecs tries to use vec_sol to create
>> work vectors.
>> >
>>
>>    If SNES has a DM then it should be trying to get its work vectors from
>> that.
>
>
> Now a SNES always has a DM. Changed.
>
>   Matt
>
>
>>
>>    Barry
>>
>>
>
>
> --
> 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/20131011/8d54fb26/attachment.html>


More information about the petsc-users mailing list