Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Dmitri Naumov
ogs
Commits
cf72e7ed
Commit
cf72e7ed
authored
9 years ago
by
Christoph Lehmann
Browse files
Options
Downloads
Patches
Plain Diff
[T] changed PETSc options
parent
6a9aae46
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Tests/MathLib/TestLinearSolver.cpp
+45
-30
45 additions, 30 deletions
Tests/MathLib/TestLinearSolver.cpp
with
45 additions
and
30 deletions
Tests/MathLib/TestLinearSolver.cpp
+
45
−
30
View file @
cf72e7ed
...
...
@@ -43,7 +43,7 @@
#include
"MathLib/LinAlg/PETSc/PETScLinearSolver.h"
#endif
#include
"
..
/TestTools.h"
#include
"
Tests
/TestTools.h"
namespace
{
...
...
@@ -288,19 +288,24 @@ TEST(MPITest_Math, CheckInterface_PETSc_Linear_Solver_basic)
const
bool
is_global_size
=
false
;
MathLib
::
PETScVector
b
(
2
,
is_global_size
);
boost
::
property_tree
::
ptree
t_root
;
t_root
.
put
(
"petsc"
,
"-ptest1_ksp_type bcgs "
"-ptest1_ksp_rtol 1.e-8 "
"-ptest1_ksp_atol 1.e-50 "
"-ptest1_ksp_max_it 1000 "
"-ptest1_pc_type bjacobi"
);
const
char
xml
[]
=
"<petsc>"
" <parameters>"
" -ptest1_ksp_type bcgs "
" -ptest1_ksp_rtol 1.e-8 "
" -ptest1_ksp_atol 1.e-50 "
" -ptest1_ksp_max_it 1000 "
" -ptest1_pc_type bjacobi"
" </parameters>"
" <prefix>ptest1</prefix>"
"</petsc>"
;
auto
const
ptree
=
readXml
(
xml
);
checkLinearSolverInterface
<
MathLib
::
PETScMatrix
,
MathLib
::
PETScVector
,
MathLib
::
PETScLinearSolver
>
(
A
,
b
,
"
ptest1_
"
,
BaseLib
::
ConfigTree
(
t_root
,
""
,
BaseLib
::
ConfigTree
::
onerror
,
A
,
b
,
""
,
BaseLib
::
ConfigTree
(
ptree
,
""
,
BaseLib
::
ConfigTree
::
onerror
,
BaseLib
::
ConfigTree
::
onwarning
)
);
}
...
...
@@ -317,19 +322,24 @@ TEST(MPITest_Math, CheckInterface_PETSc_Linear_Solver_chebyshev_sor)
const
bool
is_global_size
=
false
;
MathLib
::
PETScVector
b
(
2
,
is_global_size
);
boost
::
property_tree
::
ptree
t_root
;
t_root
.
put
(
"petsc"
,
"-ptest2_ksp_type chebyshev "
"-ptest2_ksp_rtol 1.e-8 "
"-ptest2_ksp_atol 1.e-50"
"-ptest2_ksp_max_it 1000 "
"-ptest2_pc_type sor"
);
const
char
xml
[]
=
"<petsc>"
" <parameters>"
" -ptest2_ksp_type chebyshev "
" -ptest2_ksp_rtol 1.e-8 "
" -ptest2_ksp_atol 1.e-50"
" -ptest2_ksp_max_it 1000 "
" -ptest2_pc_type sor"
" </parameters>"
" <prefix>ptest2</prefix>"
"</petsc>"
;
auto
const
ptree
=
readXml
(
xml
);
checkLinearSolverInterface
<
MathLib
::
PETScMatrix
,
MathLib
::
PETScVector
,
MathLib
::
PETScLinearSolver
>
(
A
,
b
,
"
ptest2_
"
,
BaseLib
::
ConfigTree
(
t_root
,
""
,
BaseLib
::
ConfigTree
::
onerror
,
A
,
b
,
""
,
BaseLib
::
ConfigTree
(
ptree
,
""
,
BaseLib
::
ConfigTree
::
onerror
,
BaseLib
::
ConfigTree
::
onwarning
)
);
}
...
...
@@ -346,21 +356,26 @@ TEST(MPITest_Math, CheckInterface_PETSc_Linear_Solver_gmres_amg)
const
bool
is_global_size
=
false
;
MathLib
::
PETScVector
b
(
2
,
is_global_size
);
boost
::
property_tree
::
ptree
t_root
;
t_root
.
put
(
"petsc"
,
"-ptest3_ksp_type gmres "
"-ptest3_ksp_rtol 1.e-8 "
"-ptest3_ksp_gmres_restart 20 "
"-ptest3_ksp_gmres_classicalgramschmidt "
"-ptest3_pc_type gamg "
"-ptest3_pc_gamg_type agg "
"-ptest3_pc_gamg_agg_nsmooths 2"
);
const
char
xml
[]
=
"<petsc>"
" <parameters>"
" -ptest3_ksp_type gmres "
" -ptest3_ksp_rtol 1.e-8 "
" -ptest3_ksp_gmres_restart 20 "
" -ptest3_ksp_gmres_classicalgramschmidt "
" -ptest3_pc_type gamg "
" -ptest3_pc_gamg_type agg "
" -ptest3_pc_gamg_agg_nsmooths 2"
" </parameters>"
" <prefix>ptest3</prefix>"
"</petsc>"
;
auto
const
ptree
=
readXml
(
xml
);
checkLinearSolverInterface
<
MathLib
::
PETScMatrix
,
MathLib
::
PETScVector
,
MathLib
::
PETScLinearSolver
>
(
A
,
b
,
"
ptest3_
"
,
BaseLib
::
ConfigTree
(
t_root
,
""
,
BaseLib
::
ConfigTree
::
onerror
,
A
,
b
,
""
,
BaseLib
::
ConfigTree
(
ptree
,
""
,
BaseLib
::
ConfigTree
::
onerror
,
BaseLib
::
ConfigTree
::
onwarning
)
);
}
...
...
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