Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-solvers
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
agnumpde
dune-solvers
Commits
4ff9dbfb
There was a problem fetching the pipeline summary.
Commit
4ff9dbfb
authored
8 years ago
by
Max Kahnt
Browse files
Options
Downloads
Patches
Plain Diff
Fix: Cope with omitted diagonal blocks in outer GS loop.
parent
fa890457
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/solvers/iterationsteps/blockgssteps.hh
+19
-9
19 additions, 9 deletions
dune/solvers/iterationsteps/blockgssteps.hh
with
19 additions
and
9 deletions
dune/solvers/iterationsteps/blockgssteps.hh
+
19
−
9
View file @
4ff9dbfb
...
...
@@ -40,16 +40,24 @@ void linearStep(const M& m, V& x, const V& b, const BitVector* ignore,
// Note: move-capture requires C++14
auto
blockStep
=
[
&
,
localSolver
=
std
::
move
(
localSolver
)
](
size_t
i
)
{
const
auto
&
row_i
=
m
[
i
];
// Compute residual
auto
ri
=
b
[
i
];
for
(
auto
cIt
=
row_i
.
begin
();
cIt
!=
row_i
.
end
();
++
cIt
)
cIt
->
mmv
(
x
[
cIt
.
index
()],
ri
);
std
::
bitset
<
V
::
block_type
::
dimension
>
ignore_i
(
0
);
if
(
ignore
!=
nullptr
)
ignore_i
=
(
*
ignore
)[
i
];
// Compute residual
auto
ri
=
b
[
i
];
using
Block
=
typename
M
::
block_type
;
const
Block
*
diag
=
nullptr
;
for
(
auto
cIt
=
row_i
.
begin
();
cIt
!=
row_i
.
end
();
++
cIt
)
{
size_t
j
=
cIt
.
index
();
cIt
->
mmv
(
x
[
j
],
ri
);
if
(
j
==
i
)
diag
=
&*
cIt
;
}
// Update iterate with correction
x
[
i
]
+=
localSolver
(
row_i
[
i
]
,
std
::
move
(
ri
),
ignore_i
);
x
[
i
]
+=
localSolver
(
diag
?
*
diag
:
Block
(
0.0
)
,
std
::
move
(
ri
),
ignore_i
);
};
if
(
direction
!=
Direction
::
BACKWARD
)
...
...
@@ -172,9 +180,10 @@ namespace LocalSolverFromLinearSolver {
*/
template
<
class
LinearSolver
>
auto
truncateSymmetrically
(
LinearSolver
&&
linearSolver
)
{
return
[
linearSolver
=
std
::
move
(
linearSolver
)
](
const
auto
&
m
,
const
auto
&
b
,
const
auto
&
ignore
)
{
using
Return
=
typename
std
::
result_of
<
LinearSolver
(
decltype
(
m
),
decltype
(
b
))
>::
type
;
return
[
linearSolver
=
std
::
move
(
linearSolver
)](
const
auto
&
m
,
const
auto
&
b
,
const
auto
&
ignore
)
{
using
Return
=
typename
std
::
result_of
<
LinearSolver
(
decltype
(
m
),
decltype
(
b
))
>::
type
;
if
(
ignore
.
all
())
return
Return
(
0
);
...
...
@@ -270,7 +279,8 @@ auto cg(size_t maxIter = LinearSolvers::defaultCgMaxIter,
auto
cgSolver
=
std
::
bind
(
LinearSolvers
::
cg
<
std
::
decay_t
<
decltype
(
m
)
>
,
std
::
decay_t
<
decltype
(
b
)
>>
,
_1
,
_2
,
maxIter
,
tol
);
auto
cgTruncatedSolver
=
LocalSolverFromLinearSolver
::
truncateSymmetrically
(
cgSolver
);
auto
cgTruncatedSolver
=
LocalSolverFromLinearSolver
::
truncateSymmetrically
(
cgSolver
);
auto
cgTruncatedRegularizedSolver
=
LocalSolverRegularizer
::
diagRegularize
(
r
,
cgTruncatedSolver
);
return
cgTruncatedRegularizedSolver
(
m
,
b
,
ignore
);
...
...
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