Reference documentation for deal.II version 8.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
sparse_decomposition.h
1 // ---------------------------------------------------------------------
2 // @f$Id: sparse_decomposition.h 30036 2013-07-18 16:55:32Z maier @f$
3 //
4 // Copyright (C) 2002 - 2013 by the deal.II authors
5 //
6 // This file is part of the deal.II library.
7 //
8 // The deal.II library is free software; you can use it, redistribute
9 // it, and/or modify it under the terms of the GNU Lesser General
10 // Public License as published by the Free Software Foundation; either
11 // version 2.1 of the License, or (at your option) any later version.
12 // The full text of the license can be found in the file LICENSE at
13 // the top level of the deal.II distribution.
14 //
15 // ---------------------------------------------------------------------
16 
17 #ifndef __deal2__sparse_decomposition_h
18 #define __deal2__sparse_decomposition_h
19 
20 #include <deal.II/base/config.h>
21 #include <deal.II/lac/sparse_matrix.h>
22 
23 #include <cmath>
24 
26 
140 template <typename number>
141 class SparseLUDecomposition : protected SparseMatrix<number>,
142  public virtual Subscriptor
143 {
144 protected:
154 
164 
165 public:
170 
178  virtual ~SparseLUDecomposition () = 0;
179 
186  virtual void clear();
187 
193  {
194  public:
200  AdditionalData (const double strengthen_diagonal=0,
201  const unsigned int extra_off_diagonals=0,
202  const bool use_previous_sparsity=false,
204 
216 
237  unsigned int extra_off_diagonals;
238 
255 
275  };
276 
305  template <typename somenumber>
306  void initialize (const SparseMatrix<somenumber> &matrix,
307  const AdditionalData parameters);
308 
317  void reinit (const SparsityPattern &sparsity) DEAL_II_DEPRECATED;
318 
327  template <typename somenumber>
328  void decompose (const SparseMatrix<somenumber> &matrix,
329  const double strengthen_diagonal=0.) DEAL_II_DEPRECATED;
330 
339  virtual bool is_decomposed () const DEAL_II_DEPRECATED;
340 
346  bool empty () const;
347 
353  virtual std::size_t memory_consumption () const;
354 
361  DeclException1 (ExcInvalidStrengthening,
362  double,
363  << "The strengthening parameter " << arg1
364  << " is not greater or equal than zero!");
366 protected:
373  template<typename somenumber>
374  void copy_from (const SparseMatrix<somenumber> &matrix);
375 
386  virtual void strengthen_diagonal_impl ();
387 
401  virtual number get_strengthen_diagonal(const number rowsum, const size_type row) const;
402 
415 
422 
433  std::vector<const size_type *> prebuilt_lower_bound;
434 
435 private:
441  void prebuild_lower_bound ();
442 
461 };
462 
464 //---------------------------------------------------------------------------
465 
466 #ifndef DOXYGEN
467 
468 template <typename number>
469 inline number
471 get_strengthen_diagonal(const number /*rowsum*/,
472  const size_type /*row*/) const
473 {
474  return strengthen_diagonal;
475 }
476 
477 
478 
479 template <typename number>
480 inline bool
482 {
483  return decomposed;
484 }
485 
486 
487 
488 template <typename number>
489 inline bool
491 {
493 }
494 
495 
496 
497 //---------------------------------------------------------------------------
498 
499 
500 template <typename number>
502  const double strengthen_diag,
503  const unsigned int extra_off_diag,
504  const bool use_prev_sparsity,
505  const SparsityPattern *use_this_spars):
506  strengthen_diagonal(strengthen_diag),
507  extra_off_diagonals(extra_off_diag),
508  use_previous_sparsity(use_prev_sparsity),
509  use_this_sparsity(use_this_spars)
510 {}
511 
512 
513 #endif // DOXYGEN
514 
515 DEAL_II_NAMESPACE_CLOSE
516 
517 #endif // __deal2__sparse_decomposition_h
std::vector< const size_type * > prebuilt_lower_bound
SparsityPattern * own_sparsity
bool empty() const
virtual number get_strengthen_diagonal(const number rowsum, const size_type row) const
STL namespace.
virtual std::size_t memory_consumption() const
unsigned int global_dof_index
Definition: types.h:100
types::global_dof_index size_type
DeclException1(ExcInvalidStrengthening, double,<< "The strengthening parameter "<< arg1<< " is not greater or equal than zero!")
BlockCompressedSparsityPattern CompressedBlockSparsityPattern DEAL_II_DEPRECATED
void decompose(const SparseMatrix< somenumber > &matrix, const double strengthen_diagonal=0.) DEAL_II_DEPRECATED
AdditionalData(const double strengthen_diagonal=0, const unsigned int extra_off_diagonals=0, const bool use_previous_sparsity=false, const SparsityPattern *use_this_sparsity=0)
void copy_from(const SparseMatrix< somenumber > &matrix)
void reinit(const SparsityPattern &sparsity) DEAL_II_DEPRECATED
virtual bool is_decomposed() const DEAL_II_DEPRECATED
void initialize(const SparseMatrix< somenumber > &matrix, const AdditionalData parameters)