deal.II version GIT relicensing-6834-g5b78e6bcdf 2026-10-01 11:20:01+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
matrix_tools.h
Go to the documentation of this file.
1// -----------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
4// Copyright (C) 1998 - 2026 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Detailed license information governing the source code and contributions
9// can be found in LICENSE.md and CONTRIBUTING.md at the top level directory.
10//
11// -----------------------------------------------------------------------------
12
13#ifndef dealii_matrix_tools_h
14#define dealii_matrix_tools_h
15
16
17#include <deal.II/base/config.h>
18
21
24
26
27#include <map>
28
29#ifdef DEAL_II_WITH_PETSC
30# include <petscsys.h>
31#endif
32
34
35
36// forward declarations
37#ifndef DOXYGEN
38template <int dim>
39class Quadrature;
40
41
42template <typename number>
43class Vector;
44template <typename number>
45class FullMatrix;
46template <typename number>
47class SparseMatrix;
48
49template <typename number>
51template <typename Number>
52class BlockVector;
53
54template <int dim, int spacedim>
55class Mapping;
56template <int dim, int spacedim>
58class DoFHandler;
59
60namespace hp
61{
62 template <int>
63 class QCollection;
64 template <int, int>
65 class MappingCollection;
66} // namespace hp
67
68
69# ifdef DEAL_II_WITH_PETSC
70namespace PETScWrappers
71{
72 class MatrixBase;
73 class VectorBase;
74 namespace MPI
75 {
77 class BlockVector;
78 } // namespace MPI
79} // namespace PETScWrappers
80# endif
81#endif
82
83
84
292namespace MatrixTools
293{
299 using namespace MatrixCreator;
300
305 template <typename number>
306 void
308 const std::map<types::global_dof_index, number> &boundary_values,
309 SparseMatrix<number> &matrix,
310 Vector<number> &solution,
311 Vector<number> &right_hand_side,
312 const bool eliminate_columns = true);
313
319 template <typename number>
320 void
322 const std::map<types::global_dof_index, number> &boundary_values,
324 BlockVector<number> &solution,
325 BlockVector<number> &right_hand_side,
326 const bool eliminate_columns = true);
327
328#ifdef DEAL_II_WITH_PETSC
336 void
338 const std::map<types::global_dof_index, PetscScalar> &boundary_values,
341 PETScWrappers::VectorBase &right_hand_side,
342 const bool eliminate_columns = true);
343
347 void
349 const std::map<types::global_dof_index, PetscScalar> &boundary_values,
352 PETScWrappers::MPI::BlockVector &right_hand_side,
353 const bool eliminate_columns = true);
354
355#endif
356
357#ifdef DEAL_II_TRILINOS_WITH_EPETRA
391 void
393 const std::map<types::global_dof_index, TrilinosScalar> &boundary_values,
396 TrilinosWrappers::MPI::Vector &right_hand_side,
397 const bool eliminate_columns = true);
398
403 void
405 const std::map<types::global_dof_index, TrilinosScalar> &boundary_values,
408 TrilinosWrappers::MPI::BlockVector &right_hand_side,
409 const bool eliminate_columns = true);
410#endif
411
430 template <typename number>
431 void
433 const std::map<types::global_dof_index, number> &boundary_values,
434 const std::vector<types::global_dof_index> &local_dof_indices,
435 FullMatrix<number> &local_matrix,
436 Vector<number> &local_rhs,
437 const bool eliminate_columns);
438
443 "You are providing a matrix whose subdivision into "
444 "blocks in either row or column direction does not use "
445 "the same blocks sizes as the solution vector or "
446 "right hand side vectors, respectively.");
447} // namespace MatrixTools
448
449
450
452
453#endif
Abstract base class for mapping classes.
Definition mapping.h:318
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:38
#define DEAL_II_CXX20_REQUIRES(condition)
Definition config.h:249
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:39
static ::ExceptionBase & ExcBlocksDontMatch()
#define DeclExceptionMsg(Exception, defaulttext)
void apply_boundary_values(const std::map< types::global_dof_index, number > &boundary_values, SparseMatrix< number > &matrix, Vector< number > &solution, Vector< number > &right_hand_side, const bool eliminate_columns=true)
void local_apply_boundary_values(const std::map< types::global_dof_index, number > &boundary_values, const std::vector< types::global_dof_index > &local_dof_indices, FullMatrix< number > &local_matrix, Vector< number > &local_rhs, const bool eliminate_columns)
Definition hp.h:115