* $1000\times32$-bit machine
* precision.
*/
-#if DEAL_II_PETSC_VERSION_DEV()
- PetscBool
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
+ PetscTruth
#else
- PetscTruth
+ PetscBool
#endif
is_symmetric (const double tolerance = 1.e-12);
* $1000\times32$-bit machine
* precision.
*/
-#if DEAL_II_PETSC_VERSION_DEV()
- PetscBool
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
+ PetscTruth
#else
- PetscTruth
+ PetscBool
#endif
is_hermitian (const double tolerance = 1.e-12);
#endif
-
+
/*
* Abstract PETSc object that helps view
* in ASCII other PETSc objects. Currently
// the petsc function we call wants to
// generate the vector itself, so destroy
// the old one first
-#if DEAL_II_PETSC_VERSION_DEV()
- ierr = VecDestroy (&vector);
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
ierr = VecDestroy (vector);
+#else
+ ierr = VecDestroy (&vector);
#endif
AssertThrow (ierr == 0, ExcPETScError(ierr));
}
#endif
AssertThrow (ierr == 0, ExcPETScError(ierr));
-#if DEAL_II_PETSC_VERSION_DEV()
- ierr = VecScatterDestroy (&ctx);
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
ierr = VecScatterDestroy (ctx);
+#else
+ ierr = VecScatterDestroy (&ctx);
#endif
AssertThrow (ierr == 0, ExcPETScError(ierr));
#endif
MatrixBase::~MatrixBase ()
{
-#if DEAL_II_PETSC_VERSION_DEV()
- const int ierr = MatDestroy (&matrix);
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
const int ierr = MatDestroy (matrix);
+#else
+ const int ierr = MatDestroy (&matrix);
#endif
AssertThrow (ierr == 0, ExcPETScError(ierr));
}
MatrixBase::clear ()
{
// destroy the matrix...
-#if DEAL_II_PETSC_VERSION_DEV()
- int ierr = MatDestroy (&matrix);
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
int ierr = MatDestroy (matrix);
+#else
+ int ierr = MatDestroy (&matrix);
#endif
AssertThrow (ierr == 0, ExcPETScError(ierr));
// ...and replace it by an empty
#endif
IS index_set;
-#if DEAL_II_PETSC_VERSION_DEV()
- ISCreateGeneral (get_mpi_communicator(), 1, &petsc_row, PETSC_COPY_VALUES, &index_set);
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
ISCreateGeneral (get_mpi_communicator(), 1, &petsc_row, &index_set);
+#else
+ ISCreateGeneral (get_mpi_communicator(), 1, &petsc_row, PETSC_COPY_VALUES, &index_set);
#endif
const int ierr
= MatZeroRows(matrix, index_set, &new_diag_value);
#else
-#if DEAL_II_PETSC_VERSION_DEV()
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
const int ierr
- = MatZeroRowsIS(matrix, index_set, new_diag_value, PETSC_NULL, PETSC_NULL);
+ = MatZeroRowsIS(matrix, index_set, new_diag_value);
#else
const int ierr
- = MatZeroRowsIS(matrix, index_set, new_diag_value);
+ = MatZeroRowsIS(matrix, index_set, new_diag_value, PETSC_NULL, PETSC_NULL);
#endif
#endif
AssertThrow (ierr == 0, ExcPETScError(ierr));
-#if DEAL_II_PETSC_VERSION_DEV()
- ISDestroy (&index_set);
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
ISDestroy (index_set);
+#else
+ ISDestroy (&index_set);
#endif
compress ();
// to call them even if #rows is empty,
// since this is a collective operation
IS index_set;
-#if DEAL_II_PETSC_VERSION_DEV()
+
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
ISCreateGeneral (get_mpi_communicator(), rows.size(),
- &petsc_rows[0], PETSC_COPY_VALUES, &index_set);
+ &petsc_rows[0], &index_set);
#else
ISCreateGeneral (get_mpi_communicator(), rows.size(),
- &petsc_rows[0], &index_set);
+ &petsc_rows[0], PETSC_COPY_VALUES, &index_set);
#endif
#if DEAL_II_PETSC_VERSION_LT(2,3,0)
const int ierr
= MatZeroRows(matrix, index_set, &new_diag_value);
#else
-#if DEAL_II_PETSC_VERSION_DEV()
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
const int ierr
- = MatZeroRowsIS(matrix, index_set, new_diag_value, PETSC_NULL, PETSC_NULL);
+ = MatZeroRowsIS(matrix, index_set, new_diag_value);
#else
const int ierr
- = MatZeroRowsIS(matrix, index_set, new_diag_value);
+ = MatZeroRowsIS(matrix, index_set, new_diag_value, PETSC_NULL, PETSC_NULL);
#endif
#endif
AssertThrow (ierr == 0, ExcPETScError(ierr));
-#if DEAL_II_PETSC_VERSION_DEV()
- ISDestroy (&index_set);
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
ISDestroy (index_set);
+#else
+ ISDestroy (&index_set);
#endif
compress ();
AssertThrow (ierr == 0, ExcPETScError(ierr));
}
-#if DEAL_II_PETSC_VERSION_DEV()
- PetscBool
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
PetscTruth
+#else
+ PetscBool
#endif
MatrixBase::is_symmetric (const double tolerance)
{
-#if DEAL_II_PETSC_VERSION_DEV()
- PetscBool
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
PetscTruth
+#else
+ PetscBool
#endif
truth;
// First flush PETSc caches
return truth;
}
-#if DEAL_II_PETSC_VERSION_DEV()
- PetscBool
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
PetscTruth
+#else
+ PetscBool
#endif
MatrixBase::is_hermitian (const double tolerance)
{
-#if DEAL_II_PETSC_VERSION_DEV()
- PetscBool
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
PetscTruth
+#else
+ PetscBool
#endif
truth;
// get rid of old matrix and generate a
// new one
-#if DEAL_II_PETSC_VERSION_DEV()
- const int ierr = MatDestroy (&matrix);
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
const int ierr = MatDestroy (matrix);
+#else
+ const int ierr = MatDestroy (&matrix);
#endif
AssertThrow (ierr == 0, ExcPETScError(ierr));
// get rid of old matrix and generate a
// new one
-#if DEAL_II_PETSC_VERSION_DEV()
- const int ierr = MatDestroy (&matrix);
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
const int ierr = MatDestroy (matrix);
+#else
+ const int ierr = MatDestroy (&matrix);
#endif
AssertThrow (ierr == 0, ExcPETScError(ierr));
// get rid of old matrix and generate a
// new one
-#if DEAL_II_PETSC_VERSION_DEV()
- const int ierr = MatDestroy (&matrix);
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
const int ierr = MatDestroy (matrix);
+#else
+ const int ierr = MatDestroy (&matrix);
#endif
AssertThrow (ierr == 0, ExcPETScError(ierr));
// so let's go the slow way:
int ierr;
-#if DEAL_II_PETSC_VERSION_DEV()
- ierr = VecDestroy (&vector);
-#else
+
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
ierr = VecDestroy (vector);
+#else
+ ierr = VecDestroy (&vector);
#endif
AssertThrow (ierr == 0, ExcPETScError(ierr));
{
if (pc!=NULL)
{
-#if DEAL_II_PETSC_VERSION_DEV()
- int ierr = PCDestroy(&pc);
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
int ierr = PCDestroy(pc);
+#else
+ int ierr = PCDestroy(&pc);
#endif
AssertThrow (ierr == 0, ExcPETScError(ierr));
}
SolverBase::SolverData::~SolverData ()
{
// destroy the solver object
-#if DEAL_II_PETSC_VERSION_DEV()
- int ierr = KSPDestroy (&ksp);
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
int ierr = KSPDestroy (ksp);
+#else
+ int ierr = KSPDestroy (&ksp);
#endif
AssertThrow (ierr == 0, ExcPETScError(ierr));
// right
if (additional_data.right_preconditioning)
{
-#if DEAL_II_PETSC_VERSION_DEV()
- ierr = KSPSetPCSide(ksp, PC_RIGHT);
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
ierr = KSPSetPreconditionerSide(ksp, PC_RIGHT);
+#else
+ ierr = KSPSetPCSide(ksp, PC_RIGHT);
#endif
AssertThrow (ierr == 0, ExcPETScError(ierr));
{
// get rid of old matrix and generate a
// new one
-#if DEAL_II_PETSC_VERSION_DEV()
- const int ierr = MatDestroy (&matrix);
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
const int ierr = MatDestroy (matrix);
+#else
+ const int ierr = MatDestroy (&matrix);
#endif
AssertThrow (ierr == 0, ExcPETScError(ierr));
{
// get rid of old matrix and generate a
// new one
-#if DEAL_II_PETSC_VERSION_DEV()
- const int ierr = MatDestroy (&matrix);
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
const int ierr = MatDestroy (matrix);
+#else
+ const int ierr = MatDestroy (&matrix);
#endif
AssertThrow (ierr == 0, ExcPETScError(ierr));
{
// get rid of old matrix and generate a
// new one
-#if DEAL_II_PETSC_VERSION_DEV()
- const int ierr = MatDestroy (&matrix);
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
const int ierr = MatDestroy (matrix);
+#else
+ const int ierr = MatDestroy (&matrix);
#endif
AssertThrow (ierr == 0, ExcPETScError(ierr));
// so let's go the slow way:
if (attained_ownership)
{
-#if DEAL_II_PETSC_VERSION_DEV()
- int ierr = VecDestroy (&vector);
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
int ierr = VecDestroy (vector);
+#else
+ int ierr = VecDestroy (&vector);
#endif
AssertThrow (ierr == 0, ExcPETScError(ierr));
}
{
if (attained_ownership)
{
-#if DEAL_II_PETSC_VERSION_DEV()
- const int ierr = VecDestroy (&vector);
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
const int ierr = VecDestroy (vector);
+#else
+ const int ierr = VecDestroy (&vector);
#endif
AssertThrow (ierr == 0, ExcPETScError(ierr));
}
Assert (size() == v.size(),
ExcDimensionMismatch(size(), v.size()));
-#if DEAL_II_PETSC_VERSION_DEV()
- PetscBool
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
PetscTruth
+#else
+ PetscBool
#endif
flag;
Assert (size() == v.size(),
ExcDimensionMismatch(size(), v.size()));
-#if DEAL_II_PETSC_VERSION_DEV()
- PetscBool
-#else
+#if DEAL_II_PETSC_VERSION_LT(3,2,0)
PetscTruth
+#else
+ PetscBool
#endif
flag;