Merge pull request #5120 from atgeirr/avoid-nldd-crash

Avoid illegal combination of options.
This commit is contained in:
Bård Skaflestad 2024-01-25 15:38:36 +01:00 committed by GitHub
commit d2af824b27
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View File

@ -245,6 +245,9 @@ namespace Opm {
convergence_reports_.reserve(300); // Often insufficient, but avoids frequent moves.
// TODO: remember to fix!
if (param_.nonlinear_solver_ == "nldd") {
if (!param_.matrix_add_well_contributions_) {
OPM_THROW(std::runtime_error, "The --nonlinear-solver=nldd option can only be used with --matrix-add-well-contributions=true");
}
if (terminal_output) {
OpmLog::info("Using Non-Linear Domain Decomposition solver (nldd).");
}

View File

@ -2668,7 +2668,7 @@ namespace Opm {
const Opm::Parallel::Communication& comm = grid().comm();
const int rank = comm.rank();
DeferredLogger local_log;
{
if (!well_domain_.empty()) {
std::ostringstream os;
os << "Well name Rank Domain\n";
for (const auto& [wname, domain] : well_domain_) {