diff --git a/opm/autodiff/BlackoilAmgCpr.hpp b/opm/autodiff/BlackoilAmgCpr.hpp index d3f61d3933..ae6ece9763 100644 --- a/opm/autodiff/BlackoilAmgCpr.hpp +++ b/opm/autodiff/BlackoilAmgCpr.hpp @@ -136,12 +136,10 @@ namespace Opm { } - void updatePreconditioner(const typename TwoLevelMethod::FineDomainType& weights, - const Operator& fineOperator, + void updatePreconditioner(const Operator& fineOperator, const SmootherArgs& smargs, const Communication& comm) { - weights_ = weights; *scaledMatrix_ = *Detail::scaleMatrixDRS(fineOperator, COMPONENT_INDEX, weights_, param_); smoother_.reset(Detail::constructSmoother(*scaledMatrixOperator_, smargs, comm)); twoLevelMethod_.updatePreconditioner(*scaledMatrixOperator_, @@ -170,7 +168,7 @@ namespace Opm private: const CPRParameter& param_; - typename TwoLevelMethod::FineDomainType weights_; //make copy + const typename TwoLevelMethod::FineDomainType& weights_; std::unique_ptr scaledMatrix_; std::unique_ptr scaledMatrixOperator_; std::shared_ptr smoother_; diff --git a/opm/autodiff/ISTLSolverEbosCpr.hpp b/opm/autodiff/ISTLSolverEbosCpr.hpp index ec38787382..9b38d785ac 100644 --- a/opm/autodiff/ISTLSolverEbosCpr.hpp +++ b/opm/autodiff/ISTLSolverEbosCpr.hpp @@ -268,7 +268,7 @@ namespace Opm if(this->parameters_.cpr_solver_verbose_){ std::cout << " Only update amg solver " << std::endl; } - amg_->updatePreconditioner(this->weights_,opARef, smootherArgs, comm); + amg_->updatePreconditioner(opARef, smootherArgs, comm); } // Solve. //SuperClass::solve(linearOperator, x, istlb, *sp, *amg, result);