Remove property tree parameter from PreconditionerWithUpdate::update

It is not used, needed parameters can stored in the constructor, and
it made de design a bit suboptimal.
This commit is contained in:
Markus Blatt 2020-03-24 10:29:36 +01:00
parent 70cff4b342
commit 95a1e1ca0e
7 changed files with 11 additions and 18 deletions

View File

@ -192,7 +192,7 @@ public:
}
rhs_ = b;
} else {
solver_->preconditioner().update(weights, prm_.get_child("preconditioner"));
solver_->preconditioner().update(weights);
rhs_ = b;
}
}

View File

@ -63,9 +63,9 @@ public:
}
// The update() function does nothing for a wrapped preconditioner.
virtual void update(const X& w,const boost::property_tree::ptree& pt) override
virtual void update(const X& w) override
{
orig_precond_.update(w, pt);
orig_precond_.update(w);
}
private:

View File

@ -161,15 +161,9 @@ public:
twolevel_method_.post(x);
}
virtual void update(const VectorType& weights, const boost::property_tree::ptree& /*prm*/) override
virtual void update(const VectorType& weights) override
{
// if(prm.get<std::string>("weight_type") == "quasiimpes"){
// Opm::Amg::getQuasiImpesWeights<MatrixType, VectorType>(
// linear_operator_.getmat(), prm_.get<int>("pressure_var_index"), transpose, weights_);
// weights_ = prm.get<VectorType>("weights");
// }else{
weights_ = weights;
//}
weights_ = weights;
updateImpl(comm_);
}

View File

@ -921,7 +921,7 @@ public:
DUNE_UNUSED_PARAMETER(x);
}
virtual void update(const Range& = Range(), const boost::property_tree::ptree& = boost::property_tree::ptree()) override
virtual void update(const Range& = Range()) override
{
// (For older DUNE versions the communicator might be
// invalid if redistribution in AMG happened on the coarset level.

View File

@ -31,7 +31,7 @@ template <class X, class Y>
class PreconditionerWithUpdate : public Preconditioner<X, Y>
{
public:
virtual void update(const X& w, const boost::property_tree::ptree& pt) = 0;
virtual void update(const X& w) = 0;
};
template <class OriginalPreconditioner>
@ -69,7 +69,7 @@ public:
}
// The update() function does nothing for a wrapped preconditioner.
virtual void update(const X& /*w*/, const boost::property_tree::ptree& /*pt*/) override
virtual void update(const X& /*w*/) override
{
}

View File

@ -84,9 +84,8 @@ namespace Amg
void updatePreconditioner()
{
pt::ptree prm;
X w;
linsolver_->preconditioner().update(w, prm);
linsolver_->preconditioner().update(w);
}
private:

View File

@ -239,7 +239,7 @@ namespace Dune
/**
* @brief Update the coarse solver and the hierarchies.
*/
virtual void update(const X& w, const boost::property_tree::ptree& prm);
virtual void update(const X& w);
virtual void update();
/**
@ -470,7 +470,7 @@ namespace Dune
}
template<class M, class X, class S, class PI, class A>
void AMGCPR<M,X,S,PI,A>::update(const X& /*w*/, const boost::property_tree::ptree& /*prm*/)
void AMGCPR<M,X,S,PI,A>::update(const X& /*w*/)
{
update();
}