Skip to content
Snippets Groups Projects
Commit 31a8b117 authored by Norihiro Watanabe's avatar Norihiro Watanabe
Browse files

add tests for Lis vector, matrix and linear solver

parent ce92cdab
No related branches found
No related tags found
No related merge requests found
......@@ -17,6 +17,9 @@
#include "MathLib/LinAlg/Dense/DenseMatrix.h"
#include "MathLib/LinAlg/Dense/GlobalDenseMatrix.h"
#include "MathLib/LinAlg/FinalizeMatrixAssembly.h"
#ifdef USE_LIS
#include "MathLib/LinAlg/Lis/LisMatrix.h"
#endif
namespace
{
......@@ -50,4 +53,10 @@ TEST(Math, CheckInterface_GlobalDenseMatrix)
checkGlobalMatrixInterface(m);
}
#ifdef USE_LIS
TEST(Math, CheckInterface_LisMatrix)
{
MathLib::LisMatrix m(10);
checkGlobalMatrixInterface(m);
}
#endif
......@@ -15,6 +15,9 @@
#include <gtest/gtest.h>
#include "MathLib/LinAlg/Dense/DenseVector.h"
#ifdef USE_LIS
#include "MathLib/LinAlg/Lis/LisVector.h"
#endif
namespace
{
......@@ -64,4 +67,10 @@ TEST(Math, CheckInterface_DenseVector)
checkGlobalVectorInterface<MathLib::DenseVector<double> >();
}
#ifdef USE_LIS
TEST(Math, CheckInterface_LisVector)
{
checkGlobalVectorInterface<MathLib::LisVector >();
}
#endif
......@@ -21,6 +21,10 @@
#include "MathLib/LinAlg/Dense/DenseTools.h"
#include "MathLib/LinAlg/FinalizeMatrixAssembly.h"
#include "MathLib/LinAlg/Solvers/GaussAlgorithm.h"
#ifdef USE_LIS
#include "MathLib/LinAlg/Lis/LisLinearSolver.h"
#include "MathLib/LinAlg/Lis/LisTools.h"
#endif
#include "../TestTools.h"
......@@ -72,7 +76,7 @@ struct Example1
~Example1()
{
delete [] exH;
delete [] exH;
}
};
......@@ -121,4 +125,20 @@ TEST(MathLib, CheckInterface_GaussAlgorithm)
checkLinearSolverInterface<MathLib::GlobalDenseMatrix<double>, MathLib::DenseVector<double>, LinearSolverType>(A, t_root);
}
#ifdef USE_LIS
TEST(Math, CheckInterface_Lis)
{
// set solver options using Boost property tree
boost::property_tree::ptree t_root;
boost::property_tree::ptree t_solver;
t_solver.put("solver_type", "CG");
t_solver.put("precon_type", "NONE");
t_solver.put("error_tolerance", 1e-15);
t_solver.put("max_iteration_step", 1000);
t_root.put_child("LinearSolver", t_solver);
MathLib::LisMatrix A(Example1::dim_eqs);
checkLinearSolverInterface<MathLib::LisMatrix, MathLib::LisVector, MathLib::LisLinearSolver>(A, 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