diff --git a/opm/simulators/linalg/FlexibleSolver_impl.hpp b/opm/simulators/linalg/FlexibleSolver_impl.hpp index a377ef47d..3002c2e25 100644 --- a/opm/simulators/linalg/FlexibleSolver_impl.hpp +++ b/opm/simulators/linalg/FlexibleSolver_impl.hpp @@ -171,7 +171,7 @@ namespace Dune *scalarproduct_, *preconditioner_, tol,// desired residual reduction factor - restart, + restart, maxiter, // maximum number of iterations verbosity); } else if (solver_type == "flexgmres") { @@ -180,7 +180,7 @@ namespace Dune *scalarproduct_, *preconditioner_, tol,// desired residual reduction factor - restart, + restart, maxiter, // maximum number of iterations verbosity); #if HAVE_SUITESPARSE_UMFPACK @@ -193,7 +193,7 @@ namespace Dune } else if (solver_type == "cubicgstab") { linsolver_.reset(new Opm::cuistl::SolverAdapter( *linearoperator_for_solver_, - scalarproduct_, + *scalarproduct_, preconditioner_, tol, // desired residual reduction factor maxiter, // maximum number of iterations diff --git a/opm/simulators/linalg/cuistl/SolverAdapter.hpp b/opm/simulators/linalg/cuistl/SolverAdapter.hpp index 95589015a..df7984226 100644 --- a/opm/simulators/linalg/cuistl/SolverAdapter.hpp +++ b/opm/simulators/linalg/cuistl/SolverAdapter.hpp @@ -56,12 +56,12 @@ public: // TODO: Use a std::forward SolverAdapter(Operator& op, - std::shared_ptr> sp, + Dune::ScalarProduct& sp, std::shared_ptr> prec, scalar_real_type reduction, int maxit, int verbose) - : Dune::IterativeSolver(op, *sp, *prec, reduction, maxit, verbose) + : Dune::IterativeSolver(op, sp, *prec, reduction, maxit, verbose) , m_opOnCPUWithMatrix(op) , m_matrix(CuSparseMatrix::fromMatrix(op.getmat())) , m_underlyingSolver(constructSolver(prec, reduction, maxit, verbose)) diff --git a/tests/cuistl/test_solver_adapter.cpp b/tests/cuistl/test_solver_adapter.cpp index 46661d891..9b63211b2 100644 --- a/tests/cuistl/test_solver_adapter.cpp +++ b/tests/cuistl/test_solver_adapter.cpp @@ -79,9 +79,9 @@ createSolverAdapterWithMatrix(const size_t N = 10) prm.put("relaxation", 1.0); prm.put("type", "CUILU0"); auto prec = PrecondFactory::create(*op, prm); - auto solverAdapter = std::make_shared(*op, sp, prec, 1.0, 10, 0); + auto solverAdapter = std::make_shared(*op, *sp, prec, 1.0, 10, 0); - return std::make_tuple(matrixPtr, solverAdapter, op); + return std::make_tuple(matrixPtr, solverAdapter, op, sp); } } // namespace @@ -93,7 +93,7 @@ BOOST_AUTO_TEST_CASE(TestCreation) BOOST_AUTO_TEST_CASE(TestSolve) { const size_t N = 10; - auto [matrix, solverAdapter, op] = createSolverAdapterWithMatrix(N); + auto [matrix, solverAdapter, op, sp] = createSolverAdapterWithMatrix(N); Vector xActual(N), xInitial(N), b(N); for (size_t i = 0; i < N; ++i) {