diff --git a/opm/autodiff/BlackoilAmg.hpp b/opm/autodiff/BlackoilAmg.hpp index d1030b949..e6072d312 100644 --- a/opm/autodiff/BlackoilAmg.hpp +++ b/opm/autodiff/BlackoilAmg.hpp @@ -615,15 +615,17 @@ public: typedef Communication ParallelInformation; public: - OneComponentAggregationLevelTransferPolicy(const Criterion& crit, const Communication& comm) - : criterion_(crit), communication_(&const_cast(comm)), use_aggregation_(false) + OneComponentAggregationLevelTransferPolicy(const Criterion& crit, const Communication& comm, + bool cpr_pressure_aggregation) + : criterion_(crit), communication_(&const_cast(comm)), + cpr_pressure_aggregation_(cpr_pressure_aggregation) {} void createCoarseLevelSystem(const Operator& fineOperator) { prolongDamp_ = 1; - if ( use_aggregation_ ) + if ( cpr_pressure_aggregation_ ) { #if DUNE_VERSION_NEWER(DUNE_ISTL, 2, 6) typedef Dune::Amg::PropertiesGraphCreator GraphCreator; @@ -755,7 +757,7 @@ public: // Set coarse vector to zero this->rhs_=0; - if ( use_aggregation_ ) + if ( cpr_pressure_aggregation_ ) { auto end = fine.end(), begin=fine.begin(); @@ -783,7 +785,7 @@ public: void moveToFineLevel(typename FatherType::FineDomainType& fine) { - if( use_aggregation_ ) + if( cpr_pressure_aggregation_ ) { this->lhs_ *= prolongDamp_; auto end=fine.end(), begin=fine.begin(); @@ -823,7 +825,7 @@ private: Communication* communication_; std::shared_ptr coarseLevelCommunication_; std::shared_ptr coarseLevelMatrix_; - bool use_aggregation_; + bool cpr_pressure_aggregation_; }; template(std::get<1>(scaledMatrixOperator_), smargs, comm)), - levelTransferPolicy_(criterion, comm), + levelTransferPolicy_(criterion, comm, param.cpr_pressure_aggregation_), coarseSolverPolicy_(¶m, smargs, criterion), twoLevelMethod_(std::get<1>(scaledMatrixOperator_), smoother_, levelTransferPolicy_, diff --git a/opm/autodiff/CPRPreconditioner.hpp b/opm/autodiff/CPRPreconditioner.hpp index 7df676d4f..b95f9959b 100644 --- a/opm/autodiff/CPRPreconditioner.hpp +++ b/opm/autodiff/CPRPreconditioner.hpp @@ -240,6 +240,7 @@ createAMGPreconditionerPointer( Op& opA, const double relax, const P& comm, std: bool cpr_use_amg_; bool cpr_use_bicgstab_; bool cpr_solver_verbose_; + bool cpr_pressure_aggregation_; CPRParameter() { reset(); } @@ -255,6 +256,7 @@ createAMGPreconditionerPointer( Op& opA, const double relax, const P& comm, std: cpr_use_amg_ = param.getDefault("cpr_use_amg", cpr_use_amg_); cpr_use_bicgstab_ = param.getDefault("cpr_use_bicgstab", cpr_use_bicgstab_); cpr_solver_verbose_ = param.getDefault("cpr_solver_verbose", cpr_solver_verbose_); + cpr_pressure_aggregation_ = param.getDefault("cpr_pressure_aggregation", cpr_pressure_aggregation_); } void reset() @@ -266,6 +268,7 @@ createAMGPreconditionerPointer( Op& opA, const double relax, const P& comm, std: cpr_use_amg_ = true; cpr_use_bicgstab_ = true; cpr_solver_verbose_ = false; + cpr_pressure_aggregation_ = false; } };