From: young Date: Tue, 6 Sep 2011 08:23:07 +0000 (+0000) Subject: Upgrade PETSc vectors to petsc-dev X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4de650b248eb00b27c9e0c95f7e79de5d36bba2e;p=dealii-svn.git Upgrade PETSc vectors to petsc-dev git-svn-id: https://svn.dealii.org/trunk@24257 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/lac/petsc_vector.h b/deal.II/include/deal.II/lac/petsc_vector.h index f04ae3a316..98ca66313d 100644 --- a/deal.II/include/deal.II/lac/petsc_vector.h +++ b/deal.II/include/deal.II/lac/petsc_vector.h @@ -283,7 +283,11 @@ namespace PETScWrappers // 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 ierr = VecDestroy (vector); +#endif AssertThrow (ierr == 0, ExcPETScError(ierr)); } @@ -331,7 +335,11 @@ namespace PETScWrappers #endif AssertThrow (ierr == 0, ExcPETScError(ierr)); +#if DEAL_II_PETSC_VERSION_DEV() + ierr = VecScatterDestroy (&ctx); +#else ierr = VecScatterDestroy (ctx); +#endif AssertThrow (ierr == 0, ExcPETScError(ierr)); #endif diff --git a/deal.II/source/lac/petsc_parallel_vector.cc b/deal.II/source/lac/petsc_parallel_vector.cc index 7a8968acf3..04a6cb75b9 100644 --- a/deal.II/source/lac/petsc_parallel_vector.cc +++ b/deal.II/source/lac/petsc_parallel_vector.cc @@ -113,7 +113,12 @@ namespace PETScWrappers // so let's go the slow way: int ierr; +#if DEAL_II_PETSC_VERSION_DEV() + ierr = VecDestroy (&vector); +#else ierr = VecDestroy (vector); +#endif + AssertThrow (ierr == 0, ExcPETScError(ierr)); create_vector (n, local_sz); diff --git a/deal.II/source/lac/petsc_vector.cc b/deal.II/source/lac/petsc_vector.cc index 8ad073ad80..4ea59af9d4 100644 --- a/deal.II/source/lac/petsc_vector.cc +++ b/deal.II/source/lac/petsc_vector.cc @@ -78,7 +78,11 @@ namespace PETScWrappers // so let's go the slow way: if (attained_ownership) { +#if DEAL_II_PETSC_VERSION_DEV() + int ierr = VecDestroy (&vector); +#else int ierr = VecDestroy (vector); +#endif AssertThrow (ierr == 0, ExcPETScError(ierr)); } diff --git a/deal.II/source/lac/petsc_vector_base.cc b/deal.II/source/lac/petsc_vector_base.cc index a2ba844673..130bb33b2f 100644 --- a/deal.II/source/lac/petsc_vector_base.cc +++ b/deal.II/source/lac/petsc_vector_base.cc @@ -215,7 +215,11 @@ namespace PETScWrappers { if (attained_ownership) { +#if DEAL_II_PETSC_VERSION_DEV() + const int ierr = VecDestroy (&vector); +#else const int ierr = VecDestroy (vector); +#endif AssertThrow (ierr == 0, ExcPETScError(ierr)); } } @@ -253,7 +257,12 @@ namespace PETScWrappers Assert (size() == v.size(), ExcDimensionMismatch(size(), v.size())); - PetscTruth flag; +#if DEAL_II_PETSC_VERSION_DEV() + PetscBool +#else + PetscTruth +#endif + flag; const int ierr = VecEqual (vector, v.vector, &flag); AssertThrow (ierr == 0, ExcPETScError(ierr)); @@ -269,7 +278,12 @@ namespace PETScWrappers Assert (size() == v.size(), ExcDimensionMismatch(size(), v.size())); - PetscTruth flag; +#if DEAL_II_PETSC_VERSION_DEV() + PetscBool +#else + PetscTruth +#endif + flag; const int ierr = VecEqual (vector, v.vector, &flag); AssertThrow (ierr == 0, ExcPETScError(ierr));