16 #ifndef dealii_precondition_h 17 #define dealii_precondition_h 21 #include <deal.II/base/config.h> 23 #include <deal.II/base/parallel.h> 24 #include <deal.II/base/smartpointer.h> 25 #include <deal.II/base/template_constraints.h> 26 #include <deal.II/base/thread_management.h> 27 #include <deal.II/base/utilities.h> 29 #include <deal.II/lac/diagonal_matrix.h> 30 #include <deal.II/lac/solver_cg.h> 31 #include <deal.II/lac/vector_memory.h> 33 DEAL_II_NAMESPACE_OPEN
37 template <
typename number>
39 template <
typename number>
45 template <
typename number>
106 template <
typename MatrixType>
108 initialize(
const MatrixType & matrix,
114 template <
class VectorType>
116 vmult(VectorType &,
const VectorType &)
const;
122 template <
class VectorType>
124 Tvmult(VectorType &,
const VectorType &)
const;
129 template <
class VectorType>
131 vmult_add(VectorType &,
const VectorType &)
const;
137 template <
class VectorType>
139 Tvmult_add(VectorType &,
const VectorType &)
const;
239 template <
typename MatrixType>
241 initialize(
const MatrixType &matrix,
const AdditionalData ¶meters);
246 template <
class VectorType>
248 vmult(VectorType &,
const VectorType &)
const;
254 template <
class VectorType>
256 Tvmult(VectorType &,
const VectorType &)
const;
260 template <
class VectorType>
262 vmult_add(VectorType &,
const VectorType &)
const;
268 template <
class VectorType>
270 Tvmult_add(VectorType &,
const VectorType &)
const;
360 template <
typename MatrixType = SparseMatrix<
double>,
361 class VectorType = Vector<
double>>
369 const VectorType &)
const;
383 vmult(VectorType &dst,
const VectorType &src)
const;
407 template <
typename MatrixType = SparseMatrix<
double>>
439 initialize(
const MatrixType & A,
504 template <
typename MatrixType = SparseMatrix<
double>>
517 template <
class VectorType>
519 vmult(VectorType &,
const VectorType &)
const;
525 template <
class VectorType>
527 Tvmult(VectorType &,
const VectorType &)
const;
532 template <
class VectorType>
534 step(VectorType &x,
const VectorType &rhs)
const;
539 template <
class VectorType>
541 Tstep(VectorType &x,
const VectorType &rhs)
const;
592 template <
typename MatrixType = SparseMatrix<
double>>
605 template <
class VectorType>
607 vmult(VectorType &,
const VectorType &)
const;
612 template <
class VectorType>
614 Tvmult(VectorType &,
const VectorType &)
const;
619 template <
class VectorType>
621 step(VectorType &x,
const VectorType &rhs)
const;
626 template <
class VectorType>
628 Tstep(VectorType &x,
const VectorType &rhs)
const;
661 template <
typename MatrixType = SparseMatrix<
double>>
688 initialize(
const MatrixType & A,
695 template <
class VectorType>
697 vmult(VectorType &,
const VectorType &)
const;
703 template <
class VectorType>
705 Tvmult(VectorType &,
const VectorType &)
const;
711 template <
class VectorType>
713 step(VectorType &x,
const VectorType &rhs)
const;
718 template <
class VectorType>
720 Tstep(VectorType &x,
const VectorType &rhs)
const;
763 template <
typename MatrixType = SparseMatrix<
double>>
789 const std::vector<size_type> &permutation,
790 const std::vector<size_type> &inverse_permutation,
821 initialize(
const MatrixType & A,
822 const std::vector<size_type> &permutation,
823 const std::vector<size_type> &inverse_permutation,
839 initialize(
const MatrixType &A,
const AdditionalData &additional_data);
844 template <
class VectorType>
846 vmult(VectorType &,
const VectorType &)
const;
851 template <
class VectorType>
853 Tvmult(VectorType &,
const VectorType &)
const;
956 template <
typename MatrixType = SparseMatrix<
double>,
957 typename VectorType = Vector<
double>,
958 typename PreconditionerType = DiagonalMatrix<VectorType>>
979 const double smoothing_range = 0.,
980 const bool nonzero_starting =
false,
981 const unsigned int eig_cg_n_iterations = 8,
982 const double eig_cg_residual = 1e-2,
983 const double max_eigenvalue = 1);
1023 bool nonzero_starting DEAL_II_DEPRECATED;
1050 VectorType matrix_diagonal_inverse DEAL_II_DEPRECATED;
1073 initialize(
const MatrixType & matrix,
1081 vmult(VectorType &dst,
const VectorType &src)
const;
1088 Tvmult(VectorType &dst,
const VectorType &src)
const;
1094 step(VectorType &dst,
const VectorType &src)
const;
1100 Tstep(VectorType &dst,
const VectorType &src)
const;
1180 do_chebyshev_loop(VectorType &dst,
const VectorType &src)
const;
1189 do_transpose_chebyshev_loop(VectorType &dst,
const VectorType &src)
const;
1198 estimate_eigenvalues(
const VectorType &src)
const;
1213 template <
typename MatrixType>
1218 n_rows = matrix.m();
1219 n_columns = matrix.n();
1223 template <
class VectorType>
1232 template <
class VectorType>
1239 template <
class VectorType>
1248 template <
class VectorType>
1272 const double relaxation)
1273 : relaxation(relaxation)
1283 relaxation = add_data.relaxation;
1297 template <
typename MatrixType>
1300 const MatrixType & matrix,
1304 n_rows = matrix.m();
1305 n_columns = matrix.n();
1310 template <
class VectorType>
1315 std::is_same<size_type, typename VectorType::size_type>::value,
1316 "PreconditionRichardson and VectorType must have the same size_type.");
1318 dst.equ(relaxation, src);
1323 template <
class VectorType>
1328 std::is_same<size_type, typename VectorType::size_type>::value,
1329 "PreconditionRichardson and VectorType must have the same size_type.");
1331 dst.equ(relaxation, src);
1334 template <
class VectorType>
1339 std::is_same<size_type, typename VectorType::size_type>::value,
1340 "PreconditionRichardson and VectorType must have the same size_type.");
1342 dst.add(relaxation, src);
1347 template <
class VectorType>
1352 std::is_same<size_type, typename VectorType::size_type>::value,
1353 "PreconditionRichardson and VectorType must have the same size_type.");
1355 dst.add(relaxation, src);
1374 template <
typename MatrixType>
1380 relaxation = parameters.relaxation;
1384 template <
typename MatrixType>
1391 template <
typename MatrixType>
1399 template <
typename MatrixType>
1409 template <
typename MatrixType>
1410 template <
class VectorType>
1413 const VectorType &src)
const 1417 typename VectorType::size_type>::value,
1418 "PreconditionJacobi and VectorType must have the same size_type.");
1421 this->A->precondition_Jacobi(dst, src, this->relaxation);
1426 template <
typename MatrixType>
1427 template <
class VectorType>
1430 const VectorType &src)
const 1434 typename VectorType::size_type>::value,
1435 "PreconditionJacobi and VectorType must have the same size_type.");
1438 this->A->precondition_Jacobi(dst, src, this->relaxation);
1443 template <
typename MatrixType>
1444 template <
class VectorType>
1447 const VectorType &src)
const 1451 typename VectorType::size_type>::value,
1452 "PreconditionJacobi and VectorType must have the same size_type.");
1455 this->A->Jacobi_step(dst, src, this->relaxation);
1460 template <
typename MatrixType>
1461 template <
class VectorType>
1464 const VectorType &src)
const 1468 typename VectorType::size_type>::value,
1469 "PreconditionJacobi and VectorType must have the same size_type.");
1478 template <
typename MatrixType>
1479 template <
class VectorType>
1484 typename VectorType::size_type>::value,
1485 "PreconditionSOR and VectorType must have the same size_type.");
1488 this->A->precondition_SOR(dst, src, this->relaxation);
1493 template <
typename MatrixType>
1494 template <
class VectorType>
1497 const VectorType &src)
const 1500 typename VectorType::size_type>::value,
1501 "PreconditionSOR and VectorType must have the same size_type.");
1504 this->A->precondition_TSOR(dst, src, this->relaxation);
1509 template <
typename MatrixType>
1510 template <
class VectorType>
1515 typename VectorType::size_type>::value,
1516 "PreconditionSOR and VectorType must have the same size_type.");
1519 this->A->SOR_step(dst, src, this->relaxation);
1524 template <
typename MatrixType>
1525 template <
class VectorType>
1530 typename VectorType::size_type>::value,
1531 "PreconditionSOR and VectorType must have the same size_type.");
1534 this->A->TSOR_step(dst, src, this->relaxation);
1541 template <
typename MatrixType>
1544 const MatrixType & rA,
1545 const typename BaseClass::AdditionalData ¶meters)
1559 pos_right_of_diagonal.resize(n, static_cast<std::size_t>(-1));
1567 it = mat->
begin(row) + 1;
1568 for (; it < mat->
end(row); ++it)
1569 if (it->column() > row)
1571 pos_right_of_diagonal[row] = it - mat->
begin();
1577 template <
typename MatrixType>
1578 template <
class VectorType>
1581 const VectorType &src)
const 1585 typename VectorType::size_type>::value,
1586 "PreconditionSSOR and VectorType must have the same size_type.");
1589 this->A->precondition_SSOR(dst, src, this->relaxation, pos_right_of_diagonal);
1594 template <
typename MatrixType>
1595 template <
class VectorType>
1598 const VectorType &src)
const 1602 typename VectorType::size_type>::value,
1603 "PreconditionSSOR and VectorType must have the same size_type.");
1606 this->A->precondition_SSOR(dst, src, this->relaxation, pos_right_of_diagonal);
1611 template <
typename MatrixType>
1612 template <
class VectorType>
1618 typename VectorType::size_type>::value,
1619 "PreconditionSSOR and VectorType must have the same size_type.");
1622 this->A->SSOR_step(dst, src, this->relaxation);
1627 template <
typename MatrixType>
1628 template <
class VectorType>
1631 const VectorType &src)
const 1635 typename VectorType::size_type>::value,
1636 "PreconditionSSOR and VectorType must have the same size_type.");
1645 template <
typename MatrixType>
1648 const MatrixType & rA,
1649 const std::vector<size_type> & p,
1650 const std::vector<size_type> & ip,
1654 inverse_permutation = &ip;
1659 template <
typename MatrixType>
1665 additional_data.permutation,
1666 additional_data.inverse_permutation,
1667 additional_data.parameters);
1671 template <
typename MatrixType>
1672 template <
typename VectorType>
1675 const VectorType &src)
const 1679 typename VectorType::size_type>::value,
1680 "PreconditionPSOR and VectorType must have the same size_type.");
1684 this->A->PSOR(dst, *permutation, *inverse_permutation, this->relaxation);
1689 template <
typename MatrixType>
1690 template <
class VectorType>
1693 const VectorType &src)
const 1697 typename VectorType::size_type>::value,
1698 "PreconditionPSOR and VectorType must have the same size_type.");
1702 this->A->TPSOR(dst, *permutation, *inverse_permutation, this->relaxation);
1705 template <
typename MatrixType>
1707 const std::vector<size_type> &permutation,
1708 const std::vector<size_type> &inverse_permutation,
1710 : permutation(permutation)
1711 , inverse_permutation(inverse_permutation)
1712 , parameters(parameters)
1719 template <
typename MatrixType,
class VectorType>
1721 const MatrixType & M,
1722 const function_ptr method)
1724 , precondition(method)
1729 template <
typename MatrixType,
class VectorType>
1733 const VectorType &src)
const 1735 (matrix.*precondition)(dst, src);
1740 template <
typename MatrixType>
1742 const double relaxation)
1743 : relaxation(relaxation)
1752 namespace PreconditionChebyshevImplementation
1760 template <
typename VectorType,
typename PreconditionerType>
1762 vector_updates(
const VectorType & src,
1763 const PreconditionerType &preconditioner,
1764 const bool start_zero,
1765 const double factor1,
1766 const double factor2,
1774 update1.equ(factor2, src);
1775 preconditioner.vmult(dst, update1);
1776 update1.equ(-1., dst);
1781 preconditioner.vmult(update3, update2);
1784 update1.equ(factor2, update2);
1786 update1.sadd(factor1, factor2, update2);
1794 template <
typename Number>
1795 struct VectorUpdater
1797 VectorUpdater(
const Number *src,
1798 const Number *matrix_diagonal_inverse,
1799 const bool start_zero,
1800 const Number factor1,
1801 const Number factor2,
1806 , matrix_diagonal_inverse(matrix_diagonal_inverse)
1807 , do_startup(factor1 == Number())
1808 , start_zero(start_zero)
1817 apply_to_subrange(
const std::size_t begin,
const std::size_t end)
const 1823 const Number factor1 = this->factor1;
1824 const Number factor2 = this->factor2;
1828 DEAL_II_OPENMP_SIMD_PRAGMA
1829 for (std::size_t i = begin; i < end; ++i)
1831 dst[i] = factor2 * src[i] * matrix_diagonal_inverse[i];
1832 update1[i] = -dst[i];
1834 else DEAL_II_OPENMP_SIMD_PRAGMA
for (std::size_t i = begin; i < end;
1838 ((update2[i] - src[i]) * factor2 * matrix_diagonal_inverse[i]);
1839 dst[i] -= update1[i];
1843 DEAL_II_OPENMP_SIMD_PRAGMA
1844 for (std::size_t i = begin; i < end; ++i)
1846 const Number update =
1847 factor1 * update1[i] +
1848 factor2 * ((update2[i] - src[i]) * matrix_diagonal_inverse[i]);
1849 update1[i] = update;
1855 const Number * matrix_diagonal_inverse;
1856 const bool do_startup;
1857 const bool start_zero;
1858 const Number factor1;
1859 const Number factor2;
1862 mutable Number *dst;
1865 template <
typename Number>
1868 VectorUpdatesRange(
const VectorUpdater<Number> &updater,
1869 const std::size_t size)
1872 if (size < internal::VectorImplementation::minimum_parallel_grain_size)
1873 apply_to_subrange(0, size);
1878 internal::VectorImplementation::minimum_parallel_grain_size);
1881 ~VectorUpdatesRange()
override =
default;
1884 apply_to_subrange(
const std::size_t begin,
1885 const std::size_t end)
const override 1887 updater.apply_to_subrange(begin, end);
1890 const VectorUpdater<Number> &updater;
1894 template <
typename Number>
1896 vector_updates(const ::Vector<Number> & src,
1898 const bool start_zero,
1899 const double factor1,
1900 const double factor2,
1901 ::Vector<Number> & update1,
1902 ::Vector<Number> & update2,
1904 ::Vector<Number> &dst)
1906 VectorUpdater<Number> upd(src.begin(),
1907 jacobi.get_vector().begin(),
1914 VectorUpdatesRange<Number>(upd, src.size());
1918 template <
typename Number>
1923 const bool start_zero,
1924 const double factor1,
1925 const double factor2,
1931 VectorUpdater<Number> upd(src.
begin(),
1932 jacobi.get_vector().begin(),
1939 VectorUpdatesRange<Number>(upd, src.
local_size());
1942 template <
typename MatrixType,
1943 typename VectorType,
1944 typename PreconditionerType>
1946 initialize_preconditioner(
1947 const MatrixType & matrix,
1948 std::shared_ptr<PreconditionerType> &preconditioner,
1952 (void)preconditioner;
1956 template <
typename MatrixType,
typename VectorType>
1958 initialize_preconditioner(
1959 const MatrixType & matrix,
1961 VectorType & diagonal_inverse)
1963 if (preconditioner.get() ==
nullptr || preconditioner->m() != matrix.m())
1965 if (preconditioner.get() ==
nullptr)
1969 preconditioner->m() == 0,
1971 "Preconditioner appears to be initialized but not sized correctly"));
1975 preconditioner->reinit(diagonal_inverse);
1977 VectorType empty_vector;
1978 diagonal_inverse.reinit(empty_vector);
1982 if (preconditioner->m() != matrix.m())
1984 preconditioner->get_vector().reinit(matrix.m());
1985 for (
typename VectorType::size_type i = 0; i < matrix.m(); ++i)
1986 preconditioner->get_vector()(i) = 1. / matrix.el(i, i);
1991 template <
typename VectorType>
1993 set_initial_guess(VectorType &vector)
1995 vector = 1. / std::sqrt(static_cast<double>(vector.size()));
1996 if (vector.locally_owned_elements().is_element(0))
2000 template <
typename Number>
2002 set_initial_guess(::Vector<Number> &vector)
2008 for (
unsigned int i = 0; i < vector.size(); ++i)
2011 const Number mean_value = vector.mean_value();
2012 vector.add(-mean_value);
2015 template <
typename Number>
2029 for (
unsigned int i = 0; i < vector.
local_size(); ++i)
2032 const Number mean_value = vector.
mean_value();
2033 vector.
add(-mean_value);
2036 struct EigenvalueTracker
2045 std::vector<double> values;
2054 template <
typename MatrixType,
class VectorType,
typename PreconditionerType>
2057 const double smoothing_range,
2058 const bool nonzero_starting,
2059 const unsigned int eig_cg_n_iterations,
2060 const double eig_cg_residual,
2061 const double max_eigenvalue)
2063 , smoothing_range(smoothing_range)
2064 , nonzero_starting(nonzero_starting)
2065 , eig_cg_n_iterations(eig_cg_n_iterations)
2066 , eig_cg_residual(eig_cg_residual)
2067 , max_eigenvalue(max_eigenvalue)
2072 template <
typename MatrixType,
typename VectorType,
typename PreconditionerType>
2080 std::is_same<size_type, typename VectorType::size_type>::value,
2081 "PreconditionChebyshev and VectorType must have the same size_type.");
2088 template <
typename MatrixType,
typename VectorType,
typename PreconditionerType>
2091 const MatrixType & matrix,
2095 data = additional_data;
2096 internal::PreconditionChebyshevImplementation::initialize_preconditioner(
2103 template <
typename MatrixType,
typename VectorType,
typename PreconditionerType>
2111 VectorType empty_vector;
2113 update1.
reinit(empty_vector);
2114 update2.
reinit(empty_vector);
2115 update3.reinit(empty_vector);
2122 template <
typename MatrixType,
typename VectorType,
typename PreconditionerType>
2131 update2.
reinit(src,
true);
2136 double max_eigenvalue, min_eigenvalue;
2141 "Need to set at least two iterations to find eigenvalues."));
2147 std::numeric_limits<typename VectorType::value_type>::epsilon()),
2152 internal::PreconditionChebyshevImplementation::EigenvalueTracker
2155 solver.connect_eigenvalues_slot(std::bind(
2156 &internal::PreconditionChebyshevImplementation::EigenvalueTracker::slot,
2157 &eigenvalue_tracker,
2158 std::placeholders::_1));
2162 internal::PreconditionChebyshevImplementation::set_initial_guess(update2);
2172 if (eigenvalue_tracker.values.empty())
2173 min_eigenvalue = max_eigenvalue = 1;
2176 min_eigenvalue = eigenvalue_tracker.values.front();
2180 max_eigenvalue = 1.2 * eigenvalue_tracker.values.back();
2191 std::min(0.9 * max_eigenvalue, min_eigenvalue));
2200 const double actual_range = max_eigenvalue / alpha;
2201 const double sigma = (1. - std::sqrt(1. / actual_range)) /
2202 (1. + std::sqrt(1. / actual_range));
2207 ->
data.
degree = 1 + std::log(1. / eps + std::sqrt(1. / eps / eps - 1)) /
2208 std::log(1. / sigma);
2213 ->
delta = (max_eigenvalue - alpha) * 0.5;
2216 ->
theta = (max_eigenvalue + alpha) * 0.5;
2222 (std::is_same<VectorType,
2225 std::is_same<VectorType,
2227 typename VectorType::value_type>>::value ==
false))
2228 update3.reinit(src,
true);
2237 template <
typename MatrixType,
typename VectorType,
typename PreconditionerType>
2244 if (std::abs(
delta) < 1e-40)
2248 for (
unsigned int k = 0; k <
data.
degree; ++k)
2251 const double rhokp = 1. / (2. * sigma - rhok);
2252 const double factor1 = rhokp * rhok, factor2 = 2. * rhokp /
delta;
2254 internal::PreconditionChebyshevImplementation::vector_updates(
2269 template <
typename MatrixType,
typename VectorType,
typename PreconditionerType>
2275 for (
unsigned int k = 0; k <
data.
degree; ++k)
2278 const double rhokp = 1. / (2. * sigma - rhok);
2279 const double factor1 = rhokp * rhok, factor2 = 2. * rhokp /
delta;
2281 internal::PreconditionChebyshevImplementation::vector_updates(
2296 template <
typename MatrixType,
typename VectorType,
typename PreconditionerType>
2300 const VectorType &src)
const 2306 internal::PreconditionChebyshevImplementation::vector_updates(
2322 template <
typename MatrixType,
typename VectorType,
typename PreconditionerType>
2326 const VectorType &src)
const 2332 internal::PreconditionChebyshevImplementation::vector_updates(
2348 template <
typename MatrixType,
typename VectorType,
typename PreconditionerType>
2352 const VectorType &src)
const 2359 internal::PreconditionChebyshevImplementation::vector_updates(
2375 template <
typename MatrixType,
typename VectorType,
typename PreconditionerType>
2379 const VectorType &src)
const 2386 internal::PreconditionChebyshevImplementation::vector_updates(
2402 template <
typename MatrixType,
typename VectorType,
typename PreconditionerType>
2414 template <
typename MatrixType,
typename VectorType,
typename PreconditionerType>
2426 DEAL_II_NAMESPACE_CLOSE
void Tstep(VectorType &x, const VectorType &rhs) const
void Tvmult_add(VectorType &, const VectorType &) const
void reinit(const size_type size, const bool omit_zeroing_entries=false)
static const unsigned int invalid_unsigned_int
void vmult(VectorType &, const VectorType &) const
void vmult(VectorType &, const VectorType &) const
types::global_dof_index size_type
void Tvmult(VectorType &dst, const VectorType &src) const
Number local_element(const size_type local_index) const
void initialize(const MatrixType &A, const typename BaseClass::AdditionalData ¶meters=typename BaseClass::AdditionalData())
std::array< Number, 1 > eigenvalues(const SymmetricTensor< 2, 1, Number > &T)
void vmult(VectorType &, const VectorType &) const
PreconditionRelaxation< MatrixType >::AdditionalData parameters
void step(VectorType &dst, const VectorType &src) const
const MatrixType & matrix
AdditionalData(const double relaxation=1.)
void(MatrixType::*)(VectorType &, const VectorType &) const function_ptr
static::ExceptionBase & ExcNotInitialized()
void initialize(const MatrixType &matrix, const AdditionalData &additional_data=AdditionalData())
std::shared_ptr< PreconditionerType > preconditioner
#define AssertThrow(cond, exc)
AdditionalData(const double relaxation=1.)
void Tstep(VectorType &x, const VectorType &rhs) const
size_type local_size() const
unsigned long long int global_dof_index
const std::vector< size_type > * permutation
const_iterator begin() const
const function_ptr precondition
void Tvmult(VectorType &, const VectorType &) const
void vmult_add(VectorType &, const VectorType &) const
void vmult(VectorType &, const VectorType &) const
void initialize(const AdditionalData ¶meters)
void step(VectorType &x, const VectorType &rhs) const
static::ExceptionBase & ExcMessage(std::string arg1)
typename MatrixType::size_type size_type
void step(VectorType &x, const VectorType &rhs) const
void vmult(VectorType &dst, const VectorType &src) const
const std::vector< size_type > & inverse_permutation
#define Assert(cond, exc)
typename PreconditionRelaxation< MatrixType >::AdditionalData AdditionalData
virtual void add(const Number a) override
bool eigenvalues_are_initialized
void do_transpose_chebyshev_loop(VectorType &dst, const VectorType &src) const
virtual ::IndexSet locally_owned_elements() const override
void Tvmult_add(VectorType &, const VectorType &) const
void Tvmult(VectorType &, const VectorType &) const
void vmult(VectorType &dst, const VectorType &src) const
typename MatrixType::size_type size_type
void Tvmult(VectorType &, const VectorType &) const
void step(VectorType &x, const VectorType &rhs) const
void initialize(const MatrixType &A, const AdditionalData ¶meters=AdditionalData())
void estimate_eigenvalues(const VectorType &src) const
void vmult(VectorType &, const VectorType &) const
void Tvmult(VectorType &, const VectorType &) const
const_iterator end() const
AdditionalData(const unsigned int degree=0, const double smoothing_range=0., const bool nonzero_starting=false, const unsigned int eig_cg_n_iterations=8, const double eig_cg_residual=1e-2, const double max_eigenvalue=1)
void Tvmult(VectorType &, const VectorType &) const
virtual Number mean_value() const override
AdditionalData(const std::vector< size_type > &permutation, const std::vector< size_type > &inverse_permutation, const typename PreconditionRelaxation< MatrixType >::AdditionalData ¶meters=typename PreconditionRelaxation< MatrixType >::AdditionalData())
VectorType matrix_diagonal_inverse
types::global_dof_index size_type
void Tvmult(VectorType &, const VectorType &) const
SmartPointer< const MatrixType, PreconditionRelaxation< MatrixType > > A
void initialize(const MatrixType &matrix, const AdditionalData &additional_data=AdditionalData())
void vmult(VectorType &, const VectorType &) const
typename MatrixType::size_type size_type
const std::vector< size_type > * inverse_permutation
void do_chebyshev_loop(VectorType &dst, const VectorType &src) const
types::global_dof_index size_type
void Tstep(VectorType &x, const VectorType &rhs) const
unsigned int eig_cg_n_iterations
typename PreconditionRelaxation< MatrixType >::AdditionalData AdditionalData
void Tstep(VectorType &dst, const VectorType &src) const
const std::vector< size_type > & permutation
size_type nth_index_in_set(const unsigned int local_index) const
PreconditionUseMatrix(const MatrixType &M, const function_ptr method)
typename PreconditionRelaxation< MatrixType >::AdditionalData AdditionalData
std::vector< std::size_t > pos_right_of_diagonal
SmartPointer< const MatrixType, PreconditionChebyshev< MatrixType, VectorType, PreconditionerType > > matrix_ptr
void vmult_add(VectorType &, const VectorType &) const
static::ExceptionBase & ExcInternalError()
void initialize(const MatrixType &A, const std::vector< size_type > &permutation, const std::vector< size_type > &inverse_permutation, const typename PreconditionRelaxation< MatrixType >::AdditionalData ¶meters=typename PreconditionRelaxation< MatrixType >::AdditionalData())