Skip to content

Commit

Permalink
Fix PETSc deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jwpeterson committed Oct 12, 2020
1 parent 7d126e1 commit 073eeed
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/solvers/petsc_dm_wrapper.C
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,23 @@ void PetscDMWrapper::init_and_attach_petscdm(System & system, SNES & snes)

// Build the PetscSection and attach it to the DM
this->build_section(system, section);
#if PETSC_VERSION_LESS_THAN(3,10,0)
ierr = DMSetDefaultSection(dm, section);
#else
ierr = DMSetSection(dm, section);
#endif
CHKERRABORT(system.comm().get(),ierr);

// We only need to build the star forest if we're in a parallel environment
if (system.n_processors() > 1)
{
// Build the PetscSF and attach it to the DM
this->build_sf(system, star_forest);
#if PETSC_VERSION_LESS_THAN(3,12,0)
ierr = DMSetDefaultSF(dm, star_forest);
#else
ierr = DMSetSectionSF(dm, star_forest);
#endif
CHKERRABORT(system.comm().get(),ierr);
}
}
Expand Down

0 comments on commit 073eeed

Please sign in to comment.