Reference documentation for deal.II version GIT b6bf1e606d 2022-08-11 15:25:02+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\}}\)
matrix_tools.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1998 - 2021 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE.md at
12 // the top level directory of deal.II.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii_matrix_tools_h
17 #define dealii_matrix_tools_h
18 
19 
20 #include <deal.II/base/config.h>
21 
23 #include <deal.II/base/function.h>
24 
26 
28 
29 #include <map>
30 
31 #ifdef DEAL_II_WITH_PETSC
32 # include <petscsys.h>
33 #endif
34 
36 
37 
38 // forward declarations
39 #ifndef DOXYGEN
40 template <int dim>
41 class Quadrature;
42 
43 
44 template <typename number>
45 class Vector;
46 template <typename number>
47 class FullMatrix;
48 template <typename number>
49 class SparseMatrix;
50 
51 template <typename number>
52 class BlockSparseMatrix;
53 template <typename Number>
54 class BlockVector;
55 
56 template <int dim, int spacedim>
57 class Mapping;
58 template <int dim, int spacedim>
59 class DoFHandler;
60 
61 namespace hp
62 {
63  template <int>
64  class QCollection;
65  template <int, int>
66  class MappingCollection;
67 } // namespace hp
68 
69 
70 # ifdef DEAL_II_WITH_PETSC
71 namespace PETScWrappers
72 {
73  class MatrixBase;
74  class VectorBase;
75  namespace MPI
76  {
77  class BlockSparseMatrix;
78  class BlockVector;
79  } // namespace MPI
80 } // namespace PETScWrappers
81 # endif
82 
83 # ifdef DEAL_II_WITH_TRILINOS
84 namespace TrilinosWrappers
85 {
86  class SparseMatrix;
87  class BlockSparseMatrix;
88  namespace MPI
89  {
90  class Vector;
91  class BlockVector;
92  } // namespace MPI
93 } // namespace TrilinosWrappers
94 # endif
95 #endif
96 
97 
98 
306 namespace MatrixTools
307 {
313  using namespace MatrixCreator;
314 
319  template <typename number>
320  void
322  const std::map<types::global_dof_index, number> &boundary_values,
324  Vector<number> & solution,
325  Vector<number> & right_hand_side,
326  const bool eliminate_columns = true);
327 
333  template <typename number>
334  void
336  const std::map<types::global_dof_index, number> &boundary_values,
338  BlockVector<number> & solution,
339  BlockVector<number> & right_hand_side,
340  const bool eliminate_columns = true);
341 
342 #ifdef DEAL_II_WITH_PETSC
378  void
380  const std::map<types::global_dof_index, PetscScalar> &boundary_values,
382  PETScWrappers::VectorBase & solution,
383  PETScWrappers::VectorBase & right_hand_side,
384  const bool eliminate_columns = true);
385 
389  void
391  const std::map<types::global_dof_index, PetscScalar> &boundary_values,
394  PETScWrappers::MPI::BlockVector & right_hand_side,
395  const bool eliminate_columns = true);
396 
397 #endif
398 
399 #ifdef DEAL_II_WITH_TRILINOS
433  void
435  const std::map<types::global_dof_index, TrilinosScalar> &boundary_values,
438  TrilinosWrappers::MPI::Vector & right_hand_side,
439  const bool eliminate_columns = true);
440 
445  void
447  const std::map<types::global_dof_index, TrilinosScalar> &boundary_values,
450  TrilinosWrappers::MPI::BlockVector & right_hand_side,
451  const bool eliminate_columns = true);
452 #endif
453 
472  template <typename number>
473  void
475  const std::map<types::global_dof_index, number> &boundary_values,
476  const std::vector<types::global_dof_index> & local_dof_indices,
477  FullMatrix<number> & local_matrix,
478  Vector<number> & local_rhs,
479  const bool eliminate_columns);
480 
485  "You are providing a matrix whose subdivision into "
486  "blocks in either row or column direction does not use "
487  "the same blocks sizes as the solution vector or "
488  "right hand side vectors, respectively.");
489 } // namespace MatrixTools
490 
491 
492 
494 
495 #endif
Abstract base class for mapping classes.
Definition: mapping.h:311
Definition: vector.h:110
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:442
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:443
static ::ExceptionBase & ExcBlocksDontMatch()
#define DeclExceptionMsg(Exception, defaulttext)
Definition: exceptions.h:487
@ matrix
Contents is actually a matrix.
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)
Definition: matrix_tools.cc:81
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:118