1. petsc
  2. PETSc
  3. petsc

Commits

Matt Knepley  committed fb07c94

DMPlex: DMSetCoordinates() does not allow NULL

  • Participants
  • Parent commits 1c161d0
  • Branches master

Comments (0)

Files changed (1)

File src/dm/impls/plex/plexcreate.c

View file
   ierr           = DMSetApplicationContext(*newdm, ctx);CHKERRQ(ierr);
   ierr           = DMGetCoordinatesLocal(dm, &coords);CHKERRQ(ierr);
   if (coords) {
-    ierr         = DMSetCoordinatesLocal(*newdm, coords);CHKERRQ(ierr);
-  } else {
+    ierr         = DMSetCoordinatesLocal(*newdm, coords);CHKERRQ(ierr);}
+  else {
     ierr         = DMGetCoordinates(dm, &coords);CHKERRQ(ierr);
-    ierr         = DMSetCoordinates(*newdm, coords);CHKERRQ(ierr);
+    if (coords) {ierr = DMSetCoordinates(*newdm, coords);CHKERRQ(ierr);}
   }
   PetscFunctionReturn(0);
 }