From 353ced4a39cb60d8500563a15828a90bd074b7e2 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sat, 29 Jan 2011 03:24:41 +0000 Subject: [PATCH] Undo r23269 since one can't compile the library any more since that change. git-svn-id: https://svn.dealii.org/trunk@23273 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/include/deal.II/lac/sparse_direct.h | 132 ++++++++++++-------- deal.II/source/lac/sparse_direct.cc | 3 +- 2 files changed, 79 insertions(+), 56 deletions(-) diff --git a/deal.II/include/deal.II/lac/sparse_direct.h b/deal.II/include/deal.II/lac/sparse_direct.h index a2fcb6d0c5..22f5060d62 100644 --- a/deal.II/include/deal.II/lac/sparse_direct.h +++ b/deal.II/include/deal.II/lac/sparse_direct.h @@ -19,13 +19,16 @@ #include #include #include -#include #include #include #include -DEAL_II_NAMESPACE_OPEN +#ifdef DEAL_II_USE_MUMPS +# include +# include +#endif +DEAL_II_NAMESPACE_OPEN /** * This class provides an interface to the sparse direct solver MA27 @@ -355,14 +358,17 @@ class SparseDirectMA27 : public Subscriptor * Exception */ DeclException0 (ExcInitializeAlreadyCalled); + /** * Exception */ DeclException0 (ExcFactorizeNotCalled); + /** * Exception */ DeclException0 (ExcDifferentSparsityPatterns); + /** * Exception */ @@ -822,14 +828,17 @@ class SparseDirectMA47 : public Subscriptor * Exception */ DeclException0 (ExcInitializeAlreadyCalled); + /** * Exception */ DeclException0 (ExcFactorizeNotCalled); + /** * Exception */ DeclException0 (ExcCantFactorizeAgain); + /** * Exception */ @@ -1259,18 +1268,18 @@ class SparseDirectUMFPACK : public Subscriptor std::vector control; }; + /** - * This class provides an interface to the parallel sparse direct solver - * MUMPS (see this link). - * MUMPS is direct method based on a multifrontal approach, which - * performs a direct LU factorization. Matrices may have symmetric or - * unsymmetrix sparsity patterns, and may have unsymmetric entries. + * This class provides an interface to the parallel sparse direct + * solver MUMPS. MUMPS is + * direct method based on a multifrontal approach, which performs a + * direct LU factorization. The matrix coming in may have either + * symmetric or nonsymmetric sparsity pattern. * - * @note This class only exists if support for MUMPS was enabled during configure - * and if the MUMPS library was - * configured. If you do nothing at the time you configure deal.II, then - * this class will simply not work. + * @note This class is useable if and only if a working installation + * of MUMPS exists on your + * system and was detected during configuration of + * deal.II. * *

Instantiations

* @@ -1278,50 +1287,65 @@ class SparseDirectUMFPACK : public Subscriptor * SparseMatrix, BlockSparseMatrix, and * BlockSparseMatrix. * - * @author Markus Bürg, 2010 + * @author Markus Buerg, 2010 */ -class SparseDirectMUMPS { - private: - bool initialize_called; - DMUMPS_STRUC_C id; - double *a; - double *rhs; - int *irn; - int *jcn; - int n; - int nz; - - public: - -/** - * Constructor - */ - SparseDirectMUMPS (); - -/** - * Destructor - */ - ~SparseDirectMUMPS (); - -/** - * This function initializes a MUMPS instance and hands over the system's matrix - * matrix and right-hand side vector to the solver. - */ - template - void initialize (const Matrix& matrix, const Vector& vector); - -/** - * Here the actual work is done. The linear system is solved and the solution - * vector is copied into the given vector vector. - */ - void solve (Vector& vector); - - /** - * Exception - */ - DeclException0 (ExcInitializeAlreadyCalled); +class SparseDirectMUMPS +{ + private: + +#ifdef DEAL_II_USE_MUMPS + DMUMPS_STRUC_C id; +#endif // DEAL_II_USE_MUMPS + + double *a; + double *rhs; + unsigned int *irn; + unsigned int *jcn; + unsigned int n; + unsigned int nz; + + /** + * Flags storing whether the function + * initialize () has already been + * called. + */ + bool initialize_called; + + public: + + /** + * Constructor + */ + SparseDirectMUMPS (); + + /** + * Destructor + */ + ~SparseDirectMUMPS (); + + /** + * Exception + */ + DeclException0 (ExcInitializeAlreadyCalled); + + /** + * This function initializes a MUMPS instance + * and hands over the system's matrix + * matrix and right-hand side + * vector to the solver. + */ + template + void initialize (const Matrix& matrix, + const Vector & vector); + + /** + * A function in which the linear system is + * solved and the solution vector is copied + * into the given vector. + */ + void solve (Vector& vector); }; DEAL_II_NAMESPACE_CLOSE -#endif +#endif // __deal2__sparse_direct_h diff --git a/deal.II/source/lac/sparse_direct.cc b/deal.II/source/lac/sparse_direct.cc index cd193f6213..a1e9b2111a 100644 --- a/deal.II/source/lac/sparse_direct.cc +++ b/deal.II/source/lac/sparse_direct.cc @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include @@ -1989,7 +1988,7 @@ void SparseDirectMUMPS::solve (Vector& vector) // Copy solution into the given vector if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) { - for (int i=0; i