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
Wiki
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
Core Modules
dune-istl
Commits
82b1f864
Commit
82b1f864
authored
2 years ago
by
Markus Blatt
Browse files
Options
Downloads
Plain Diff
Merge branch 'fix_amg_w_cycle' into 'master'
[amg] fix w-cycle See merge request
!474
parents
90236d45
3352f104
No related branches found
No related tags found
1 merge request
!474
[amg] fix w-cycle
Pipeline
#44552
passed
2 years ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/istl/paamg/amg.hh
+7
-1
7 additions, 1 deletion
dune/istl/paamg/amg.hh
dune/istl/paamg/test/amgtest.cc
+16
-6
16 additions, 6 deletions
dune/istl/paamg/test/amgtest.cc
with
23 additions
and
7 deletions
dune/istl/paamg/amg.hh
+
7
−
1
View file @
82b1f864
...
...
@@ -1057,8 +1057,14 @@ namespace Dune
if
(
processNextLevel
)
{
// next level
for
(
std
::
size_t
i
=
0
;
i
<
gamma_
;
i
++
)
for
(
std
::
size_t
i
=
0
;
i
<
gamma_
;
i
++
)
{
mgc
(
levelContext
);
if
(
levelContext
.
matrix
==
matrices_
->
matrices
().
coarsest
()
&&
levels
()
==
maxlevels
())
break
;
if
(
i
+
1
<
gamma_
){
levelContext
.
matrix
->
applyscaleadd
(
-
1.
,
*
levelContext
.
lhs
,
*
levelContext
.
rhs
);
}
}
}
moveToFineLevel
(
levelContext
,
processNextLevel
);
...
...
This diff is collapsed.
Click to expand it.
dune/istl/paamg/test/amgtest.cc
+
16
−
6
View file @
82b1f864
...
...
@@ -77,7 +77,7 @@ void randomize(const M& mat, V& b)
template
<
class
Matrix
,
class
Vector
>
void
testAMG
(
int
N
,
int
coarsenTarget
,
int
ml
)
Dune
::
InverseOperatorResult
testAMG
(
int
N
,
int
coarsenTarget
,
int
ml
,
int
gamma
=
1
)
{
std
::
cout
<<
"N="
<<
N
<<
" coarsenTarget="
<<
coarsenTarget
<<
" maxlevel="
<<
ml
<<
std
::
endl
;
...
...
@@ -139,6 +139,7 @@ void testAMG(int N, int coarsenTarget, int ml)
criterion
.
setDefaultValuesIsotropic
(
2
);
criterion
.
setAlpha
(
.67
);
criterion
.
setBeta
(
1.0e-4
);
criterion
.
setGamma
(
gamma
);
criterion
.
setMaxLevel
(
ml
);
criterion
.
setSkipIsolated
(
false
);
// specify pre/post smoother steps
...
...
@@ -176,6 +177,7 @@ void testAMG(int N, int coarsenTarget, int ml)
std::cout<<"CG solving took "<<watch.elapsed()<<" seconds"<<std::endl;
*/
return
r
;
}
...
...
@@ -195,11 +197,19 @@ try
if
(
argc
>
3
)
ml
=
atoi
(
argv
[
3
]);
{
using
Matrix
=
Dune
::
BCRSMatrix
<
XREAL
>
;
using
Vector
=
Dune
::
BlockVector
<
XREAL
>
;
testAMG
<
Matrix
,
Vector
>
(
N
,
coarsenTarget
,
ml
);
Dune
::
InverseOperatorResult
gamma1_res
;
for
(
int
gamma
=
1
;
gamma
<=
2
;
++
gamma
){
{
using
Matrix
=
Dune
::
BCRSMatrix
<
XREAL
>
;
using
Vector
=
Dune
::
BlockVector
<
XREAL
>
;
Dune
::
InverseOperatorResult
res
=
testAMG
<
Matrix
,
Vector
>
(
N
,
coarsenTarget
,
ml
,
gamma
);
if
(
gamma
==
1
){
gamma1_res
=
res
;
}
else
{
assert
(
res
.
conv_rate
<
gamma1_res
.
conv_rate
);
}
}
}
{
...
...
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