[cig-commits] r21346 - in short/3D/PyLith/branches/v1.8-stable/libsrc/pylith: faults problems topology
brad at geodynamics.org
brad at geodynamics.org
Thu Feb 7 13:56:39 PST 2013
Author: brad
Date: 2013-02-07 13:56:39 -0800 (Thu, 07 Feb 2013)
New Revision: 21346
Modified:
short/3D/PyLith/branches/v1.8-stable/libsrc/pylith/faults/FaultCohesiveDyn.cc
short/3D/PyLith/branches/v1.8-stable/libsrc/pylith/problems/Solver.cc
short/3D/PyLith/branches/v1.8-stable/libsrc/pylith/problems/SolverNonlinear.cc
short/3D/PyLith/branches/v1.8-stable/libsrc/pylith/topology/Field.cc
short/3D/PyLith/branches/v1.8-stable/libsrc/pylith/topology/Jacobian.cc
short/3D/PyLith/branches/v1.8-stable/libsrc/pylith/topology/MeshRefiner.cc
Log:
Changed PETSC_NULL to NULL (sync with PETSc).
Modified: short/3D/PyLith/branches/v1.8-stable/libsrc/pylith/faults/FaultCohesiveDyn.cc
===================================================================
--- short/3D/PyLith/branches/v1.8-stable/libsrc/pylith/faults/FaultCohesiveDyn.cc 2013-02-07 18:41:37 UTC (rev 21345)
+++ short/3D/PyLith/branches/v1.8-stable/libsrc/pylith/faults/FaultCohesiveDyn.cc 2013-02-07 21:56:39 UTC (rev 21346)
@@ -1990,7 +1990,7 @@
for (int i=0; i < subnrows; ++i) {
indicesLocal[iCohesiveCell*subnrows+indicesPerm[i]] = i;
} // for
- cellsIS[iCohesiveCell] = PETSC_NULL;
+ cellsIS[iCohesiveCell] = NULL;
err = ISCreateGeneral(PETSC_COMM_SELF, indicesGlobal.size(), &indicesGlobal[0], PETSC_COPY_VALUES, &cellsIS[iCohesiveCell]);CHECK_PETSC_ERROR(err);
} // for
Modified: short/3D/PyLith/branches/v1.8-stable/libsrc/pylith/problems/Solver.cc
===================================================================
--- short/3D/PyLith/branches/v1.8-stable/libsrc/pylith/problems/Solver.cc 2013-02-07 18:41:37 UTC (rev 21345)
+++ short/3D/PyLith/branches/v1.8-stable/libsrc/pylith/problems/Solver.cc 2013-02-07 21:56:39 UTC (rev 21346)
@@ -190,9 +190,9 @@
// Allocate just the diagonal.
err = MatSeqAIJSetPreallocation(_jacobianPCFault, 1,
- PETSC_NULL); CHECK_PETSC_ERROR(err);
- err = MatMPIAIJSetPreallocation(_jacobianPCFault, 1, PETSC_NULL,
- 0, PETSC_NULL); CHECK_PETSC_ERROR(err);
+ NULL); CHECK_PETSC_ERROR(err);
+ err = MatMPIAIJSetPreallocation(_jacobianPCFault, 1, NULL,
+ 0, NULL); CHECK_PETSC_ERROR(err);
// Set preconditioning matrix in formulation
formulation->customPCMatrix(_jacobianPCFault);
@@ -221,16 +221,16 @@
if (separateComponents) {
PetscMat* precon = new PetscMat[numSpaces];
for (int i=0; i < numSpaces; ++i) {
- precon[i] = PETSC_NULL;
+ precon[i] = NULL;
} // for
precon[numSpaces-1] = _jacobianPCFault;
- constructFieldSplit(solutionSection, PETSC_DETERMINE, PETSC_NULL, PETSC_NULL,
- sieveMesh->getFactory()->getGlobalOrder(sieveMesh, "default", solutionSection), precon, PETSC_NULL, solution.vector(), *pc);
+ constructFieldSplit(solutionSection, PETSC_DETERMINE, NULL, NULL,
+ sieveMesh->getFactory()->getGlobalOrder(sieveMesh, "default", solutionSection), precon, NULL, solution.vector(), *pc);
delete[] precon; precon = 0;
} else {
int numFields[2] = {spaceDim, (numSpaces > spaceDim) ? 1 : 0};
- MatNullSpace nullsp[2] = {PETSC_NULL, PETSC_NULL};
- PetscMat precon[2] = {PETSC_NULL, _jacobianPCFault};
+ MatNullSpace nullsp[2] = {NULL, NULL};
+ PetscMat precon[2] = {NULL, _jacobianPCFault};
int* fields = new int[numSpaces];
// Create rigid body null space.
@@ -284,7 +284,7 @@
err = VecCopy(solution.vector(), mode[d]);CHECK_PETSC_ERROR(err);
} // for
for (int i=0; i < dim; ++i) {
- err = VecNormalize(mode[i], PETSC_NULL);CHECK_PETSC_ERROR(err);
+ err = VecNormalize(mode[i], NULL);CHECK_PETSC_ERROR(err);
} // for
/* Orthonormalize system */
for (int i = dim; i < m; ++i) {
@@ -293,7 +293,7 @@
err = VecMDot(mode[i], i, mode, dots);CHECK_PETSC_ERROR(err);
for(int j=0; j < i; ++j) dots[j] *= -1.0;
err = VecMAXPY(mode[i], i, dots, mode);CHECK_PETSC_ERROR(err);
- err = VecNormalize(mode[i], PETSC_NULL);CHECK_PETSC_ERROR(err);
+ err = VecNormalize(mode[i], NULL);CHECK_PETSC_ERROR(err);
} // for
err = MatNullSpaceCreate(sieveMesh->comm(), PETSC_FALSE, m, mode, &nullsp[0]);CHECK_PETSC_ERROR(err);
for(int i=0; i< m; ++i) {err = VecDestroy(&mode[i]);CHECK_PETSC_ERROR(err);}
Modified: short/3D/PyLith/branches/v1.8-stable/libsrc/pylith/problems/SolverNonlinear.cc
===================================================================
--- short/3D/PyLith/branches/v1.8-stable/libsrc/pylith/problems/SolverNonlinear.cc 2013-02-07 18:41:37 UTC (rev 21345)
+++ short/3D/PyLith/branches/v1.8-stable/libsrc/pylith/problems/SolverNonlinear.cc 2013-02-07 21:56:39 UTC (rev 21346)
@@ -140,7 +140,7 @@
PetscErrorCode err = 0;
const PetscVec solutionVec = solution->vector();
- err = SNESSolve(_snes, PETSC_NULL, solutionVec); CHECK_PETSC_ERROR(err);
+ err = SNESSolve(_snes, NULL, solutionVec); CHECK_PETSC_ERROR(err);
_logger->eventEnd(solveEvent);
_logger->eventBegin(scatterEvent);
@@ -235,13 +235,13 @@
ierr = SNESLineSearchGetLambda(linesearch, &lambda);CHKERRQ(ierr);
ierr = SNESLineSearchGetSNES(linesearch, &snes);CHKERRQ(ierr);
ierr = SNESLineSearchGetMonitor(linesearch, &monitor);CHKERRQ(ierr);
- ierr = SNESLineSearchGetTolerances(linesearch, &minlambda, &maxstep, PETSC_NULL, PETSC_NULL, PETSC_NULL, &max_its);CHKERRQ(ierr);
- ierr = SNESGetTolerances(snes, PETSC_NULL, PETSC_NULL, &stol, PETSC_NULL, PETSC_NULL);CHKERRQ(ierr);
+ ierr = SNESLineSearchGetTolerances(linesearch, &minlambda, &maxstep, NULL, NULL, NULL, &max_its);CHKERRQ(ierr);
+ ierr = SNESGetTolerances(snes, NULL, NULL, &stol, NULL, NULL);CHKERRQ(ierr);
bt = (PetscSNESLineSearch_BT *)linesearch->data;
alpha = bt->alpha;
- ierr = SNESGetJacobian(snes, &jac, PETSC_NULL, PETSC_NULL, PETSC_NULL);CHKERRQ(ierr);
+ ierr = SNESGetJacobian(snes, &jac, NULL, NULL, NULL);CHKERRQ(ierr);
if (!jac) {
SETERRQ(((PetscObject)linesearch)->comm, PETSC_ERR_USER, "SNESLineSearchBT requires a Jacobian matrix");
}
Modified: short/3D/PyLith/branches/v1.8-stable/libsrc/pylith/topology/Field.cc
===================================================================
--- short/3D/PyLith/branches/v1.8-stable/libsrc/pylith/topology/Field.cc 2013-02-07 18:41:37 UTC (rev 21345)
+++ short/3D/PyLith/branches/v1.8-stable/libsrc/pylith/topology/Field.cc 2013-02-07 21:56:39 UTC (rev 21346)
@@ -375,7 +375,7 @@
CHECK_PETSC_ERROR(err);
} else {
err = VecCreateSeqWithArray(PETSC_COMM_SELF,
- blockSize, 0, PETSC_NULL,
+ blockSize, 0, NULL,
&sinfo.scatterVec);
CHECK_PETSC_ERROR(err);
} // else
@@ -785,7 +785,7 @@
&sinfo.scatterVec);CHECK_PETSC_ERROR(err);
} else {
err = VecCreateSeqWithArray(PETSC_COMM_SELF,
- blockSize, 0, PETSC_NULL,
+ blockSize, 0, NULL,
&sinfo.scatterVec);CHECK_PETSC_ERROR(err);
} // else
@@ -864,7 +864,7 @@
&sinfo.scatterVec);CHECK_PETSC_ERROR(err);
} else {
err = VecCreateSeqWithArray(PETSC_COMM_SELF,
- blockSize, 0, PETSC_NULL,
+ blockSize, 0, NULL,
&sinfo.scatterVec);CHECK_PETSC_ERROR(err);
} // else
@@ -944,7 +944,7 @@
&sinfo.scatterVec);CHECK_PETSC_ERROR(err);
} else {
err = VecCreateSeqWithArray(PETSC_COMM_SELF,
- blockSize, 0, PETSC_NULL,
+ blockSize, 0, NULL,
&sinfo.scatterVec);CHECK_PETSC_ERROR(err);
} // else
@@ -1020,7 +1020,7 @@
&sinfo.scatterVec);CHECK_PETSC_ERROR(err);
} else {
err = VecCreateSeqWithArray(PETSC_COMM_SELF,
- blockSize, 0, PETSC_NULL,
+ blockSize, 0, NULL,
&sinfo.scatterVec);CHECK_PETSC_ERROR(err);
} // else
Modified: short/3D/PyLith/branches/v1.8-stable/libsrc/pylith/topology/Jacobian.cc
===================================================================
--- short/3D/PyLith/branches/v1.8-stable/libsrc/pylith/topology/Jacobian.cc 2013-02-07 18:41:37 UTC (rev 21345)
+++ short/3D/PyLith/branches/v1.8-stable/libsrc/pylith/topology/Jacobian.cc 2013-02-07 21:56:39 UTC (rev 21346)
@@ -138,7 +138,7 @@
for(PetscInt r = rStart; r < rEnd; ++r) {
PetscInt c;
- err = MatGetRow(_matrix,r, &ncols, &cols, PETSC_NULL);CHECK_PETSC_ERROR(err);
+ err = MatGetRow(_matrix,r, &ncols, &cols, NULL);CHECK_PETSC_ERROR(err);
if (!ncols) {
std::ostringstream msg;
msg << "ERROR: Empty row " << r << " in ["<<rStart<<","<<rEnd<<")" << std::endl;
@@ -152,7 +152,7 @@
msg << "ERROR: Row " << r << " in ["<<rStart<<","<<rEnd<<") is missing diagonal element" << std::endl;
throw std::runtime_error(msg.str().c_str());
}
- err = MatRestoreRow(_matrix,r, &ncols, &cols, PETSC_NULL);CHECK_PETSC_ERROR(err);
+ err = MatRestoreRow(_matrix,r, &ncols, &cols, NULL);CHECK_PETSC_ERROR(err);
}
#endif
Modified: short/3D/PyLith/branches/v1.8-stable/libsrc/pylith/topology/MeshRefiner.cc
===================================================================
--- short/3D/PyLith/branches/v1.8-stable/libsrc/pylith/topology/MeshRefiner.cc 2013-02-07 18:41:37 UTC (rev 21345)
+++ short/3D/PyLith/branches/v1.8-stable/libsrc/pylith/topology/MeshRefiner.cc 2013-02-07 21:56:39 UTC (rev 21346)
@@ -40,8 +40,8 @@
template<typename cellrefiner_type>
ALE::MeshRefiner<cellrefiner_type>::~MeshRefiner(void)
{ // destructor
- delete _orderOldMesh; _orderOldMesh = PETSC_NULL;
- delete _orderNewMesh; _orderNewMesh = PETSC_NULL;
+ delete _orderOldMesh; _orderOldMesh = NULL;
+ delete _orderNewMesh; _orderNewMesh = NULL;
} // destructor
// ----------------------------------------------------------------------
@@ -792,10 +792,10 @@
}
#endif
newMesh->setCalculatedOverlap(true);
- delete [] oldVerticesStartNormalP; oldVerticesStartNormalP = PETSC_NULL;
- delete [] oldVerticesStartFaultP; oldVerticesStartFaultP = PETSC_NULL;
- delete [] newVerticesStartNormalP; newVerticesStartNormalP = PETSC_NULL;
- delete [] newVerticesStartFaultP; newVerticesStartFaultP = PETSC_NULL;
+ delete [] oldVerticesStartNormalP; oldVerticesStartNormalP = NULL;
+ delete [] oldVerticesStartFaultP; oldVerticesStartFaultP = NULL;
+ delete [] newVerticesStartNormalP; newVerticesStartNormalP = NULL;
+ delete [] newVerticesStartFaultP; newVerticesStartFaultP = NULL;
refiner.overlapAddNewVertices(newMesh, *_orderNewMesh, mesh, *_orderOldMesh);
// We have to do flexible assembly since we add the new vertices separately
More information about the CIG-COMMITS
mailing list