Check for multiple solvers before trying to use them.

This commit is contained in:
Atgeirr Flø Rasmussen 2023-08-18 15:43:58 +02:00
parent 758b4bbdb6
commit efa50c3640
2 changed files with 3 additions and 4 deletions

View File

@ -596,11 +596,10 @@ namespace Opm {
auto& ebosResid = ebosSimulator_.model().linearizer().residual();
auto& ebosSolver = ebosSimulator_.model().newtonMethod().linearSolver();
std::cerr<<"Hello there!!!"<<std::to_string(ebosSolver.getSolveCount())<<std::endl;
if (ebosSolver.getSolveCount()%100==0) {
if ((ebosSolver.numAvailableSolvers() > 1) && (ebosSolver.getSolveCount() % 100 == 0)) {
if ( terminal_output_ ) {
OpmLog::debug("Running speed test");
OpmLog::debug("Running speed test for comparing available linear solvers.");
}
Dune::Timer perfTimer;

View File

@ -311,7 +311,7 @@ std::unique_ptr<Matrix> blockJacobiAdjacency(const Grid& grid,
int numAvailableSolvers()
{
return activeSolverNum_;
return flexibleSolver_.size();
}
void prepare(const SparseMatrixAdapter& M, Vector& b)