[petsc-dev] -dmmg_form_function_ghost

Matthew Knepley knepley at gmail.com
Wed Mar 24 17:02:27 CDT 2010


That option dates from the time I was trying to use DA to do structured
finite elements. I have since given up on this, and use a CartesianMesh
which has more support for this. Of course, eventually they should merge.

   Matt

On Wed, Mar 24, 2010 at 4:56 PM, Jed Brown <jed at 59a2.org> 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/205c1b65/attachment.html>


More information about the petsc-dev mailing list