mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-09-05 04:40:19 -05:00
Move PreconditionerFactory into namespace Opm.
This fixes name clashes with DUNE's own factory that is introduced in DUNE 2.7. Hence it closes issue #2266. BTW: Dune's factory has more template parameters than ours.
This commit is contained in:
@@ -96,7 +96,7 @@ private:
|
||||
auto linop = std::make_shared<ParOperatorType>(matrix, comm);
|
||||
linearoperator_ = linop;
|
||||
preconditioner_
|
||||
= Dune::PreconditionerFactory<ParOperatorType, Comm>::create(*linop, prm.get_child("preconditioner"), comm);
|
||||
= Opm::PreconditionerFactory<ParOperatorType, Comm>::create(*linop, prm.get_child("preconditioner"), comm);
|
||||
scalarproduct_ = Dune::createScalarProduct<VectorType, Comm>(comm, linearoperator_->category());
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ private:
|
||||
using SeqOperatorType = Dune::MatrixAdapter<MatrixType, VectorType, VectorType>;
|
||||
auto linop = std::make_shared<SeqOperatorType>(matrix);
|
||||
linearoperator_ = linop;
|
||||
preconditioner_ = Dune::PreconditionerFactory<SeqOperatorType>::create(*linop, prm.get_child("preconditioner"));
|
||||
preconditioner_ = Opm::PreconditionerFactory<SeqOperatorType>::create(*linop, prm.get_child("preconditioner"));
|
||||
scalarproduct_ = std::make_shared<Dune::SeqScalarProduct<VectorType>>();
|
||||
}
|
||||
|
||||
|
||||
@@ -35,14 +35,18 @@
|
||||
#include <fstream>
|
||||
#include <type_traits>
|
||||
|
||||
namespace Dune
|
||||
{
|
||||
|
||||
namespace Opm
|
||||
{
|
||||
// Circular dependency between PreconditionerFactory [which can make an OwningTwoLevelPreconditioner]
|
||||
// and OwningTwoLevelPreconditioner [which uses PreconditionerFactory to choose the fine-level smoother]
|
||||
// must be broken, accomplished by forward-declaration here.
|
||||
template <class Operator, class Comm = Dune::Amg::SequentialInformation>
|
||||
class PreconditionerFactory;
|
||||
}
|
||||
|
||||
namespace Dune
|
||||
{
|
||||
|
||||
|
||||
// Must forward-declare FlexibleSolver as we want to use it as solver for the pressure system.
|
||||
@@ -63,7 +67,7 @@ class OwningTwoLevelPreconditioner : public Dune::PreconditionerWithUpdate<Vecto
|
||||
public:
|
||||
using pt = boost::property_tree::ptree;
|
||||
using MatrixType = typename OperatorType::matrix_type;
|
||||
using PrecFactory = PreconditionerFactory<OperatorType, Communication>;
|
||||
using PrecFactory = Opm::PreconditionerFactory<OperatorType, Communication>;
|
||||
|
||||
OwningTwoLevelPreconditioner(const OperatorType& linearoperator, const pt& prm)
|
||||
: linear_operator_(linearoperator)
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include <map>
|
||||
#include <memory>
|
||||
|
||||
namespace Dune
|
||||
namespace Opm
|
||||
{
|
||||
|
||||
/// This is an object factory for creating preconditioners. The
|
||||
|
||||
Reference in New Issue
Block a user