Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-istl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Patrick Jaap
dune-istl
Commits
3eb400d4
Commit
3eb400d4
authored
1 year ago
by
Patrick Jaap
Committed by
Patrick Jaap
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
umfpacktest: make matrices regular
parent
21028e3f
No related branches found
No related tags found
No related merge requests found
Pipeline
#64545
passed
1 year ago
Stage: .pre
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/istl/test/umfpacktest.cc
+25
-1
25 additions, 1 deletion
dune/istl/test/umfpacktest.cc
with
25 additions
and
1 deletion
dune/istl/test/umfpacktest.cc
+
25
−
1
View file @
3eb400d4
...
...
@@ -18,6 +18,24 @@
using
namespace
Dune
;
// helper to add something to the diagonal of a BCRSMatrix with blocks
auto
addToDiagonal
=
[](
auto
&&
matrix
,
const
auto
&
value
)
{
for
(
auto
rowIt
=
matrix
.
begin
();
rowIt
!=
matrix
.
end
();
rowIt
++
)
{
for
(
auto
entryIt
=
rowIt
->
begin
();
entryIt
!=
rowIt
->
end
();
entryIt
++
)
{
if
(
entryIt
.
index
()
==
rowIt
.
index
()
)
{
auto
&&
block
=
Dune
::
Impl
::
asMatrix
(
*
entryIt
);
for
(
auto
it
=
block
.
begin
();
it
!=
block
.
end
();
++
it
)
{
(
*
it
)[
it
.
index
()]
+=
value
;
}
}
}
}
};
template
<
typename
Matrix
,
typename
Vector
,
typename
BitVector
>
TestSuite
runUMFPack
(
std
::
size_t
N
)
{
...
...
@@ -27,6 +45,10 @@ TestSuite runUMFPack(std::size_t N)
Vector
b
(
N
*
N
),
x
(
N
*
N
),
b1
(
N
/
2
),
x1
(
N
/
2
);
setupLaplacian
(
mat
,
N
);
// make this regular
addToDiagonal
(
mat
,
100.0
);
b
=
1
;
b1
=
1
;
x
=
0
;
...
...
@@ -133,7 +155,9 @@ TestSuite runUMFPackMultitype2x2(std::size_t N)
setupLaplacian
(
mat
[
_1
][
_0
],
N
);
setupLaplacian
(
mat
[
_1
][
_1
],
N
);
mat
[
_0
][
_0
]
*=
2.0
;
// make the matrix regular
// make this regular
addToDiagonal
(
mat
[
_0
][
_0
],
200.0
);
addToDiagonal
(
mat
[
_1
][
_1
],
100.0
);
b
=
1.0
;
b1
=
1.0
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment