Skip to content

Commit fd629fe

Browse files
committed
Guard PETSc version
1 parent 93a2181 commit fd629fe

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/numerics/petsc_matrix.C

+6
Original file line numberDiff line numberDiff line change
@@ -473,10 +473,16 @@ void PetscMatrix<T>::update_preallocation_and_zero ()
473473
template <typename T>
474474
void PetscMatrix<T>::reset_preallocation()
475475
{
476+
#if !PETSC_VERSION_LESS_THAN(3,8,0)
476477
libmesh_assert (this->initialized());
477478

478479
auto ierr = MatResetPreallocation(_mat);
479480
LIBMESH_CHKERR(ierr);
481+
#else
482+
libmesh_warning("Your version of PETSc doesn't support resetting of "
483+
"preallocation, so we will use your most recent sparsity "
484+
"pattern. This may result in a degradation of performance\n");
485+
#endif
480486
}
481487

482488
template <typename T>

0 commit comments

Comments
 (0)