15#ifndef dealii_sparse_direct_h
16#define dealii_sparse_direct_h
30#ifdef DEAL_II_WITH_UMFPACK
34#ifdef DEAL_II_WITH_MUMPS
38#ifdef DEAL_II_WITH_TRILINOS
43#ifdef DEAL_II_WITH_PETSC
56#ifdef SuiteSparse_long
62#ifdef DEAL_II_WITH_MUMPS
174 template <
class Matrix>
181 template <
class Matrix>
285 solve(
Vector<std::complex<double>> &rhs_and_solution,
308 template <
class Matrix>
310 solve(
const Matrix &matrix,
317 template <
class Matrix>
319 solve(
const Matrix &matrix,
320 Vector<std::complex<double>> &rhs_and_solution,
326 template <
class Matrix>
328 solve(
const Matrix &matrix,
335 template <
class Matrix>
337 solve(
const Matrix &matrix,
338 BlockVector<std::complex<double>> &rhs_and_solution,
354 <<
"UMFPACK routine " << arg1 <<
" returned error status " << arg2 <<
'.'
356 << (
"A complete list of error codes can be found in the file "
357 "<bundled/umfpack/UMFPACK/Include/umfpack.h>."
359 "That said, the two most common errors that can happen are "
360 "that your matrix cannot be factorized because it is "
361 "rank deficient, and that UMFPACK runs out of memory "
362 "because your problem is too large."
364 "The first of these cases most often happens if you "
365 "forget terms in your bilinear form necessary to ensure "
366 "that the matrix has full rank, or if your equation has a "
367 "spatially variable coefficient (or nonlinearity) that is "
368 "supposed to be strictly positive but, for whatever "
369 "reasons, is negative or zero. In either case, you probably "
370 "want to check your assembly procedure. Similarly, a "
371 "matrix can be rank deficient if you forgot to apply the "
372 "appropriate boundary conditions. For example, the "
373 "Laplace equation for a problem where only Neumann boundary "
374 "conditions are posed (or where you forget to apply Dirichlet "
375 "boundary conditions) has exactly one eigenvalue equal to zero "
376 "and its rank is therefore deficient by one. Finally, the matrix "
377 "may be rank deficient because you are using a quadrature "
378 "formula with too few quadrature points."
380 "The other common situation is that you run out of memory. "
381 "On a typical laptop or desktop, it should easily be possible "
382 "to solve problems with 100,000 unknowns in 2d. If you are "
383 "solving problems with many more unknowns than that, in "
384 "particular if you are in 3d, then you may be running out "
385 "of memory and you will need to consider iterative "
386 "solvers instead of the direct solver employed by "
421 template <
typename number>
425 template <
typename number>
429 template <
typename number>
444 std::vector<types::suitesparse_index>
Ap;
445 std::vector<types::suitesparse_index>
Ai;
446 std::vector<double>
Ax;
447 std::vector<double>
Az;
519 const bool posdef =
false,
576 const MPI_Comm &communicator = MPI_COMM_WORLD);
593 template <
class Matrix>
601 template <
typename VectorType>
603 vmult(VectorType &dst,
const VectorType &src)
const;
610 template <
typename VectorType>
612 Tvmult(VectorType &,
const VectorType &src)
const;
632#ifdef DEAL_II_WITH_MUMPS
633 mutable DMUMPS_STRUC_C
id;
642 std::unique_ptr<double[]>
a;
647 mutable std::vector<double>
rhs;
657 std::unique_ptr<types::mumps_index[]>
irn;
662 std::unique_ptr<types::mumps_index[]>
jcn;
683 template <
class Matrix>
void copy_solution(Vector< double > &vector) const
void initialize_matrix(const Matrix &matrix)
void initialize(const Matrix &matrix)
std::vector< double > rhs
std::unique_ptr< double[]> a
void copy_rhs_to_mumps(const Vector< double > &rhs) const
types::global_dof_index n
const MPI_Comm mpi_communicator
SparseDirectMUMPS(const AdditionalData &additional_data=AdditionalData(), const MPI_Comm &communicator=MPI_COMM_WORLD)
std::unique_ptr< types::mumps_index[]> irn
std::unique_ptr< types::mumps_index[]> jcn
std::vector< types::mumps_index > irhs_loc
types::global_dof_index size_type
void vmult(VectorType &dst, const VectorType &src) const
IndexSet locally_owned_rows
AdditionalData additional_data
void Tvmult(VectorType &, const VectorType &src) const
void * numeric_decomposition
~SparseDirectUMFPACK() override
void initialize(const SparsityPattern &sparsity_pattern)
void Tvmult(Vector< double > &dst, const Vector< double > &src) const
void * symbolic_decomposition
types::global_dof_index size_type
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
BlockLowRank(const bool blr_ucfs=false, const double lowrank_threshold=1e-8)
AdditionalData(const bool output_details=false, const bool error_statistics=false, const bool symmetric=false, const bool posdef=false, const bool blr_factorization=false, const BlockLowRank &blr=BlockLowRank())