From 707afc79eb6d6c4968ec29553f022920b3db19fa Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Sat, 6 Jul 2024 10:22:47 +0200 Subject: [PATCH] move SimulatorFullyImplicitBlackoil parameters to TypeTag-free parameter system --- opm/simulators/flow/FlowMain.hpp | 2 +- .../flow/SimulatorFullyImplicitBlackoil.hpp | 75 +++++-------------- 2 files changed, 21 insertions(+), 56 deletions(-) diff --git a/opm/simulators/flow/FlowMain.hpp b/opm/simulators/flow/FlowMain.hpp index d4bacfb6e..c1287724d 100644 --- a/opm/simulators/flow/FlowMain.hpp +++ b/opm/simulators/flow/FlowMain.hpp @@ -456,7 +456,7 @@ namespace Opm { printFlowTrailer(mpi_size_, threads, total_setup_time_, deck_read_time_, report, simulator_->model().localAccumulatedReports()); detail::handleExtraConvergenceOutput(report, - Parameters::get(), + Parameters::Get(), R"(OutputExtraConvergenceInfo (--output-extra-convergence-info))", eclState().getIOConfig().getOutputDir(), eclState().getIOConfig().getBaseName()); diff --git a/opm/simulators/flow/SimulatorFullyImplicitBlackoil.hpp b/opm/simulators/flow/SimulatorFullyImplicitBlackoil.hpp index 93f4d5610..f25ce2584 100644 --- a/opm/simulators/flow/SimulatorFullyImplicitBlackoil.hpp +++ b/opm/simulators/flow/SimulatorFullyImplicitBlackoil.hpp @@ -59,47 +59,12 @@ namespace Opm::Parameters { -template -struct EnableAdaptiveTimeStepping { using type = Properties::UndefinedProperty; }; - -template -struct OutputExtraConvergenceInfo { using type = Properties::UndefinedProperty; }; - -template -struct SaveStep { using type = Properties::UndefinedProperty; }; - -template -struct LoadStep { using type = Properties::UndefinedProperty; }; - -template -struct SaveFile { using type = Properties::UndefinedProperty; }; - -template -struct LoadFile { using type = Properties::UndefinedProperty; }; - -template -struct EnableAdaptiveTimeStepping -{ static constexpr bool value = true; }; - -template -struct OutputExtraConvergenceInfo -{ static constexpr auto* value = "none"; }; - -template -struct SaveStep -{ static constexpr auto* value = ""; }; - -template -struct SaveFile -{ static constexpr auto* value = ""; }; - -template -struct LoadFile -{ static constexpr auto* value = ""; }; - -template -struct LoadStep -{ static constexpr int value = -1; }; +struct EnableAdaptiveTimeStepping { static constexpr bool value = true; }; +struct OutputExtraConvergenceInfo { static constexpr auto* value = "none"; }; +struct SaveStep { static constexpr auto* value = ""; }; +struct SaveFile { static constexpr auto* value = ""; }; +struct LoadFile { static constexpr auto* value = ""; }; +struct LoadStep { static constexpr int value = -1; }; } // namespace Opm::Parameters @@ -157,10 +122,10 @@ public: , serializer_(*this, FlowGenericVanguard::comm(), simulator_.vanguard().eclState().getIOConfig(), - Parameters::get(), - Parameters::get(), - Parameters::get(), - Parameters::get()) + Parameters::Get(), + Parameters::Get(), + Parameters::Get(), + Parameters::Get()) { phaseUsage_ = phaseUsageFromDeck(eclState()); @@ -169,7 +134,7 @@ public: if (this->grid().comm().rank() == 0) { this->terminalOutput_ = Parameters::Get(); - this->startConvergenceOutputThread(Parameters::get(), + this->startConvergenceOutputThread(Parameters::Get(), R"(OutputExtraConvergenceInfo (--output-extra-convergence-info))"); } } @@ -188,9 +153,9 @@ public: Parameters::Register ("Print high-level information about the simulation's progress to the terminal"); - Parameters::registerParam + Parameters::Register ("Use adaptive time stepping between report steps"); - Parameters::registerParam + Parameters::Register ("Provide additional convergence output " "files for diagnostic purposes. " "\"none\" gives no extra output and " @@ -199,25 +164,25 @@ public: "\"iterations\" generates an INFOITER file. " "Combine options with commas, e.g., " "\"steps,iterations\" for multiple outputs."); - Parameters::registerParam + Parameters::Register ("Save serialized state to .OPMRST file. " "Either a specific report step, \"all\" to save " "all report steps or \":x\" to save every x'th step." "Use negative values of \"x\" to keep only the last " "written step, or \"last\" to save every step, keeping " "only the last."); - Parameters::registerParam + Parameters::Register ("Load serialized state from .OPMRST file. " "Either a specific report step, or 0 to load last " "stored report step."); - Parameters::registerParam + Parameters::Register ("FileName for .OPMRST file used for saving serialized state. " "If empty, CASENAME.OPMRST is used."); - Parameters::hideParam(); - Parameters::registerParam + Parameters::Hide(); + Parameters::Register ("FileName for .OPMRST file used to load serialized state. " "If empty, CASENAME.OPMRST is used."); - Parameters::hideParam(); + Parameters::Hide(); } /// Run the simulation. @@ -249,7 +214,7 @@ public: totalTimer_->start(); // adaptive time stepping - bool enableAdaptive = Parameters::get(); + bool enableAdaptive = Parameters::Get(); bool enableTUNING = Parameters::get(); if (enableAdaptive) { const UnitSystem& unitSystem = this->simulator_.vanguard().eclState().getUnits();