MSWellhelpers: disable for float Scalar

there is no UMFPack for floats
This commit is contained in:
Arne Morten Kvarving 2024-04-13 15:18:32 +02:00
parent d28b751742
commit 42b8545e51

View File

@ -110,7 +110,9 @@ applyUMFPack(Dune::UMFPack<MatrixType>& linsolver,
// Object storing some statistics about the solving process
Dune::InverseOperatorResult res;
if constexpr (std::is_same_v<typename VectorType::field_type,float>) {
OPM_THROW(std::runtime_error, "Cannot use applyUMFPack() with floats.");
} else {
// Solve
linsolver.apply(y, x, res);
@ -125,6 +127,7 @@ applyUMFPack(Dune::UMFPack<MatrixType>& linsolver,
}
}
}
}
return y;
#else
// this is not thread safe
@ -146,6 +149,9 @@ invertWithUMFPack(const int size,
// Make a full block matrix.
Dune::Matrix<typename MatrixType::block_type> inv(size, size);
if constexpr (std::is_same_v<typename VectorType::field_type,float>) {
OPM_THROW(std::runtime_error, "Cannot use invertWithUMFPack() with floats.");
} else {
// Create inverse by passing basis vectors to the solver.
for (int ii = 0; ii < size; ++ii) {
for (int jj = 0; jj < bsize; ++jj) {
@ -159,6 +165,7 @@ invertWithUMFPack(const int size,
e[ii][jj] = 0.0;
}
}
}
return inv;
#else