Instantiate test program with MatrixBlock not FieldMatrix.

Cuts down on the necessary instantiation combinations for FlexibleSolver.
This commit is contained in:
Atgeirr Flø Rasmussen
2022-05-19 11:34:19 +02:00
parent 06a8b0ee3d
commit 6c5988f011

View File

@@ -30,6 +30,7 @@
#include <opm/simulators/linalg/FlexibleSolver.hpp>
#include <opm/simulators/linalg/getQuasiImpesWeights.hpp>
#include <opm/simulators/linalg/matrixblock.hh>
#include <opm/simulators/linalg/PropertyTree.hpp>
#include <dune/common/fmatrix.hh>
@@ -44,7 +45,7 @@ template <int bz>
Dune::BlockVector<Dune::FieldVector<double, bz>>
testSolver(const Opm::PropertyTree& prm, const std::string& matrix_filename, const std::string& rhs_filename)
{
using Matrix = Dune::BCRSMatrix<Dune::FieldMatrix<double, bz, bz>>;
using Matrix = Dune::BCRSMatrix<Opm::MatrixBlock<double, bz, bz>>;
using Vector = Dune::BlockVector<Dune::FieldVector<double, bz>>;
Matrix matrix;
{
@@ -52,7 +53,8 @@ testSolver(const Opm::PropertyTree& prm, const std::string& matrix_filename, con
if (!mfile) {
throw std::runtime_error("Could not read matrix file");
}
readMatrixMarket(matrix, mfile);
using M = Dune::BCRSMatrix<Dune::FieldMatrix<double, bz, bz>>;
readMatrixMarket(reinterpret_cast<M&>(matrix), mfile); // Hack to avoid hassle
}
Vector rhs;
{