From f7e1623b7a035281cd0540d9b73881b19ac97f41 Mon Sep 17 00:00:00 2001 From: Kai Bao Date: Fri, 22 Sep 2017 15:47:24 +0200 Subject: [PATCH] only clearing matrix B and C when only_wells false. to save a little calculation. --- opm/autodiff/MultisegmentWell_impl.hpp | 7 +++++-- opm/autodiff/StandardWell_impl.hpp | 6 ++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/opm/autodiff/MultisegmentWell_impl.hpp b/opm/autodiff/MultisegmentWell_impl.hpp index 4875412b4..6b3e013cf 100644 --- a/opm/autodiff/MultisegmentWell_impl.hpp +++ b/opm/autodiff/MultisegmentWell_impl.hpp @@ -218,8 +218,11 @@ namespace Opm bool only_wells) { // clear all entries - duneB_ = 0.0; - duneC_ = 0.0; + if (!only_wells) { + duneB_ = 0.0; + duneC_ = 0.0; + } + duneD_ = 0.0; resWell_ = 0.0; diff --git a/opm/autodiff/StandardWell_impl.hpp b/opm/autodiff/StandardWell_impl.hpp index 6ab71868b..e420ea967 100644 --- a/opm/autodiff/StandardWell_impl.hpp +++ b/opm/autodiff/StandardWell_impl.hpp @@ -522,8 +522,10 @@ namespace Opm const int np = number_of_phases_; // clear all entries - duneB_ = 0.0; - duneC_ = 0.0; + if (!only_wells) { + duneB_ = 0.0; + duneC_ = 0.0; + } invDuneD_ = 0.0; resWell_ = 0.0;