From 9cffb51543b6cf7832d3354e929b10dc4388ccf5 Mon Sep 17 00:00:00 2001 From: Robert K Date: Wed, 19 Nov 2014 11:22:57 +0100 Subject: [PATCH] [bugfix] use SparseLU when UMFPack was not found. --- opm/autodiff/NewtonIterationBlackoilCPR.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/opm/autodiff/NewtonIterationBlackoilCPR.cpp b/opm/autodiff/NewtonIterationBlackoilCPR.cpp index 78a241ec9..6d6058a59 100644 --- a/opm/autodiff/NewtonIterationBlackoilCPR.cpp +++ b/opm/autodiff/NewtonIterationBlackoilCPR.cpp @@ -44,7 +44,11 @@ #include +#if HAVE_UMFPACK #include +#else +#include +#endif namespace Opm { @@ -249,7 +253,11 @@ namespace Opm const std::vector& Jn = eqs[n].derivative(); // Use sparse LU to solve the block submatrices i.e compute inv(D) +#if HAVE_UMFPACK const Eigen::UmfPackLU< M > solver(Jn[n]); +#else + const Eigen::SparseLU< M > solver(Jn[n]); +#endif M id(Jn[n].rows(), Jn[n].cols()); id.setIdentity(); const M Di = solver.solve(id); @@ -323,7 +331,11 @@ namespace Opm const M& C = eq_coll.derivative()[0]; // Use sparse LU to solve the block submatrices +#if HAVE_UMFPACK const Eigen::UmfPackLU< M > solver(D); +#else + const Eigen::SparseLU< M > solver(D); +#endif // Compute value of eliminated variable. const Eigen::VectorXd b = (equation.value().matrix() - C * partial_solution.matrix());