mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
added: MultisegmentWellEquations::createSolver
this applies compute the LU decomposition of the D matrix
This commit is contained in:
parent
abf5f94561
commit
e67e58d0c8
@ -22,9 +22,15 @@
|
||||
#include <config.h>
|
||||
#include <opm/simulators/wells/MultisegmentWellEquations.hpp>
|
||||
|
||||
#include <dune/istl/umfpack.hh>
|
||||
|
||||
#include <opm/common/ErrorMacros.hpp>
|
||||
|
||||
#include <opm/simulators/wells/MSWellHelpers.hpp>
|
||||
#include <opm/simulators/wells/MultisegmentWellGeneric.hpp>
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
namespace Opm {
|
||||
|
||||
template<class Scalar, int numWellEq, int numEq>
|
||||
@ -140,6 +146,21 @@ apply(BVector& r) const
|
||||
duneC_.mmtv(invDrw, r);
|
||||
}
|
||||
|
||||
template<class Scalar, int numWellEq, int numEq>
|
||||
void MultisegmentWellEquations<Scalar,numWellEq,numEq>::createSolver()
|
||||
{
|
||||
#if HAVE_UMFPACK
|
||||
if (duneDSolver_) {
|
||||
return;
|
||||
}
|
||||
|
||||
duneDSolver_ = std::make_shared<Dune::UMFPack<DiagMatWell>>(duneD_, 0);
|
||||
#else
|
||||
OPM_THROW(std::runtime_error, "MultisegmentWell support requires UMFPACK. "
|
||||
"Reconfigure opm-simulators with SuiteSparse/UMFPACK support and recompile.");
|
||||
#endif
|
||||
}
|
||||
|
||||
#define INSTANCE(numWellEq, numEq) \
|
||||
template class MultisegmentWellEquations<double,numWellEq,numEq>;
|
||||
|
||||
|
@ -80,6 +80,9 @@ public:
|
||||
//! \brief Apply linear operator to vector.
|
||||
void apply(BVector& r) const;
|
||||
|
||||
//! \brief Compute the LU-decomposition of D matrix.
|
||||
void createSolver();
|
||||
|
||||
// two off-diagonal matrices
|
||||
OffDiagMatWell duneB_;
|
||||
OffDiagMatWell duneC_;
|
||||
|
@ -1776,6 +1776,8 @@ namespace Opm
|
||||
this->assemblePressureEq(seg, unit_system, well_state, deferred_logger);
|
||||
}
|
||||
}
|
||||
|
||||
this->linSys_.createSolver();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user