deal.II version GIT relicensing-6842-g793a97d2aa 2026-10-02 14:00: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
petsc_full_matrix.cc
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) 2004 - 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
14
15#ifdef DEAL_II_WITH_PETSC
16
19
20
21#endif // DEAL_II_WITH_PETSC
22
24
25#ifdef DEAL_II_WITH_PETSC
26
27namespace PETScWrappers
28{
30 {
31 // empty constructor generate an empty matrix
32 do_reinit(0, 0);
33 }
34
36 {
37 do_reinit(m, n);
38 }
39
40 void
42 {
43 // get rid of old matrix and generate a
44 // new one
45 const PetscErrorCode ierr = MatDestroy(&matrix);
46 AssertThrow(ierr == 0, ExcPETScError(ierr));
47
48 do_reinit(m, n);
49 }
50
51 void
53 {
54 // use the call sequence indicating only a maximal number of
55 // elements per row for all rows globally
56 const PetscErrorCode ierr =
57 MatCreateSeqDense(PETSC_COMM_SELF, m, n, nullptr, &matrix);
58 AssertThrow(ierr == 0, ExcPETScError(ierr));
59 }
60
63 {
65 return *this;
66 }
67
68} // namespace PETScWrappers
69
70
71
72#endif // DEAL_II_WITH_PETSC
MatrixBase & operator=(const MatrixBase &)=delete
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:38
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:39
#define AssertThrow(cond, exc)
FullMatrix & operator=(const value_type d)
void reinit(const size_type m, const size_type n)
void do_reinit(const size_type m, const size_type n)