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
a3a944f9
Commit
a3a944f9
authored
19 years ago
by
Markus Blatt
Browse files
Options
Downloads
Patches
Plain Diff
Changed tests a little.
[[Imported from SVN: r585]]
parent
fedc9c90
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
istl/paamg/test/amgtest.cc
+8
-5
8 additions, 5 deletions
istl/paamg/test/amgtest.cc
istl/paamg/test/parallelamgtest.cc
+41
-23
41 additions, 23 deletions
istl/paamg/test/parallelamgtest.cc
with
49 additions
and
28 deletions
istl/paamg/test/amgtest.cc
+
8
−
5
View file @
a3a944f9
...
...
@@ -44,9 +44,12 @@ int main(int argc, char** argv)
b
=
0
;
x
=
100
;
if
(
N
<
6
)
Dune
::
printmatrix
(
std
::
cout
,
mat
,
"A"
,
"row"
);
setBoundary
(
x
,
b
,
N
);
if
(
N
<
6
)
{
Dune
::
printmatrix
(
std
::
cout
,
mat
,
"A"
,
"row"
);
Dune
::
printvector
(
std
::
cout
,
x
,
"x"
,
"row"
);
}
Dune
::
Timer
watch
;
...
...
@@ -55,12 +58,12 @@ int main(int argc, char** argv)
typedef
Dune
::
Amg
::
CoarsenCriterion
<
Dune
::
Amg
::
SymmetricCriterion
<
BCRSMat
,
Dune
::
Amg
::
FirstDiagonal
>
>
Criterion
;
typedef
Dune
::
Seq
SSOR
<
BCRSMat
,
Vector
,
Vector
>
Smoother
;
typedef
Dune
::
Seq
Jac
<
BCRSMat
,
Vector
,
Vector
>
Smoother
;
typedef
Dune
::
Amg
::
SmootherTraits
<
Smoother
>::
Arguments
SmootherArgs
;
SmootherArgs
smootherArgs
;
smootherArgs
.
iterations
=
2
;
smootherArgs
.
iterations
=
1
;
Criterion
criterion
(
15
,
coarsenTarget
);
...
...
@@ -69,7 +72,7 @@ int main(int argc, char** argv)
Dune
::
SeqScalarProduct
<
Vector
>
sp
;
typedef
Dune
::
Amg
::
AMG
<
Operator
,
Vector
,
Smoother
>
AMG
;
AMG
amg
(
fop
,
criterion
,
smootherArgs
,
1
,
1
);
AMG
amg
(
fop
,
criterion
,
smootherArgs
,
1
,
2
);
double
buildtime
=
watch
.
elapsed
();
...
...
This diff is collapsed.
Click to expand it.
istl/paamg/test/parallelamgtest.cc
+
41
−
23
View file @
a3a944f9
...
...
@@ -115,12 +115,15 @@ int main(int argc, char** argv)
Vector
b1
=
b
,
x1
=
x
;
if
(
N
<
6
&&
rank
==
0
)
{
Dune
::
printmatrix
(
std
::
cout
,
cmat
,
"A"
,
"row"
);
Dune
::
printvector
(
std
::
cout
,
x
,
"x"
,
"row"
);
Dune
::
printvector
(
std
::
cout
,
b
,
"b"
,
"row"
);
Dune
::
printvector
(
std
::
cout
,
b1
,
"b1"
,
"row"
);
Dune
::
printvector
(
std
::
cout
,
x1
,
"x1"
,
"row"
);
if
(
N
<=
6
)
{
std
::
ostringstream
name
;
name
<<
rank
<<
": row"
;
Dune
::
printmatrix
(
std
::
cout
,
cmat
,
"A"
,
name
.
str
().
c_str
());
Dune
::
printvector
(
std
::
cout
,
x
,
"x"
,
name
.
str
().
c_str
());
//Dune::printvector(std::cout, b, "b", name.str().c_str());
//Dune::printvector(std::cout, b1, "b1", "row");
//Dune::printvector(std::cout, x1, "x1", "row");
}
Dune
::
Timer
watch
;
...
...
@@ -130,54 +133,69 @@ int main(int argc, char** argv)
typedef
Dune
::
Amg
::
CoarsenCriterion
<
Dune
::
Amg
::
SymmetricCriterion
<
BCRSMat
,
Dune
::
Amg
::
FirstDiagonal
>
>
Criterion
;
//typedef Dune::SeqSSOR<BCRSMat,Vector,Vector> Smoother;
typedef
Dune
::
SeqJac
<
BCRSMat
,
Vector
,
Vector
>
Smoother
;
typedef
Dune
::
BlockPreconditioner
<
Vector
,
Vector
,
Communication
,
Smoother
>
ParSmoother
;
//typedef Dune::ParSSOR<BCRSMat,Vector,Vector,Communication> ParSmoother;
typedef
Dune
::
Amg
::
SmootherTraits
<
ParSmoother
>::
Arguments
SmootherArgs
;
//typedef Dune::Amg::BlockPreconditionerConstructionArgs<Smoother,Communication> SmootherArgs;
Dune
::
OverlappingSchwarzScalarProduct
<
Vector
,
Communication
>
sp
(
comm
);
Dune
::
InverseOperatorResult
r
,
r1
;
double
buildtime
;
SmootherArgs
smootherArgs
;
smootherArgs
.
iterations
=
2
;
smootherArgs
.
iterations
=
1
;
Criterion
criterion
(
15
,
coarsenTarget
);
criterion
.
setMaxDistance
(
2
);
// criterion.setMaxLevel(1);
typedef
Dune
::
Amg
::
AMG
<
Operator
,
Vector
,
ParSmoother
,
Communication
>
AMG
;
AMG
amg
(
fop
,
criterion
,
smootherArgs
,
1
,
1
,
comm
);
AMG
amg
(
fop
,
criterion
,
smootherArgs
,
1
,
2
,
comm
);
double
buildtime
=
watch
.
elapsed
();
buildtime
=
watch
.
elapsed
();
std
::
cout
<<
"Building hierarchy took "
<<
buildtime
<<
" seconds"
<<
std
::
endl
;
Dune
::
OverlappingSchwarzScalarProduct
<
Vector
,
Communication
>
sp
(
comm
);
if
(
rank
==
0
)
std
::
cout
<<
"Building hierarchy took "
<<
buildtime
<<
" seconds"
<<
std
::
endl
;
Dune
::
CGSolver
<
Vector
>
amgCG
(
fop
,
sp
,
amg
,
10e-8
,
8
00
,
(
rank
==
0
)
?
2
:
0
);
Dune
::
CGSolver
<
Vector
>
amgCG
(
fop
,
sp
,
amg
,
10e-8
,
3
00
,
(
rank
==
0
)
?
2
:
0
);
watch
.
reset
();
Dune
::
InverseOperatorResult
r
,
r1
;
amgCG
.
apply
(
x
,
b
,
r
);
//
amgCG.apply(x,b,r);
MPI_Barrier
(
MPI_COMM_WORLD
);
Smoother
ssm
(
fop
.
getmat
(),
1
,
.8
);
ParSmoother
sm
(
ssm
,
comm
);
DoubleStepPreconditioner
<
ParSmoother
>
dsp
(
sm
);
Dune
::
CGSolver
<
Vector
>
cg
(
fop
,
sp
,
sm
,
10e-08
,
800
,
(
rank
==
0
)
?
2
:
0
);
double
solvetime
=
watch
.
elapsed
();
std
::
cout
<<
"AMG solving took "
<<
solvetime
<<
" seconds"
<<
std
::
endl
;
if
(
!
r
.
converged
&&
rank
==
0
)
std
::
cerr
<<
" AMG Cg solver did not converge!"
<<
std
::
endl
;
if
(
rank
==
0
)
{
std
::
cout
<<
"AMG solving took "
<<
solvetime
<<
" seconds"
<<
std
::
endl
;
std
::
cout
<<
"AMG building took "
<<
(
buildtime
/
r
.
elapsed
*
r
.
iterations
)
<<
" iterations"
<<
std
::
endl
;
std
::
cout
<<
"AMG building together with slving took "
<<
buildtime
+
solvetime
<<
std
::
endl
;
}
std
::
cout
<<
"AMG building took "
<<
(
buildtime
/
r
.
elapsed
*
r
.
iterations
)
<<
" iterations"
<<
std
::
endl
;
std
::
cout
<<
"AMG building together with slving took "
<<
buildtime
+
solvetime
<<
std
::
endl
;
Smoother
ssm
(
fop
.
getmat
(),
1
,
1
);
ParSmoother
sm
(
ssm
,
comm
);
//DoubleStepPreconditioner<ParSmoother> dsp(sm);
Dune
::
LoopSolver
<
Vector
>
cg
(
fop
,
sp
,
sm
,
10e-08
,
30
,
(
rank
==
0
)
?
2
:
0
);
watch
.
reset
();
cg
.
apply
(
x1
,
b1
,
r1
);
if
(
!
r1
.
converged
&&
rank
==
0
)
std
::
cerr
<<
" Cg solver did not converge!"
<<
std
::
endl
;
//std::cout<<"CG solving took "<<watch.elapsed()<<" seconds"<<std::endl;
MPI_Finalize
();
}
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