Commits

BarryFSmith committed 0ecdbf9

fixed bug in DMMGCreate() that it ALWAYS used ghosted coloring even when it would not work.

Hg-commit: e8e19296a5dc3af77e5093340b31488fecd63b9d

Comments (0)

Files changed (2)

src/snes/utils/damg.c

     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;

src/snes/utils/damgsnes.c

   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);
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.