[petsc-dev] -dmmg_form_function_ghost
Jed Brown
jed at 59A2.org
Wed Mar 24 16:56:50 CDT 2010
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);
More information about the petsc-dev
mailing list