]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Undo r23269 since one can't compile the library any more since that change.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Sat, 29 Jan 2011 03:24:41 +0000 (03:24 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Sat, 29 Jan 2011 03:24:41 +0000 (03:24 +0000)
git-svn-id: https://svn.dealii.org/trunk@23273 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/lac/sparse_direct.h
deal.II/source/lac/sparse_direct.cc

index a2fcb6d0c56338efd0034050798860d578235ff1..22f5060d62be4e96aa997412247f93529540fbcd 100644 (file)
 #include <base/exceptions.h>
 #include <base/subscriptor.h>
 #include <base/thread_management.h>
-#include <dmumps_c.h>
 #include <lac/vector.h>
 #include <lac/sparse_matrix.h>
 #include <lac/block_sparse_matrix.h>
 
-DEAL_II_NAMESPACE_OPEN
+#ifdef DEAL_II_USE_MUMPS
+#  include <base/utilities.h>
+#  include <dmumps_c.h>
+#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<double> control;
 };
 
+
 /**
- * This class provides an interface to the parallel sparse direct solver
- * MUMPS (see <a href="http://mumps.enseeiht.fr">this link</a>).
- * 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 <a href="http://mumps.enseeiht.fr">MUMPS</a>. 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 <a
- * href="http://mumps.enseeiht.fr">MUMPS</a> was enabled during configure
- * and if the <a href="http://mumps.enseeiht.fr">MUMPS</a> 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 <a href="http://mumps.enseeiht.fr">MUMPS</a> exists on your
+ * system and was detected during configuration of
+ * <code>deal.II</code>.
  *
  * <h4>Instantiations</h4>
  *
@@ -1278,50 +1287,65 @@ class SparseDirectUMFPACK : public Subscriptor
  * SparseMatrix<float>, BlockSparseMatrix<double>, and
  * BlockSparseMatrix<float>.
  *
- * @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
- * <tt>matrix</tt> and right-hand side <tt>vector</tt> to the solver.
- */
-      template<class Matrix>
-      void initialize (const Matrix& matrix, const Vector<double>& vector);
-      
-/**
- * Here the actual work is done. The linear system is solved and the solution
- * vector is copied into the given vector <tt>vector</tt>.
- */      
-      void solve (Vector<double>& 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
+                        * <tt>initialize ()</tt> 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
+                        * <tt>matrix</tt> and right-hand side
+                        * <tt>vector</tt> to the solver.
+                        */
+  template <class Matrix>
+    void initialize (const Matrix& matrix, 
+                    const Vector<double>      & vector);
+  
+                        /**
+                         * A function in which the linear system is
+                        * solved and the solution vector is copied
+                        * into the given <tt>vector</tt>.
+                        */      
+  void solve (Vector<double>& vector);
 };
 
 DEAL_II_NAMESPACE_CLOSE
 
-#endif
+#endif // __deal2__sparse_direct_h
index cd193f62136884fef39969197db52c72c937569c..a1e9b2111a410799aa0ebdb65f135bdcea197d52 100644 (file)
@@ -15,7 +15,6 @@
 #include <lac/sparse_direct.h>
 #include <base/memory_consumption.h>
 #include <base/thread_management.h>
-#include <base/utilities.h>
 #include <lac/sparse_matrix.h>
 #include <lac/block_sparse_matrix.h>
 #include <lac/vector.h>
@@ -1989,7 +1988,7 @@ void SparseDirectMUMPS::solve (Vector<double>& vector)
                         // Copy solution into the given vector
   if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) 
     {
-      for (int i=0; i<n; ++i)
+      for (unsigned int i=0; i<n; ++i)
        vector(i) = rhs[i];
       
       delete[] a;

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.