<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div> Jed uses it in the best example in PETSc! ex48<div><br></div><div> Barry</div><div><br><div><div>On Mar 24, 2010, at 5:06 PM, Matthew Knepley wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">On Wed, Mar 24, 2010 at 5:04 PM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"> <br> Sorry, I was so stunned when I saw that option I just automatically nuked it.<br> <br> I have pushed 3.1 and dev with the option again.<br> <br> Does your code support ghosted finite differences? With this option?</blockquote><div><br></div><div>I am cool with the nuking. It was not really being used. I can't even remember</div><div>exactly what I was working around. I would redo it if I get to this again.</div> <div><br></div><div> Matt </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><font color="#888888"><br> <br> Barry</font><div><div></div><div class="h5"><br> <br> On Mar 24, 2010, at 4:56 PM, Jed Brown wrote:<br> <br> <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> I know this was an absolutely horrendous API, but this patch completely<br> removed the option which makes ex48 fail (and certainly some user code).<br> Releaes-3.1 either needs to get a proper API for this, or the option<br> needs to remain available. DMMGFormFunctionGhost is currently<br> unreachable.<br> <br> (I'll add some ex48 tests to get them run in the nightlies, I should<br> have done this long ago.)<br> <br> Jed<br> <br> <br> changeset: 15513:e8e19296a5dc<br> parent: 15511:2cefbdbb44a8<br> user: Barry Smith <a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a><br> date: Wed Mar 24 16:39:07 2010 -0500<br> files: src/snes/utils/damg.c src/snes/utils/damgsnes.c<br> description:<br> fixed bug in DMMGCreate() that it ALWAYS used ghosted coloring even when it would not work.<br> <br> <br> diff --git a/src/snes/utils/damg.c b/src/snes/utils/damg.c<br> --- a/src/snes/utils/damg.c<br> +++ b/src/snes/utils/damg.c<br> @@ -65,7 +65,7 @@<br> p[i]->user = user;<br> p[i]->updatejacobianperiod = 1;<br> p[i]->updatejacobian = PETSC_TRUE;<br> - p[i]->isctype = IS_COLORING_GHOSTED; /* default to faster version, requires DMMGSetSNESLocal() */<br> + p[i]->isctype = IS_COLORING_GLOBAL;<br> ierr = PetscStrallocpy(MATAIJ,&p[i]->mtype);CHKERRQ(ierr);<br> }<br> *dmmg = p;<br> diff --git a/src/snes/utils/damgsnes.c b/src/snes/utils/damgsnes.c<br> --- a/src/snes/utils/damgsnes.c<br> +++ b/src/snes/utils/damgsnes.c<br> @@ -942,16 +942,9 @@<br> CHKMEMQ;<br> ierr = PetscObjectGetCookie((PetscObject) dmmg[0]->dm,&cookie);CHKERRQ(ierr);<br> if (cookie == DM_COOKIE) {<br> - PetscTruth flag = PETSC_FALSE;<br> - /* it makes no sense to use an option to decide on ghost, it depends on whether the<br> - formfunctionlocal computes ghost values in F or not. */<br> - ierr = PetscOptionsGetTruth(PETSC_NULL, "-dmmg_form_function_ghost", &flag,PETSC_NULL);CHKERRQ(ierr);<br> - if (flag) {<br> - ierr = DMMGSetSNES(dmmg,DMMGFormFunctionGhost,computejacobian);CHKERRQ(ierr);<br> - } else {<br> - ierr = DMMGSetSNES(dmmg,DMMGFormFunction,computejacobian);CHKERRQ(ierr);<br> - }<br> + ierr = DMMGSetSNES(dmmg,DMMGFormFunction,computejacobian);CHKERRQ(ierr);<br> for (i=0; i<nlevels; i++) {<br> + dmmg[i]->isctype = IS_COLORING_GHOSTED; /* switch to faster version since have local function evaluation */<br> ierr = DASetLocalFunction((DA)dmmg[i]->dm,function);CHKERRQ(ierr);<br> dmmg[i]->lfj = (PetscErrorCode (*)(void))function;<br> ierr = DASetLocalJacobian((DA)dmmg[i]->dm,jacobian);CHKERRQ(ierr);<br> </blockquote> <br> </div></div></blockquote></div><br><br clear="all"><br>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br> -- Norbert Wiener<br></blockquote></div><br></div></body></html>