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
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
Yuhao Liu
ogs
Commits
52d431df
Commit
52d431df
authored
9 years ago
by
Christoph Lehmann
Browse files
Options
Downloads
Patches
Plain Diff
[T] changed to new ConfigTree
parent
2cd6be7d
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
Tests/AssemblerLib/TestSerialLinearSolver.cpp
+2
-2
2 additions, 2 deletions
Tests/AssemblerLib/TestSerialLinearSolver.cpp
Tests/MathLib/TestLinearSolver.cpp
+13
-9
13 additions, 9 deletions
Tests/MathLib/TestLinearSolver.cpp
with
15 additions
and
11 deletions
Tests/AssemblerLib/TestSerialLinearSolver.cpp
+
2
−
2
View file @
52d431df
...
...
@@ -19,7 +19,6 @@
#include
"AssemblerLib/VectorMatrixAssembler.h"
#include
"AssemblerLib/LocalAssemblerBuilder.h"
#include
"MathLib/LinAlg/ApplyKnownSolution.h"
#include
"MathLib/LinAlg/Solvers/GaussAlgorithm.h"
#include
"MathLib/LinAlg/FinalizeMatrixAssembly.h"
...
...
@@ -137,8 +136,9 @@ TEST(AssemblerLibSerialLinearSolver, Steady2DdiffusionQuadElem)
t_root
.
put_child
(
"eigen"
,
t_solver
);
}
t_root
.
put
(
"lis"
,
"-i cg -p none -tol 1e-16 -maxiter 1000"
);
BaseLib
::
ConfigTreeNew
conf
(
t_root
);
GlobalSetup
::
LinearSolver
ls
(
*
A
,
"solver_name"
,
&
t_root
);
GlobalSetup
::
LinearSolver
ls
(
*
A
,
"solver_name"
,
&
conf
);
ls
.
solve
(
*
rhs
,
*
x
);
// copy solution to double vector
...
...
This diff is collapsed.
Click to expand it.
Tests/MathLib/TestLinearSolver.cpp
+
13
−
9
View file @
52d431df
...
...
@@ -99,7 +99,7 @@ template<typename IntType> struct Example1
};
template
<
class
T_MATRIX
,
class
T_VECTOR
,
class
T_LINEAR_SOVLER
,
typename
IntType
>
void
checkLinearSolverInterface
(
T_MATRIX
&
A
,
BaseLib
::
ConfigTree
&
ls_option
)
void
checkLinearSolverInterface
(
T_MATRIX
&
A
,
BaseLib
::
ConfigTree
New
const
&
ls_option
)
{
Example1
<
IntType
>
ex1
;
...
...
@@ -136,7 +136,7 @@ void checkLinearSolverInterface(T_MATRIX &A, BaseLib::ConfigTree& ls_option)
template
<
class
T_MATRIX
,
class
T_VECTOR
,
class
T_LINEAR_SOVLER
>
void
checkLinearSolverInterface
(
T_MATRIX
&
A
,
T_VECTOR
&
b
,
const
std
::
string
&
prefix_name
,
BaseLib
::
ConfigTree
&
ls_option
)
BaseLib
::
ConfigTree
New
const
&
ls_option
)
{
int
mrank
;
MPI_Comm_rank
(
PETSC_COMM_WORLD
,
&
mrank
);
...
...
@@ -206,6 +206,7 @@ TEST(MathLib, CheckInterface_GaussAlgorithm)
boost
::
property_tree
::
ptree
t_root
;
boost
::
property_tree
::
ptree
t_solver
;
t_root
.
put_child
(
"ogs"
,
t_solver
);
BaseLib
::
ConfigTreeNew
conf
(
t_root
);
using
Example
=
Example1
<
std
::
size_t
>
;
...
...
@@ -213,7 +214,7 @@ TEST(MathLib, CheckInterface_GaussAlgorithm)
MathLib
::
GlobalDenseMatrix
<
double
>
A
(
Example
::
dim_eqs
,
Example
::
dim_eqs
);
checkLinearSolverInterface
<
MathLib
::
GlobalDenseMatrix
<
double
>
,
MathLib
::
DenseVector
<
double
>
,
LinearSolverType
,
std
::
size_t
>
(
A
,
t_root
);
A
,
conf
);
}
#ifdef OGS_USE_EIGEN
...
...
@@ -227,12 +228,13 @@ TEST(Math, CheckInterface_Eigen)
t_solver
.
put
(
"error_tolerance"
,
1e-15
);
t_solver
.
put
(
"max_iteration_step"
,
1000
);
t_root
.
put_child
(
"eigen"
,
t_solver
);
BaseLib
::
ConfigTreeNew
conf
(
t_root
);
using
IntType
=
MathLib
::
EigenMatrix
::
IndexType
;
MathLib
::
EigenMatrix
A
(
Example1
<
IntType
>::
dim_eqs
);
checkLinearSolverInterface
<
MathLib
::
EigenMatrix
,
MathLib
::
EigenVector
,
MathLib
::
EigenLinearSolver
,
IntType
>
(
A
,
t_root
);
MathLib
::
EigenLinearSolver
,
IntType
>
(
A
,
conf
);
}
#endif
...
...
@@ -243,12 +245,13 @@ TEST(Math, CheckInterface_EigenLis)
boost
::
property_tree
::
ptree
t_root
;
boost
::
property_tree
::
ptree
t_solver
;
t_root
.
put
(
"lis"
,
"-i cg -p none -tol 1e-15 -maxiter 1000"
);
BaseLib
::
ConfigTreeNew
conf
(
t_root
);
using
IntType
=
MathLib
::
LisMatrix
::
IndexType
;
MathLib
::
EigenMatrix
A
(
Example1
<
IntType
>::
dim_eqs
);
checkLinearSolverInterface
<
MathLib
::
EigenMatrix
,
MathLib
::
EigenVector
,
MathLib
::
EigenLisLinearSolver
,
IntType
>
(
A
,
t_root
);
MathLib
::
EigenLisLinearSolver
,
IntType
>
(
A
,
conf
);
}
#endif
...
...
@@ -259,12 +262,13 @@ TEST(Math, CheckInterface_Lis)
boost
::
property_tree
::
ptree
t_root
;
boost
::
property_tree
::
ptree
t_solver
;
t_root
.
put
(
"lis"
,
"-i cg -p none -tol 1e-15 -maxiter 1000"
);
BaseLib
::
ConfigTreeNew
conf
(
t_root
);
using
IntType
=
MathLib
::
LisMatrix
::
IndexType
;
MathLib
::
LisMatrix
A
(
Example1
<
IntType
>::
dim_eqs
);
checkLinearSolverInterface
<
MathLib
::
LisMatrix
,
MathLib
::
LisVector
,
MathLib
::
LisLinearSolver
,
IntType
>
(
A
,
t_root
);
MathLib
::
LisLinearSolver
,
IntType
>
(
A
,
conf
);
}
#endif
...
...
@@ -292,7 +296,7 @@ TEST(MPITest_Math, CheckInterface_PETSc_Linear_Solver_basic)
checkLinearSolverInterface
<
MathLib
::
PETScMatrix
,
MathLib
::
PETScVector
,
MathLib
::
PETScLinearSolver
>
(
A
,
b
,
"ptest1_"
,
t_root
);
A
,
b
,
"ptest1_"
,
BaseLib
::
ConfigTreeNew
(
t_root
)
)
;
}
TEST
(
MPITest_Math
,
CheckInterface_PETSc_Linear_Solver_chebyshev_sor
)
...
...
@@ -318,7 +322,7 @@ TEST(MPITest_Math, CheckInterface_PETSc_Linear_Solver_chebyshev_sor)
checkLinearSolverInterface
<
MathLib
::
PETScMatrix
,
MathLib
::
PETScVector
,
MathLib
::
PETScLinearSolver
>
(
A
,
b
,
"ptest2_"
,
t_root
);
A
,
b
,
"ptest2_"
,
BaseLib
::
ConfigTreeNew
(
t_root
)
)
;
}
TEST
(
MPITest_Math
,
CheckInterface_PETSc_Linear_Solver_gmres_amg
)
...
...
@@ -346,7 +350,7 @@ TEST(MPITest_Math, CheckInterface_PETSc_Linear_Solver_gmres_amg)
checkLinearSolverInterface
<
MathLib
::
PETScMatrix
,
MathLib
::
PETScVector
,
MathLib
::
PETScLinearSolver
>
(
A
,
b
,
"ptest3_"
,
t_root
);
A
,
b
,
"ptest3_"
,
BaseLib
::
ConfigTreeNew
(
t_root
)
)
;
}
#endif
...
...
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