[petsc-dev] -dmmg_form_function_ghost

Barry Smith bsmith at mcs.anl.gov
Wed Mar 24 17:07:53 CDT 2010


    Jed uses it in the best example in PETSc! ex48

    Barry

On Mar 24, 2010, at 5:06 PM, Matthew Knepley wrote:

> On Wed, Mar 24, 2010 at 5:04 PM, Barry Smith <bsmith at mcs.anl.gov>  
> wrote:
>
>  Sorry, I was so stunned when I saw that option I just automatically  
> nuked it.
>
>  I have pushed 3.1 and dev with the option again.
>
>  Does your code support ghosted finite differences? With this option?
>
> I am cool with the nuking. It was not really being used. I can't  
> even remember
> exactly what I was working around. I would redo it if I get to this  
> again.
>
>    Matt
>
>
>
>   Barry
>
>
> On Mar 24, 2010, at 4:56 PM, Jed Brown wrote:
>
> I know this was an absolutely horrendous API, but this patch  
> completely
> removed the option which makes ex48 fail (and certainly some user  
> code).
> Releaes-3.1 either needs to get a proper API for this, or the option
> needs to remain available.  DMMGFormFunctionGhost is currently
> unreachable.
>
> (I'll add some ex48 tests to get them run in the nightlies, I should
> have done this long ago.)
>
> Jed
>
>
> changeset:   15513:e8e19296a5dc
> parent:      15511:2cefbdbb44a8
> user:        Barry Smith bsmith at mcs.anl.gov
> date:        Wed Mar 24 16:39:07 2010 -0500
> files:       src/snes/utils/damg.c src/snes/utils/damgsnes.c
> description:
> fixed bug in DMMGCreate() that it ALWAYS used ghosted coloring even  
> when it would not work.
>
>
> diff --git a/src/snes/utils/damg.c b/src/snes/utils/damg.c
> --- a/src/snes/utils/damg.c
> +++ b/src/snes/utils/damg.c
> @@ -65,7 +65,7 @@
>    p[i]->user     = user;
>    p[i]->updatejacobianperiod = 1;
>    p[i]->updatejacobian       = PETSC_TRUE;
> -    p[i]->isctype  = IS_COLORING_GHOSTED;   /* default to faster  
> version, requires DMMGSetSNESLocal() */
> +    p[i]->isctype  = IS_COLORING_GLOBAL;
>    ierr           = PetscStrallocpy(MATAIJ,&p[i]- 
> >mtype);CHKERRQ(ierr);
>  }
>  *dmmg = p;
> diff --git a/src/snes/utils/damgsnes.c b/src/snes/utils/damgsnes.c
> --- a/src/snes/utils/damgsnes.c
> +++ b/src/snes/utils/damgsnes.c
> @@ -942,16 +942,9 @@
>  CHKMEMQ;
>  ierr = PetscObjectGetCookie((PetscObject) dmmg[0]- 
> >dm,&cookie);CHKERRQ(ierr);
>  if (cookie == DM_COOKIE) {
> -    PetscTruth flag = PETSC_FALSE;
> -    /* it makes no sense to use an option to decide on ghost, it  
> depends on whether the
> -       formfunctionlocal computes ghost values in F or not. */
> -    ierr = PetscOptionsGetTruth(PETSC_NULL, "- 
> dmmg_form_function_ghost", &flag,PETSC_NULL);CHKERRQ(ierr);
> -    if (flag) {
> -      ierr =  
> DMMGSetSNES(dmmg,DMMGFormFunctionGhost,computejacobian);CHKERRQ(ierr);
> -    } else {
> -      ierr =  
> DMMGSetSNES(dmmg,DMMGFormFunction,computejacobian);CHKERRQ(ierr);
> -    }
> +    ierr =  
> DMMGSetSNES(dmmg,DMMGFormFunction,computejacobian);CHKERRQ(ierr);
>    for (i=0; i<nlevels; i++) {
> +      dmmg[i]->isctype  = IS_COLORING_GHOSTED;   /* switch to  
> faster version since have local function evaluation */
>      ierr = DASetLocalFunction((DA)dmmg[i]- 
> >dm,function);CHKERRQ(ierr);
>      dmmg[i]->lfj = (PetscErrorCode (*)(void))function;
>      ierr = DASetLocalJacobian((DA)dmmg[i]- 
> >dm,jacobian);CHKERRQ(ierr);
>
>
>
>
> -- 
> 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-dev/attachments/20100324/32b378a7/attachment.html>


More information about the petsc-dev mailing list