mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #1317 from GitPaean/throw_when_no_umfpack
giving more information when umfpack is not available.
This commit is contained in:
commit
1d0282c6fe
@ -122,14 +122,19 @@ foreach(SIM flow flow_ebos flow_legacy)
|
|||||||
REL_TOL ${coarse_rel_tol})
|
REL_TOL ${coarse_rel_tol})
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
foreach(SIM flow flow_legacy)
|
add_test_compareECLFiles(CASENAME spe1_2p
|
||||||
add_test_compareECLFiles(CASENAME spe1_2p
|
|
||||||
FILENAME SPE1CASE2_2P
|
FILENAME SPE1CASE2_2P
|
||||||
SIMULATOR ${SIM}
|
SIMULATOR flow
|
||||||
ABS_TOL ${abs_tol}
|
ABS_TOL ${abs_tol}
|
||||||
REL_TOL ${rel_tol}
|
REL_TOL ${rel_tol}
|
||||||
DIR spe1)
|
DIR spe1)
|
||||||
endforeach()
|
|
||||||
|
add_test_compareECLFiles(CASENAME spe1_2p
|
||||||
|
FILENAME SPE1CASE2_2P
|
||||||
|
SIMULATOR flow_legacy
|
||||||
|
ABS_TOL ${abs_tol}
|
||||||
|
REL_TOL ${coarse_rel_tol}
|
||||||
|
DIR spe1)
|
||||||
|
|
||||||
add_test_compareECLFiles(CASENAME spe1
|
add_test_compareECLFiles(CASENAME spe1
|
||||||
FILENAME SPE1CASE1
|
FILENAME SPE1CASE1
|
||||||
@ -178,7 +183,7 @@ add_test_compareECLFiles(CASENAME spe5
|
|||||||
FILENAME SPE5CASE1
|
FILENAME SPE5CASE1
|
||||||
SIMULATOR flow_solvent
|
SIMULATOR flow_solvent
|
||||||
ABS_TOL ${abs_tol}
|
ABS_TOL ${abs_tol}
|
||||||
REL_TOL 5e-4
|
REL_TOL ${coarse_rel_tol}
|
||||||
TEST_ARGS max_iter=13)
|
TEST_ARGS max_iter=13)
|
||||||
|
|
||||||
# Restart tests
|
# Restart tests
|
||||||
|
@ -33,12 +33,12 @@ namespace Opm {
|
|||||||
|
|
||||||
namespace mswellhelpers
|
namespace mswellhelpers
|
||||||
{
|
{
|
||||||
#if HAVE_UMFPACK
|
|
||||||
// obtain y = D^-1 * x with a direct solver
|
// obtain y = D^-1 * x with a direct solver
|
||||||
template <typename MatrixType, typename VectorType>
|
template <typename MatrixType, typename VectorType>
|
||||||
VectorType
|
VectorType
|
||||||
invDXDirect(const MatrixType& D, VectorType x)
|
invDXDirect(const MatrixType& D, VectorType x)
|
||||||
{
|
{
|
||||||
|
#if HAVE_UMFPACK
|
||||||
VectorType y(x.size());
|
VectorType y(x.size());
|
||||||
y = 0.;
|
y = 0.;
|
||||||
|
|
||||||
@ -61,8 +61,11 @@ namespace mswellhelpers
|
|||||||
}
|
}
|
||||||
|
|
||||||
return y;
|
return y;
|
||||||
}
|
#else
|
||||||
|
OPM_THROW(std::runtime_error, "Cannot use invDXDirect() without UMFPACK. "
|
||||||
|
"Reconfigure opm-simulator with SuiteSparse/UMFPACK support and recompile.");
|
||||||
#endif // HAVE_UMFPACK
|
#endif // HAVE_UMFPACK
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -494,11 +494,7 @@ namespace Opm
|
|||||||
duneB_.mv(x, Bx);
|
duneB_.mv(x, Bx);
|
||||||
|
|
||||||
// invDBx = duneD^-1 * Bx_
|
// invDBx = duneD^-1 * Bx_
|
||||||
#if HAVE_UMFPACK
|
|
||||||
const BVectorWell invDBx = mswellhelpers::invDXDirect(duneD_, Bx);
|
const BVectorWell invDBx = mswellhelpers::invDXDirect(duneD_, Bx);
|
||||||
#else
|
|
||||||
const BVectorWell invDBx = mswellhelpers::invDX(duneD_, Bx);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Ax = Ax - duneC_^T * invDBx
|
// Ax = Ax - duneC_^T * invDBx
|
||||||
duneC_.mmtv(invDBx,Ax);
|
duneC_.mmtv(invDBx,Ax);
|
||||||
@ -514,11 +510,7 @@ namespace Opm
|
|||||||
apply(BVector& r) const
|
apply(BVector& r) const
|
||||||
{
|
{
|
||||||
// invDrw_ = duneD^-1 * resWell_
|
// invDrw_ = duneD^-1 * resWell_
|
||||||
#if HAVE_UMFPACK
|
|
||||||
const BVectorWell invDrw = mswellhelpers::invDXDirect(duneD_, resWell_);
|
const BVectorWell invDrw = mswellhelpers::invDXDirect(duneD_, resWell_);
|
||||||
#else
|
|
||||||
const BVectorWell invDrw = mswellhelpers::invDX(duneD_, resWell_);
|
|
||||||
#endif // HAVE_UMFPACK
|
|
||||||
// r = r - duneC_^T * invDrw
|
// r = r - duneC_^T * invDrw
|
||||||
duneC_.mmtv(invDrw, r);
|
duneC_.mmtv(invDrw, r);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user