Skip to content

Commit 797bc20

Browse files
authored
Merge pull request #3590 from roystgnr/petsc_macro_fixes
PETSC_RELEASE_LESS_THAN -> PETSC_VERSION_LESS_THAN
2 parents bc2b494 + d7659c5 commit 797bc20

6 files changed

Lines changed: 10 additions & 10 deletions

File tree

include/numerics/petsc_macro.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
#define ISCreateLibMesh(comm,n,idx,mode,is) ISCreateGeneral((comm),(n),(idx),(mode),(is))
8989

9090
// As of release 3.8.0, MatGetSubMatrix was renamed to MatCreateSubMatrix.
91-
#if PETSC_RELEASE_LESS_THAN(3,8,0)
91+
#if PETSC_VERSION_LESS_THAN(3,8,0)
9292
# define LibMeshCreateSubMatrix MatGetSubMatrix
9393
#else
9494
# define LibMeshCreateSubMatrix MatCreateSubMatrix
@@ -108,7 +108,7 @@
108108

109109
// As of 3.18, %D is no longer supported in format strings, but the
110110
// replacement PetscInt_FMT didn't get added until 3.7.2
111-
#if PETSC_RELEASE_LESS_THAN(3,8,0)
111+
#if PETSC_VERSION_LESS_THAN(3,8,0)
112112
# define LIBMESH_PETSCINT_FMT "D"
113113
#else
114114
# define LIBMESH_PETSCINT_FMT PetscInt_FMT

src/solvers/petsc_diff_solver.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ DiffSolver::SolveResult convert_solve_result(SNESConvergedReason r)
254254
// SNES_CONVERGED_TR_DELTA was changed to a diverged condition,
255255
// SNES_DIVERGED_TR_DELTA, in PETSc 1c6b2ff8df. This change will
256256
// likely be in 3.12 and later releases.
257-
#if PETSC_RELEASE_LESS_THAN(3,12,0)
257+
#if PETSC_VERSION_LESS_THAN(3,12,0)
258258
case SNES_CONVERGED_TR_DELTA:
259259
#endif
260260
return DiffSolver::CONVERGED_NO_REASON;

src/solvers/petsc_linear_solver.C

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ void PetscLinearSolver<T>::get_residual_history(std::vector<double> & hist)
746746

747747
// Recent versions of PETSc require the residual
748748
// history vector pointer to be declared as const.
749-
#if PETSC_RELEASE_LESS_THAN(3,15,0)
749+
#if PETSC_VERSION_LESS_THAN(3,15,0)
750750
PetscReal * p;
751751
#else
752752
const PetscReal * p;
@@ -787,7 +787,7 @@ Real PetscLinearSolver<T>::get_initial_residual()
787787

788788
// Recent versions of PETSc require the residual
789789
// history vector pointer to be declared as const.
790-
#if PETSC_RELEASE_LESS_THAN(3,15,0)
790+
#if PETSC_VERSION_LESS_THAN(3,15,0)
791791
PetscReal * p;
792792
#else
793793
const PetscReal * p;

src/solvers/petscdmlibmesh.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
#ifdef LIBMESH_HAVE_PETSC
2323

24-
#if !PETSC_RELEASE_LESS_THAN(3,6,0)
24+
#if !PETSC_VERSION_LESS_THAN(3,6,0)
2525
# include <petsc/private/petscimpl.h>
2626
#else
2727
# include <petsc-private/petscimpl.h>

src/solvers/petscdmlibmeshimpl.C

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include "libmesh/ignore_warnings.h"
2525

2626
// PETSc includes
27-
#if !PETSC_RELEASE_LESS_THAN(3,6,0)
27+
#if !PETSC_VERSION_LESS_THAN(3,6,0)
2828
# include <petsc/private/dmimpl.h>
2929
#else
3030
# include <petsc-private/dmimpl.h>
@@ -796,7 +796,7 @@ static PetscErrorCode DMCreateGlobalVector_libMesh(DM dm, Vec *x)
796796
ierr = VecDuplicate(v,x); CHKERRQ(ierr);
797797
}
798798

799-
#if PETSC_RELEASE_LESS_THAN(3,13,0)
799+
#if PETSC_VERSION_LESS_THAN(3,13,0)
800800
ierr = PetscObjectCompose((PetscObject)*x,"DM",(PetscObject)dm); CHKERRQ(ierr);
801801
#else
802802
ierr = VecSetDM(*x, dm);CHKERRQ(ierr);
@@ -983,7 +983,7 @@ PetscErrorCode DMCreate_libMesh(DM dm)
983983
// * dm->ops->getinjection was renamed to dm->ops->createinjection in PETSc 5a84ad338 (5 Jul 2019)
984984
// * dm->ops-getaggregates was removed in PETSc 97779f9a (5 Jul 2019)
985985
// * Both changes were merged into PETSc master in 94aad3ce (7 Jul 2019).
986-
#if PETSC_RELEASE_LESS_THAN(3,12,0)
986+
#if PETSC_VERSION_LESS_THAN(3,12,0)
987987
dm->ops->getinjection = 0; // DMGetInjection_libMesh;
988988
dm->ops->getaggregates = 0; // DMGetAggregates_libMesh;
989989
#else

src/solvers/tao_optimization_solver.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ void TaoOptimizationSolver<T>::solve ()
496496
// ||g(X)|| / ||g(X0)|| <= gttol
497497
// Command line equivalents: -tao_fatol, -tao_frtol, -tao_gatol, -tao_grtol, -tao_gttol
498498
ierr = TaoSetTolerances(_tao,
499-
#if PETSC_RELEASE_LESS_THAN(3,7,0)
499+
#if PETSC_VERSION_LESS_THAN(3,7,0)
500500
// Releases up to 3.X.Y had fatol and frtol, after that they were removed.
501501
// Hopefully we'll be able to know X and Y soon. Guessing at 3.7.0.
502502
/*fatol=*/PETSC_DEFAULT,

0 commit comments

Comments
 (0)