From 11143907b1b930b8ff50c31d67d6704e083c4c45 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Fri, 7 Apr 2017 01:03:54 +0200 Subject: [PATCH] Replace PETSC_NULL --- include/deal.II/lac/petsc_vector_base.h | 2 +- source/base/mpi.cc | 4 ++-- source/lac/petsc_full_matrix.cc | 2 +- source/lac/petsc_matrix_base.cc | 2 +- source/lac/petsc_solver.cc | 4 ++-- source/lac/slepc_solver.cc | 6 +++--- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/deal.II/lac/petsc_vector_base.h b/include/deal.II/lac/petsc_vector_base.h index cf7dac42b4..e52dd26678 100644 --- a/include/deal.II/lac/petsc_vector_base.h +++ b/include/deal.II/lac/petsc_vector_base.h @@ -1190,7 +1190,7 @@ namespace PETScWrappers PetscErrorCode ierr = VecGetOwnershipRange (vector, &begin, &end); AssertThrow (ierr == 0, ExcPETScError(ierr)); - Vec locally_stored_elements = PETSC_NULL; + Vec locally_stored_elements = nullptr; ierr = VecGhostGetLocalForm(vector, &locally_stored_elements); AssertThrow (ierr == 0, ExcPETScError(ierr)); diff --git a/source/base/mpi.cc b/source/base/mpi.cc index 2291631db9..b2bd554b18 100644 --- a/source/base/mpi.cc +++ b/source/base/mpi.cc @@ -340,11 +340,11 @@ namespace Utilities #ifdef DEAL_II_WITH_PETSC # ifdef DEAL_II_WITH_SLEPC // Initialize SLEPc (with PETSc): - ierr = SlepcInitialize(&argc, &argv, PETSC_NULL, PETSC_NULL); + ierr = SlepcInitialize(&argc, &argv, nullptr, nullptr); AssertThrow (ierr == 0, SLEPcWrappers::SolverBase::ExcSLEPcError(ierr)); # else // or just initialize PETSc alone: - ierr = PetscInitialize(&argc, &argv, PETSC_NULL, PETSC_NULL); + ierr = PetscInitialize(&argc, &argv, nullptr, nullptr); AssertThrow (ierr == 0, ExcPETScError(ierr)); # endif #endif diff --git a/source/lac/petsc_full_matrix.cc b/source/lac/petsc_full_matrix.cc index f47cf7db0e..a0938f0edc 100644 --- a/source/lac/petsc_full_matrix.cc +++ b/source/lac/petsc_full_matrix.cc @@ -56,7 +56,7 @@ namespace PETScWrappers // use the call sequence indicating only a maximal number of // elements per row for all rows globally const PetscErrorCode ierr = MatCreateSeqDense (PETSC_COMM_SELF, m, n, - PETSC_NULL, &matrix); + nullptr, &matrix); AssertThrow (ierr == 0, ExcPETScError(ierr)); } diff --git a/source/lac/petsc_matrix_base.cc b/source/lac/petsc_matrix_base.cc index 4b0b53e89f..ac5c4b77db 100644 --- a/source/lac/petsc_matrix_base.cc +++ b/source/lac/petsc_matrix_base.cc @@ -161,7 +161,7 @@ namespace PETScWrappers const PetscErrorCode ierr = MatZeroRowsIS(matrix, index_set, new_diag_value); #else const PetscErrorCode ierr = MatZeroRowsIS(matrix, index_set, new_diag_value, - PETSC_NULL, PETSC_NULL); + nullptr, nullptr); #endif AssertThrow (ierr == 0, ExcPETScError(ierr)); diff --git a/source/lac/petsc_solver.cc b/source/lac/petsc_solver.cc index 1654a29d3d..7fad31b1f1 100644 --- a/source/lac/petsc_solver.cc +++ b/source/lac/petsc_solver.cc @@ -110,7 +110,7 @@ namespace PETScWrappers // convergence ierr = KSPSetConvergenceTest (solver_data->ksp, &convergence_test, reinterpret_cast(&solver_control), - PETSC_NULL); + nullptr); AssertThrow (ierr == 0, ExcPETScError(ierr)); } @@ -228,7 +228,7 @@ namespace PETScWrappers // convergence ierr = KSPSetConvergenceTest (solver_data->ksp, &convergence_test, reinterpret_cast(&solver_control), - PETSC_NULL); + nullptr); AssertThrow (ierr == 0, ExcPETScError(ierr)); // set the command line options provided diff --git a/source/lac/slepc_solver.cc b/source/lac/slepc_solver.cc index 24481fb38a..1d1142fb11 100644 --- a/source/lac/slepc_solver.cc +++ b/source/lac/slepc_solver.cc @@ -75,7 +75,7 @@ namespace SLEPcWrappers SolverBase::set_matrices (const PETScWrappers::MatrixBase &A) { // standard eigenspectrum problem - const PetscErrorCode ierr = EPSSetOperators (eps, A, PETSC_NULL); + const PetscErrorCode ierr = EPSSetOperators (eps, A, nullptr); AssertThrow (ierr == 0, ExcSLEPcError(ierr)); } @@ -231,8 +231,8 @@ namespace SLEPcWrappers { // get converged eigenpair const PetscErrorCode ierr = EPSGetEigenpair (eps, index, - &eigenvalues, PETSC_NULL, - eigenvectors, PETSC_NULL); + &eigenvalues, nullptr, + eigenvectors, nullptr); AssertThrow (ierr == 0, ExcSLEPcError(ierr)); } -- 2.39.5