Split constructor to reduce instantiation.

Without the split, certain combinations with Dune::Amg::SequentialInformation
as template argument for Comm needlessly get instantiated.
This commit is contained in:
Atgeirr Flø Rasmussen 2020-06-18 08:28:20 +02:00
parent 3784ab9d77
commit dcd5d21415

View File

@ -60,12 +60,16 @@ namespace Amg
PressureInverseOperator(Operator& op, const boost::property_tree::ptree& prm, const Comm& comm) PressureInverseOperator(Operator& op, const boost::property_tree::ptree& prm, const Comm& comm)
: linsolver_() : linsolver_()
{ {
if (op.category() == Dune::SolverCategory::overlapping) { assert(op.category() == Dune::SolverCategory::overlapping);
linsolver_.reset(new Solver(op.getmat(), comm, prm, std::function<X()>())); linsolver_.reset(new Solver(op.getmat(), comm, prm, std::function<X()>()));
} else {
linsolver_.reset(new Solver(op.getmat(), prm, std::function<X()>()));
}
} }
PressureInverseOperator(Operator& op, const boost::property_tree::ptree& prm, const SequentialInformation&)
: linsolver_()
{
assert(op.category() != Dune::SolverCategory::overlapping);
linsolver_.reset(new Solver(op.getmat(), prm, std::function<X()>()));
}
Dune::SolverCategory::Category category() const override Dune::SolverCategory::Category category() const override
{ {