Loading [MathJax]/extensions/TeX/AMSsymbols.js
deal.II version GIT relicensing-2834-g6a67e08714 2025-03-13 11:40:00+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\}}\)
Toggle main menu visibility
Main Page
Tutorial
Code gallery
Topics
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
Variables
a
b
d
e
f
h
i
l
m
n
o
p
q
r
s
t
u
v
w
z
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
p
r
s
t
v
Enumerations
a
b
c
d
e
f
g
h
i
l
n
o
p
r
s
v
Enumerator
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
Enumerations
b
c
d
e
f
g
i
m
o
p
r
s
t
u
v
w
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Related Symbols
:
a
b
c
d
f
g
i
l
m
n
o
p
r
s
t
u
v
Related Pages
Files
File List
File Members
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
Variables
a
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
Typedefs
Enumerations
Enumerator
m
u
Macros
a
b
d
e
f
h
i
m
p
s
t
dealii.org
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
Concepts
Loading...
Searching...
No Matches
source
lac
petsc_full_matrix.cc
Go to the documentation of this file.
1
// ------------------------------------------------------------------------
2
//
3
// SPDX-License-Identifier: LGPL-2.1-or-later
4
// Copyright (C) 2004 - 2023 by the deal.II authors
5
//
6
// This file is part of the deal.II library.
7
//
8
// Part of the source code is dual licensed under Apache-2.0 WITH
9
// LLVM-exception OR LGPL-2.1-or-later. Detailed license information
10
// governing the source code and code contributions can be found in
11
// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II.
12
//
13
// ------------------------------------------------------------------------
14
15
#include <
deal.II/lac/petsc_full_matrix.h
>
16
17
#ifdef DEAL_II_WITH_PETSC
18
19
# include <
deal.II/lac/exceptions.h
>
20
# include <
deal.II/lac/petsc_compatibility.h
>
21
22
DEAL_II_NAMESPACE_OPEN
23
24
namespace
PETScWrappers
25
{
26
FullMatrix::FullMatrix
()
27
{
28
// empty constructor generate an empty matrix
29
do_reinit
(0, 0);
30
}
26
FullMatrix::FullMatrix
() {
…
}
31
32
FullMatrix::FullMatrix
(
const
size_type
m,
const
size_type
n)
33
{
34
do_reinit
(
m
,
n
);
35
}
32
FullMatrix::FullMatrix
(
const
size_type
m,
const
size_type
n) {
…
}
36
37
void
38
FullMatrix::reinit
(
const
size_type
m,
const
size_type
n)
39
{
40
// get rid of old matrix and generate a
41
// new one
42
const
PetscErrorCode ierr = MatDestroy(&
matrix
);
43
AssertThrow
(ierr == 0,
ExcPETScError
(ierr));
44
45
do_reinit
(
m
,
n
);
46
}
38
FullMatrix::reinit
(
const
size_type
m,
const
size_type
n) {
…
}
47
48
void
49
FullMatrix::do_reinit
(
const
size_type
m,
const
size_type
n)
50
{
51
// use the call sequence indicating only a maximal number of
52
// elements per row for all rows globally
53
const
PetscErrorCode ierr =
54
MatCreateSeqDense(PETSC_COMM_SELF,
m
,
n
,
nullptr
, &
matrix
);
55
AssertThrow
(ierr == 0,
ExcPETScError
(ierr));
56
}
49
FullMatrix::do_reinit
(
const
size_type
m,
const
size_type
n) {
…
}
57
58
}
// namespace PETScWrappers
59
60
61
DEAL_II_NAMESPACE_CLOSE
62
63
#endif
// DEAL_II_WITH_PETSC
LACExceptions::ExcPETScError
Definition
exceptions.h:66
PETScWrappers::FullMatrix::FullMatrix
FullMatrix()
Definition
petsc_full_matrix.cc:26
PETScWrappers::FullMatrix::reinit
void reinit(const size_type m, const size_type n)
Definition
petsc_full_matrix.cc:38
PETScWrappers::FullMatrix::do_reinit
void do_reinit(const size_type m, const size_type n)
Definition
petsc_full_matrix.cc:49
PETScWrappers::MatrixBase::n
size_type n() const
Definition
petsc_matrix_base.cc:321
PETScWrappers::MatrixBase::matrix
Mat matrix
Definition
petsc_matrix_base.h:1022
PETScWrappers::MatrixBase::m
size_type m() const
Definition
petsc_matrix_base.cc:308
unsigned int
DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_OPEN
Definition
config.h:40
DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NAMESPACE_CLOSE
Definition
config.h:41
AssertThrow
#define AssertThrow(cond, exc)
Definition
exception_macros.h:715
exceptions.h
PETScWrappers
Definition
template_constraints.h:635
petsc_compatibility.h
petsc_full_matrix.h
Generated by
1.9.8