38#ifdef DEAL_II_WITH_PETSC
45#ifdef DEAL_II_WITH_TRILINOS
60#ifdef DEAL_II_WITH_PETSC
79 const std::pair<types::global_dof_index, types::global_dof_index>
80 local_range = matrix.local_range();
91 i < local_range.second;
93 if (matrix.diag_element(i) != PetscScalar())
124 std::vector<types::global_dof_index> indices;
125 std::vector<PetscScalar> solution_values;
133 solution.
set(indices, solution_values);
173 const unsigned int n_blocks = matrix.n_block_rows();
179 std::vector<std::map<::types::global_dof_index, PetscScalar>>
188 offset += matrix.block(block, 0).m();
193 std::pair<types::global_dof_index, PetscScalar>(
201 for (
unsigned int block = 0; block < n_blocks; ++block)
203 matrix.block(block, block),
204 solution.
block(block),
214 const std::pair<types::global_dof_index, types::global_dof_index>
215 local_range = matrix.block(
block_m, 0).local_range();
218 for (std::map<types::global_dof_index, PetscScalar>::const_iterator
222 if ((dof->first >= local_range.first) &&
223 (dof->first < local_range.second))
236#ifdef DEAL_II_WITH_TRILINOS
242 template <
typename TrilinosMatrix,
typename TrilinosVector>
264 const std::pair<types::global_dof_index, types::global_dof_index>
265 local_range = matrix.local_range();
276 i < local_range.second;
278 if (matrix.diag_element(i) != 0)
281 std::fabs(matrix.diag_element(i));
302 std::vector<types::global_dof_index> indices;
303 std::vector<TrilinosScalar> solution_values;
311 solution.set(indices, solution_values);
315 for (
unsigned int i = 0; i < solution_values.size(); ++i)
316 solution_values[i] *= matrix.diag_element(indices[i]);
336 template <
typename TrilinosMatrix,
typename TrilinosBlockVector>
339 const std::map<types::global_dof_index, TrilinosScalar>
352 Assert(matrix.n_block_rows() == matrix.n_block_cols(),
355 const unsigned int n_blocks = matrix.n_block_rows();
361 std::vector<std::map<types::global_dof_index, TrilinosScalar>>
370 offset += matrix.block(block, 0).m();
376 std::pair<types::global_dof_index, TrilinosScalar>(
384 for (
unsigned int block = 0; block < n_blocks; ++block)
386 matrix.block(block, block),
387 solution.block(block),
397 const std::pair<types::global_dof_index, types::global_dof_index>
398 local_range = matrix.block(
block_m, 0).local_range();
406 if ((dof->first >= local_range.first) &&
407 (dof->first < local_range.second))
422 const std::map<types::global_dof_index, TrilinosScalar> &
boundary_values,
438 const std::map<types::global_dof_index, TrilinosScalar> &
boundary_values,
BlockType & block(const unsigned int i)
std::pair< size_type, size_type > local_range() const
void compress(const VectorOperation::values operation)
void set(const std::vector< size_type > &indices, const std::vector< PetscScalar > &values)
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
static ::ExceptionBase & ExcNotQuadratic()
::VectorizedArray< Number, width > abs(const ::VectorizedArray< Number, width > &)