//---------------------------------------------------------------------------
// $Id$
//
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
#ifdef DEAL_II_USE_MUMPS
# include <deal.II/base/utilities.h>
# include <dmumps_c.h>
-#endif
+#endif
DEAL_II_NAMESPACE_OPEN
* <h3>Note on parallelization</h3>
*
* <h4>Synchronisation</h4>
- *
+ *
* Due to the use of global variables through COMMON blocks, the calls
* to the sparse direct solver routines are not multithreading-safe,
* i.e. at each time there may only be one call to these functions
* of this object multiply in parallel at the same time, which is what
* you probably wanted.
*
- *
+ *
* <h5>Internals of the detached mode</h5>
*
* The program that actually runs the detached solver is called
* some time. Presently, the check interval is once every 20
* seconds. After that time, the detached solver should have noticed
* the main programs demise.
- *
+ *
* @ingroup Solvers Preconditioners
- *
+ *
* @author Wolfgang Bangerth, 2000, 2001, 2002
*/
class SparseDirectMA27 : public Subscriptor
* Destructor.
*/
~SparseDirectMA27 ();
-
+
/**
* Set the detached mode (see the
* general class documentation
* mode is set.
*/
bool detached_mode_set () const;
-
+
/**
* Initialize some data
* structures. This function
void solve (Vector<number> &rhs_and_solution) const;
/**
- * Call the three functions
+ * Call the three functions
* initialize, factorize and solve
* in that order, i.e. perform
* the whole solution process for
* memory used by this class.
*/
std::size_t memory_consumption () const;
-
+
/**
* Get a reference to the
* synchronisation lock which can
* Exception
*/
DeclException0 (ExcMatrixNotSymmetric);
- //@}
+ //@}
private:
/**
* Declare a local type which
* file.
*/
struct DetachedModeData;
-
+
/**
* Store in the constructor
* whether the MA27 routines
* detached solver.
*/
DetachedModeData *detached_mode_data;
-
+
/**
* Store the three values passed
* to the cinstructor. See the
const double LIW_increase_factor_1;
const double LIW_increase_factor_2;
const double LA_increase_factor;
-
+
/**
* Flags storing whether the
* first two functions have
* all calls.
*/
SmartPointer<const SparsityPattern,SparseDirectMA27> sparsity_pattern;
-
+
/**
* Number of nonzero elements in
* the sparsity pattern on and
* above the diagonal.
*/
unsigned int n_nonzero_elements;
-
+
/**
* Arrays holding row and column
* indices.
* Length of the <tt>A</tt> array.
*/
unsigned int LA;
-
+
/**
* Scratch arrays and variables
* used by the MA27 functions. We
std::vector<unsigned int> IW;
std::vector<unsigned int> IKEEP;
std::vector<unsigned int> IW1;
-
+
unsigned int NSTEPS;
unsigned int MAXFRT;
*/
unsigned int NRLNEC;
unsigned int NIRNEC;
-
+
/**
* Flag indicating the level of
* output desired and returning
*/
static Threads::ThreadMutex static_synchronisation_lock;
mutable Threads::ThreadMutex non_static_synchronisation_lock;
-
+
/**
* Fill the <tt>A</tt> array from the
* symmetric part of the given
* matrix.
*/
- template <typename number>
+ template <typename number>
void fill_A (const SparseMatrix<number> &matrix);
/**
unsigned int *MAXFRT,
unsigned int *IW1,
int *IFLAG);
-
+
/**
* Call the respective function
* with the given args, either
* detected the presence of this solver. Please read the README file on what
* the configure script is looking for and how to provide it.
*
- *
+ *
* <h3>Interface and Method</h3>
*
* For the meaning of the three functions initialize(), factorize(),
* A detached mode as for MA27 has not yet been implemented for this
* class.
*
- *
+ *
* @ingroup Solvers Preconditioners
*
* @author Wolfgang Bangerth, 2000, 2001
* information.
*/
Threads::ThreadMutex & get_synchronisation_lock () const;
-
+
/** @addtogroup Exceptions
* @{ */
* Exception
*/
DeclException0 (ExcMatrixNotSymmetric);
- //@}
+ //@}
private:
/**
* Store in the constructor
* same thing for all calls.
*/
SmartPointer<const SparseMatrix<double>,SparseDirectMA47> matrix;
-
+
/**
* Number of nonzero elements in
* the sparsity pattern on and
* Length of the <tt>A</tt> array.
*/
unsigned int LA;
-
+
/**
* Scratch arrays and variables
* used by the MA47 functions. We
* to this class.
*/
static Threads::ThreadMutex synchronisation_lock;
-
+
/**
* Fill the <tt>A</tt> array from the
* symmetric part of the given
*/
class AdditionalData
{};
-
-
+
+
/**
* Constructor. See the
* documentation of this class
/**
* Destructor.
*/
- ~SparseDirectUMFPACK ();
-
+ ~SparseDirectUMFPACK ();
+
/**
* This function does nothing. It is only
* here to provide an interface that is
*
* In contrast to the other direct solver
* classes, the initialisation method
- * does nothing. Therefore initialise
+ * does nothing. Therefore initialise
* is not automatically called by this
* method, when
* the initialization step has
template <class Matrix>
void initialize(const Matrix &matrix,
const AdditionalData additional_data = AdditionalData());
-
+
/**
* Preconditioner interface
* function. Usually, given the source
* for compiling.
*/
void Tvmult (Vector<double>&, const Vector<double>&) const;
-
+
/**
* Same as vmult(), but adding to
* the previous solution. Not
void solve (Vector<double> &rhs_and_solution) const;
/**
- * Call the two functions
+ * Call the two functions
* factorize and solve
* in that order, i.e. perform
* the whole solution process for
*/
DeclException2 (ExcUMFPACKError, char*, int,
<< "UMFPACK routine " << arg1
- << " returned error status " << arg2);
-
+ << " returned error status " << arg2
+ << ". See the file <contrib/umfpack/UMFPACK/Include/umfpack.h>"
+ << " for a description of error codes.");
+
private:
/**
* The UMFPACK routines allocate objects
template <typename number>
void sort_arrays (const SparseMatrix<number> &);
-
+
template <typename number>
void sort_arrays (const BlockSparseMatrix<number> &);
*
* @author Markus Buerg, 2010
*/
-class SparseDirectMUMPS
+class SparseDirectMUMPS
{
private:
-
+
#ifdef DEAL_II_USE_MUMPS
DMUMPS_STRUC_C id;
#endif // DEAL_II_USE_MUMPS
* <tt>initialize ()</tt> has already been
* called.
*/
- bool initialize_called;
+ bool initialize_called;
public:
* Constructor
*/
SparseDirectMUMPS ();
-
+
/**
* Destructor
*/
* Exception
*/
DeclException0 (ExcInitializeAlreadyCalled);
-
+
/**
* This function initializes a MUMPS instance
* and hands over the system's matrix
* <tt>vector</tt> to the solver.
*/
template <class Matrix>
- void initialize (const Matrix& 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);
};