From 602909c16df003216951e4429e562014b6510eb7 Mon Sep 17 00:00:00 2001 From: Andreas Lauser Date: Sat, 3 Jan 2015 16:06:53 +0100 Subject: [PATCH] ECL well manager: hack around recently introduced opm-parser ideosyncrasy catching an exception for this seems like a pretty bad hack to me, but there seems to be no other way to detect that a deck did not specify a completion radius. (well, one could look at the raw COMPDAT keyword, but that would defeat all benefits of using opm-parser's schedule objects.) this makes ebos work with SPE9 for the current master version of opm-parser again. --- applications/ebos/eclwellmanager.hh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/applications/ebos/eclwellmanager.hh b/applications/ebos/eclwellmanager.hh index a46813823..2c7bad5eb 100644 --- a/applications/ebos/eclwellmanager.hh +++ b/applications/ebos/eclwellmanager.hh @@ -651,7 +651,15 @@ protected: const Opm::Completion* completion = compInfo.first; std::shared_ptr eclWell = compInfo.second; - eclWell->setRadius(elemCtx, dofIdx, 0.5*completion->getDiameter()); + // the catch is a hack for a ideosyncrasy of opm-parser with regard to + // defaults handling: if the deck did not specify a radius for the + // completion, there seems to be no other way to detect this except for + // catching the exception + try { + eclWell->setRadius(elemCtx, dofIdx, 0.5*completion->getDiameter()); + } + catch (const std::logic_error& e) + {} // overwrite the automatically computed effective // permeability by the one specified in the deck. Note: this