diff --git a/src/solvers/petsc_dm_wrapper.C b/src/solvers/petsc_dm_wrapper.C index e883a644594..e0e027ea5e8 100644 --- a/src/solvers/petsc_dm_wrapper.C +++ b/src/solvers/petsc_dm_wrapper.C @@ -74,7 +74,11 @@ 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 @@ -82,7 +86,11 @@ void PetscDMWrapper::init_and_attach_petscdm(System & system, SNES & snes) { // 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); } }