Jed Brown avatar Jed Brown committed ec6a4d0

DMPlex Fortran: allow PETSC_NULL_OBJECT for sections

Reported-by: Dharmendar Reddy <dharmareddy84@gmail.com>;

Comments (0)

Files changed (1)

src/dm/impls/plex/f90-custom/zplexf90.c

   PetscScalar *v = NULL;
   PetscInt     n;
 
+  CHKFORTRANNULLOBJECT(section);
   *ierr = DMPlexVecGetClosure(*dm, *section, *x, *point, &n, &v);if (*ierr) return;
   *ierr = F90Array1dCreate((void*) v, PETSC_SCALAR, 1, n, ptr PETSC_F90_2PTR_PARAM(ptrd));
 }
 {
   PetscScalar *array;
 
+  CHKFORTRANNULLOBJECT(section);
   *ierr = F90Array1dAccess(ptr, PETSC_SCALAR, (void **) &array PETSC_F90_2PTR_PARAM(ptrd));if (*ierr) return;
   *ierr = DMPlexVecRestoreClosure(*dm, *section, *v, *point, NULL, &array);if (*ierr) return;
   *ierr = F90Array1dDestroy(ptr, PETSC_SCALAR PETSC_F90_2PTR_PARAM(ptrd));if (*ierr) return;
 {
   PetscScalar *array;
 
+  CHKFORTRANNULLOBJECT(section);
   *ierr = F90Array1dAccess(ptr, PETSC_SCALAR, (void**) &array PETSC_F90_2PTR_PARAM(ptrd));if (*ierr) return;
   *ierr = DMPlexVecSetClosure(*dm, *section, *v, *point, array, *mode);
 }
 {
   PetscScalar *array;
 
+  CHKFORTRANNULLOBJECT(section);
+  CHKFORTRANNULLOBJECT(globalSection);
   *ierr = F90Array1dAccess(ptr, PETSC_SCALAR, (void**) &array PETSC_F90_2PTR_PARAM(ptrd));if (*ierr) return;
   *ierr = DMPlexMatSetClosure(*dm, *section, *globalSection, *A, *point, array, *mode);
 }
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.