From 1a3c1d30587cc3485c3ea78c2e27487c843d551f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Sun, 3 Jul 2016 08:00:59 +0200 Subject: [PATCH] Further templatized sequential model and simulator classes. Now the actual pressure and transport model classes are not specified, but taken as template template parameters, also grid and well model are templates for both the sequential model and the simulator class, although at this point only StandardWells is expected to work with the sequential model. --- examples/flow_sequential.cpp | 6 ++++- opm/autodiff/BlackoilSequentialModel.hpp | 8 ++++--- opm/autodiff/SimulatorSequentialBlackoil.hpp | 24 ++++++++++++-------- 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/examples/flow_sequential.cpp b/examples/flow_sequential.cpp index 0d4a89847..5eef64dad 100644 --- a/examples/flow_sequential.cpp +++ b/examples/flow_sequential.cpp @@ -25,6 +25,9 @@ #include #include #include +#include +#include +#include // ----------------- Main program ----------------- @@ -32,7 +35,8 @@ int main(int argc, char** argv) { typedef UnstructuredGrid Grid; - typedef Opm::SimulatorSequentialBlackoil Simulator; + typedef Opm::StandardWells WellModel; + typedef Opm::SimulatorSequentialBlackoil Simulator; Opm::FlowMainSequential mainfunc; return mainfunc.execute(argc, argv); diff --git a/opm/autodiff/BlackoilSequentialModel.hpp b/opm/autodiff/BlackoilSequentialModel.hpp index a9a479040..0c4820c05 100644 --- a/opm/autodiff/BlackoilSequentialModel.hpp +++ b/opm/autodiff/BlackoilSequentialModel.hpp @@ -23,8 +23,6 @@ #include -#include -#include #include #include #include @@ -44,7 +42,9 @@ namespace Opm { /// A sequential splitting model implementation for three-phase black oil. - template + template class PressureModelT, + template class TransportModelT> class BlackoilSequentialModel { public: @@ -297,6 +297,8 @@ namespace Opm { { return failureReport_; } protected: + typedef PressureModelT PressureModel; + typedef TransportModelT TransportModel; typedef NonlinearSolver PressureSolver; typedef NonlinearSolver TransportSolver; diff --git a/opm/autodiff/SimulatorSequentialBlackoil.hpp b/opm/autodiff/SimulatorSequentialBlackoil.hpp index 249d8b703..aed5c8383 100644 --- a/opm/autodiff/SimulatorSequentialBlackoil.hpp +++ b/opm/autodiff/SimulatorSequentialBlackoil.hpp @@ -24,32 +24,36 @@ #include #include #include -#include namespace Opm { -template +template class PressureModel, + template class TransportModel> class SimulatorSequentialBlackoil; -class StandardWells; -template -struct SimulatorTraits > +template class PressureModel, + template class TransportModel> +struct SimulatorTraits > { typedef WellStateFullyImplicitBlackoil WellState; typedef BlackoilState ReservoirState; typedef BlackoilOutputWriter OutputWriter; typedef GridT Grid; - typedef BlackoilSequentialModel Model; + typedef BlackoilSequentialModel Model; typedef NonlinearSolver Solver; - typedef StandardWells WellModel; + typedef WellModelT WellModel; }; /// a simulator for the blackoil model -template +template class PressureModel, + template class TransportModel> class SimulatorSequentialBlackoil - : public SimulatorBase > + : public SimulatorBase > { - typedef SimulatorBase > Base; + typedef SimulatorBase > Base; public: // forward the constructor to the base class SimulatorSequentialBlackoil(const ParameterGroup& param,