diff --git a/CMakeLists.txt b/CMakeLists.txt index 48a8936a..e06d0ccf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -169,14 +169,12 @@ if (NOT SuiteSparse_FOUND) ${PROJECT_SOURCE_DIR}/tutorials/tutorial2.cpp ${PROJECT_SOURCE_DIR}/tutorials/tutorial3.cpp ${PROJECT_SOURCE_DIR}/tutorials/tutorial4.cpp - ${PROJECT_SOURCE_DIR}/examples/spu_2p.cpp ) endif (NOT SuiteSparse_FOUND) # these files are provided in source control, but can only compile with Matlab # available; we are not supposed to include the TinyXML test prog. regardless list (REMOVE_ITEM opm-core_SOURCES - ${PROJECT_SOURCE_DIR}/${opm-core_DIR}/core/grid/cpgpreprocess/mxgrdecl.c ${PROJECT_SOURCE_DIR}/${opm-core_DIR}/core/grid/cpgpreprocess/processgrid.c ${PROJECT_SOURCE_DIR}/${opm-core_DIR}/core/utility/parameters/tinyxml/xmltest.cpp ) diff --git a/examples/sim_2p_incomp.cpp b/examples/sim_2p_incomp.cpp index ef4e78ea..75fe2901 100644 --- a/examples/sim_2p_incomp.cpp +++ b/examples/sim_2p_incomp.cpp @@ -78,6 +78,19 @@ main(int argc, char** argv) parameter::ParameterGroup param(argc, argv, false); std::cout << "--------------- Reading parameters ---------------" << std::endl; +#if ! HAVE_SUITESPARSE_UMFPACK_H + // This is an extra check to intercept a potentially invalid request for the + // implicit transport solver as early as possible for the user. + { + const bool use_reorder = param.getDefault("use_reorder", true); + if (!use_reorder) { + THROW("Cannot use implicit transport solver without UMFPACK. " + "Either reconfigure opm-core with SuiteSparse/UMFPACK support and recompile, " + "or use the reordering solver (use_reorder=true)."); + } + } +#endif + // If we have a "deck_filename", grid and props will be read from that. bool use_deck = param.has("deck_filename"); boost::scoped_ptr deck; diff --git a/opm/core/io/eclipse/EclipseGridParser.cpp b/opm/core/io/eclipse/EclipseGridParser.cpp index ca928d9f..8a1905ec 100644 --- a/opm/core/io/eclipse/EclipseGridParser.cpp +++ b/opm/core/io/eclipse/EclipseGridParser.cpp @@ -1079,7 +1079,7 @@ void EclipseGridParser::saveEGRID_INIT( const std::string& output_dir , const st void EclipseGridParser::saveEGRID( const std::string & filename) const { static_cast(filename); // Suppress "unused variable" warning. - THROW("Cannot write EGRID format without ert library support. Reconfigure opm-core with --with-ert and recompile."); + THROW("Cannot write EGRID format without ERT library support. Reconfigure opm-core with ERT support and recompile."); } #endif @@ -1143,7 +1143,7 @@ void EclipseGridParser::getNumericErtFields(const string& filename) ecl_file_close(ecl_file); #else static_cast(filename); // Suppress "unused variable" warning. - THROW("Cannot use IMPORT keyword without ert library support. Reconfigure opm-core with --with-ert and recompile."); + THROW("Cannot use IMPORT keyword without ERT library support. Reconfigure opm-core with ERT support and recompile."); #endif // HAVE_ERT } diff --git a/opm/core/io/eclipse/writeECLData.cpp b/opm/core/io/eclipse/writeECLData.cpp index ab733410..1729fdb6 100644 --- a/opm/core/io/eclipse/writeECLData.cpp +++ b/opm/core/io/eclipse/writeECLData.cpp @@ -162,7 +162,7 @@ namespace Opm const std::string&, const std::string&) { - THROW("Cannot call writeECLData() without ert library support. Reconfigure opm-core with --with-ert and recompile."); + THROW("Cannot call writeECLData() without ERT library support. Reconfigure opm-core with ERT support and recompile."); } } diff --git a/opm/core/transport/implicit/CSRMatrixUmfpackSolver.hpp b/opm/core/transport/implicit/CSRMatrixUmfpackSolver.hpp index c08f60f5..7b20b0ff 100644 --- a/opm/core/transport/implicit/CSRMatrixUmfpackSolver.hpp +++ b/opm/core/transport/implicit/CSRMatrixUmfpackSolver.hpp @@ -37,32 +37,51 @@ #define OPM_CSRMATRIXUMFPACKSOLVER_HPP_HEADER #include +#include -namespace Opm { - namespace ImplicitTransportLinAlgSupport { - class CSRMatrixUmfpackSolver { +namespace Opm +{ + namespace ImplicitTransportLinAlgSupport + { + + class CSRMatrixUmfpackSolver + { public: + + template void solve(const struct CSRMatrix* A, const Vector b, - Vector x) { - - call_UMFPACK(const_cast(A), - b, x); + Vector x) + { +#if HAVE_SUITESPARSE_UMFPACK_H + call_UMFPACK(const_cast(A), b, x); +#else + THROW("Cannot use implicit transport solver without UMFPACK. " + "Reconfigure opm-core with SuiteSparse/UMFPACK support and recompile."); +#endif } + template void solve(const struct CSRMatrix& A, const Vector& b, - Vector& x) { - - call_UMFPACK(const_cast(&A), - &b[0], &x[0]); + Vector& x) + { +#if HAVE_SUITESPARSE_UMFPACK_H + call_UMFPACK(const_cast(&A), &b[0], &x[0]); +#else + THROW("Cannot use implicit transport solver without UMFPACK. " + "Reconfigure opm-core with SuiteSparse/UMFPACK support and recompile."); +#endif } - }; - } -} + + + }; // class CSRMatrixUmfpackSolver + + } // namespace ImplicitTransportLinAlgSupport +} // namespace Opm #endif /* OPM_CSRMATRIXUMFPACKSOLVER_HPP_HEADER */