15#ifndef dealii_sparse_direct_h
16#define dealii_sparse_direct_h
30#ifdef DEAL_II_WITH_UMFPACK
34#ifdef DEAL_II_WITH_MUMPS
46#ifdef SuiteSparse_long
154 template <
class Matrix>
161 template <
class Matrix>
265 solve(
Vector<std::complex<double>> &rhs_and_solution,
288 template <
class Matrix>
290 solve(
const Matrix &matrix,
297 template <
class Matrix>
299 solve(
const Matrix &matrix,
300 Vector<std::complex<double>> &rhs_and_solution,
306 template <
class Matrix>
308 solve(
const Matrix &matrix,
315 template <
class Matrix>
317 solve(
const Matrix &matrix,
318 BlockVector<std::complex<double>> &rhs_and_solution,
334 <<
"UMFPACK routine " << arg1 <<
" returned error status " << arg2 <<
'.'
336 << (
"A complete list of error codes can be found in the file "
337 "<bundled/umfpack/UMFPACK/Include/umfpack.h>."
339 "That said, the two most common errors that can happen are "
340 "that your matrix cannot be factorized because it is "
341 "rank deficient, and that UMFPACK runs out of memory "
342 "because your problem is too large."
344 "The first of these cases most often happens if you "
345 "forget terms in your bilinear form necessary to ensure "
346 "that the matrix has full rank, or if your equation has a "
347 "spatially variable coefficient (or nonlinearity) that is "
348 "supposed to be strictly positive but, for whatever "
349 "reasons, is negative or zero. In either case, you probably "
350 "want to check your assembly procedure. Similarly, a "
351 "matrix can be rank deficient if you forgot to apply the "
352 "appropriate boundary conditions. For example, the "
353 "Laplace equation for a problem where only Neumann boundary "
354 "conditions are posed (or where you forget to apply Dirichlet "
355 "boundary conditions) has exactly one eigenvalue equal to zero "
356 "and its rank is therefore deficient by one. Finally, the matrix "
357 "may be rank deficient because you are using a quadrature "
358 "formula with too few quadrature points."
360 "The other common situation is that you run out of memory. "
361 "On a typical laptop or desktop, it should easily be possible "
362 "to solve problems with 100,000 unknowns in 2d. If you are "
363 "solving problems with many more unknowns than that, in "
364 "particular if you are in 3d, then you may be running out "
365 "of memory and you will need to consider iterative "
366 "solvers instead of the direct solver employed by "
401 template <
typename number>
405 template <
typename number>
409 template <
typename number>
424 std::vector<types::suitesparse_index>
Ap;
425 std::vector<types::suitesparse_index>
Ai;
426 std::vector<double>
Ax;
427 std::vector<double>
Az;
456#ifdef DEAL_II_WITH_MUMPS
471 template <
class Matrix>
519 template <
class Matrix>
527 template <
class Matrix>
void initialize(const Matrix &matrix, const Vector< double > &rhs_vector)
void solve(Vector< double > &vector)
void initialize_matrix(const Matrix &matrix)
void initialize(const Matrix &matrix)
std::vector< double > rhs
types::global_dof_index n
types::global_dof_index nz
void copy_solution(Vector< double > &vector)
void copy_rhs_to_mumps(const Vector< double > &rhs)
void vmult(Vector< double > &dst, const Vector< double > &src)
void * numeric_decomposition
~SparseDirectUMFPACK() override
void initialize(const SparsityPattern &sparsity_pattern)
void Tvmult(Vector< double > &dst, const Vector< double > &src) const
void * symbolic_decomposition
void solve(Vector< double > &rhs_and_solution, const bool transpose=false) const
void sort_arrays(const SparseMatrixEZ< number > &)
void factorize(const Matrix &matrix)
std::vector< double > control
void vmult(Vector< double > &dst, const Vector< double > &src) const
std::vector< types::suitesparse_index > Ap
std::vector< types::suitesparse_index > Ai
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define DeclException0(Exception0)
static ::ExceptionBase & ExcUMFPACKError(std::string arg1, int arg2)
#define DeclException2(Exception2, type1, type2, outsequence)
static ::ExceptionBase & ExcInitializeAlreadyCalled()
unsigned int global_dof_index
long int suitesparse_index