10#include <deal.II/lac/la_parallel_block_vector.h>
20 template <
typename Number>
42 void reinit(
const std::shared_ptr<const dealii::Utilities::MPI::Partitioner>
45 diagonal_.reinit(scalar_partitioner);
61 const auto n_owned = diagonal_.get_partitioner()->locally_owned_size();
62 AssertDimension(n_owned, src.get_partitioner()->locally_owned_size());
63 AssertDimension(n_owned, dst.get_partitioner()->locally_owned_size());
65 DEAL_II_OPENMP_SIMD_PRAGMA
66 for (
unsigned int i = 0; i < n_owned; ++i)
67 dst.local_element(i) =
68 diagonal_.local_element(i) * src.local_element(i);
76 const auto n_blocks = src.n_blocks();
77 AssertDimension(n_blocks, dst.n_blocks());
79 const auto n_owned = diagonal_.get_partitioner()->locally_owned_size();
81 for (
unsigned int d = 0; d < n_blocks; ++d) {
82 AssertDimension(n_owned,
83 src.block(d).get_partitioner()->locally_owned_size());
84 AssertDimension(n_owned,
85 dst.block(d).get_partitioner()->locally_owned_size());
87 DEAL_II_OPENMP_SIMD_PRAGMA
88 for (
unsigned int i = 0; i < n_owned; ++i)
89 dst.block(d).local_element(i) =
90 diagonal_.local_element(i) * src.block(d).local_element(i);
void reinit(const std::shared_ptr< const dealii::Utilities::MPI::Partitioner > &scalar_partitioner)
typename Vectors::ScalarVector< Number > ScalarVector
void vmult(BlockVector &dst, const BlockVector &src) const
DiagonalPreconditioner()=default
void vmult(ScalarVector &dst, const ScalarVector &src) const
typename Vectors::BlockVector< Number > BlockVector
ScalarVector & scaling_vector()
dealii::LinearAlgebra::distributed::Vector< Number > ScalarVector
dealii::LinearAlgebra::distributed::BlockVector< Number > BlockVector