From: bangerth Date: Wed, 12 Dec 2012 12:21:11 +0000 (+0000) Subject: Patch by Alexander Grayver: Release memort in SparseDirectMUMPS. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e7e83d9fc9c09207b9223170181dbab78eb03148;p=dealii-svn.git Patch by Alexander Grayver: Release memort in SparseDirectMUMPS. git-svn-id: https://svn.dealii.org/trunk@27793 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/lac/petsc_solver.h b/deal.II/include/deal.II/lac/petsc_solver.h index 598bc31db5..ae38d634f0 100644 --- a/deal.II/include/deal.II/lac/petsc_solver.h +++ b/deal.II/include/deal.II/lac/petsc_solver.h @@ -1241,10 +1241,15 @@ namespace PETScWrappers * function in the base is not used * here, the private SolverData struct * located in the base could not be used - * either + * either. */ struct SolverDataMUMPS { + /** + * Destructor + */ + ~SolverDataMUMPS (); + KSP ksp; PC pc; }; diff --git a/deal.II/source/lac/petsc_solver.cc b/deal.II/source/lac/petsc_solver.cc index cdd889e836..caaa9ea4b9 100644 --- a/deal.II/source/lac/petsc_solver.cc +++ b/deal.II/source/lac/petsc_solver.cc @@ -594,6 +594,19 @@ namespace PETScWrappers /* ---------------------- SparseDirectMUMPS------------------------ */ + SparseDirectMUMPS::SolverDataMUMPS::~SolverDataMUMPS () + { + // destroy the solver object +#if DEAL_II_PETSC_VERSION_LT(3,2,0) + int ierr = KSPDestroy (ksp); +#else + int ierr = KSPDestroy (&ksp); +#endif + + AssertThrow (ierr == 0, ExcPETScError(ierr)); + } + + SparseDirectMUMPS::SparseDirectMUMPS (SolverControl &cn, const MPI_Comm &mpi_communicator, const AdditionalData &data)