Skip to content
Snippets Groups Projects
Commit 52d431df authored by Christoph Lehmann's avatar Christoph Lehmann
Browse files

[T] changed to new ConfigTree

parent 2cd6be7d
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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::ConfigTreeNew 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::ConfigTreeNew 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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment