Skip to content

Commit

Permalink
Fix PETSC Warning
Browse files Browse the repository at this point in the history
Recent PETSC versions request PETSC_NULLPTR instead of PETSC_NULL
  • Loading branch information
Gerharddc committed Nov 22, 2024
1 parent ad7efc8 commit 6dff0c0
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/expression/operation/sl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1813,7 +1813,7 @@ void sl::solve(mat A, vec b, vec sol, double& relrestol, int& maxnumit, std::str

// Request to print the iteration information to the console:
if (verbosity > 0)
KSPMonitorSet(*ksp, mykspmonitor, PETSC_NULL, PETSC_NULL);
KSPMonitorSet(*ksp, mykspmonitor, PETSC_NULLPTR, PETSC_NULLPTR);

KSPSetFromOptions(*ksp);

Expand Down
4 changes: 2 additions & 2 deletions src/formulation/rawmat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ rawmat::~rawmat(void)

if (ispetscinitialized == PETSC_TRUE)
{
if (Amat != PETSC_NULL)
if (Amat != PETSC_NULLPTR)
MatDestroy(&Amat);
if (Dmat != PETSC_NULL)
if (Dmat != PETSC_NULLPTR)
MatDestroy(&Dmat);
if (isitfactored)
KSPDestroy(&myksp);
Expand Down
4 changes: 2 additions & 2 deletions src/formulation/rawmat.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ class rawmat
// Ainds[i] is the index in Atotal of the ith index in A:
indexmat Ainds, Dinds;

Mat Amat = PETSC_NULL, Dmat = PETSC_NULL;
Mat Amat = PETSC_NULLPTR, Dmat = PETSC_NULLPTR;

// 'myksp' will store the factorization if it is to be reused:
KSP myksp = PETSC_NULL;
KSP myksp = PETSC_NULLPTR;
bool factorizationreuse = false;
bool isitfactored = false;

Expand Down
2 changes: 1 addition & 1 deletion src/formulation/rawvec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ rawvec::~rawvec(void)
PetscBool ispetscinitialized;
PetscInitialized(&ispetscinitialized);

if (ispetscinitialized == PETSC_TRUE && myvec != PETSC_NULL)
if (ispetscinitialized == PETSC_TRUE && myvec != PETSC_NULLPTR)
VecDestroy(&myvec);
}

Expand Down
2 changes: 1 addition & 1 deletion src/formulation/rawvec.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class rawvec : public std::enable_shared_from_this<rawvec>
{
private:

Vec myvec = PETSC_NULL;
Vec myvec = PETSC_NULLPTR;
std::shared_ptr<dofmanager> mydofmanager = NULL;


Expand Down
2 changes: 1 addition & 1 deletion src/mesh/petscmesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void petscmesh::extract(nodes& mynodes, elements& myelements, physicalregions& m
{
///// Extract the node coordinates:

Vec coordvec = PETSC_NULL;
Vec coordvec = PETSC_NULLPTR;
DMGetCoordinates(mypetscmesh, &coordvec);

int numberofnodes;
Expand Down
2 changes: 1 addition & 1 deletion src/resolution/eigenvalue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ void eigenvalue::compute(int numeigenvaluestocompute, double targeteigenvaluemag
PCSetType(pc, PCLU);

PEPSTOARSetDetectZeros(pep,PETSC_TRUE);
PEPSetScale(pep, PEP_SCALE_SCALAR, PETSC_DECIDE, PETSC_NULL, PETSC_NULL, PETSC_DECIDE, PETSC_DECIDE);
PEPSetScale(pep, PEP_SCALE_SCALAR, PETSC_DECIDE, PETSC_NULLPTR, PETSC_NULLPTR, PETSC_DECIDE, PETSC_DECIDE);

PCFactorSetMatSolverType(pc, universe::solvertype);
PEPSetFromOptions(pep);
Expand Down

0 comments on commit 6dff0c0

Please sign in to comment.