Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PETSC Warning #76

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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