diff --git a/opm/simulators/flow/FlowMain.hpp b/opm/simulators/flow/FlowMain.hpp index c1287724d..f9a391ef4 100644 --- a/opm/simulators/flow/FlowMain.hpp +++ b/opm/simulators/flow/FlowMain.hpp @@ -103,91 +103,18 @@ namespace Opm { // register the base parameters registerAllParameters_(/*finalizeRegistration=*/false); - // hide the parameters unused by flow. TODO: this is a pain to maintain - Parameters::Hide(); - Parameters::Hide(); - - // this parameter is actually used in eWoms, but the flow well model - // hard-codes the assumption that the intensive quantities cache is enabled, - // so flow crashes. Let's hide the parameter for that reason. - Parameters::Hide(); - - // thermodynamic hints are not implemented/required by the eWoms blackoil - // model - Parameters::Hide(); - - // in flow only the deck file determines the end time of the simulation - Parameters::Hide>(); - - // time stepping is not done by the eWoms code in flow - Parameters::Hide>(); - Parameters::Hide(); - Parameters::Hide>(); - Parameters::Hide>(); - Parameters::Hide(); - - // flow also does not use the eWoms Newton method - Parameters::Hide>(); - Parameters::Hide>(); - Parameters::Hide(); - Parameters::Hide(); - Parameters::Hide(); - - // the default eWoms checkpoint/restart mechanism does not work with flow - Parameters::Hide>(); - Parameters::Hide(); - // hide all vtk related it is not currently possible to do this dependet on if the vtk writing is used - //if(not(Parameters::Get())){ - Parameters::Hide(); - Parameters::Hide(); - Parameters::Hide(); - Parameters::Hide(); - Parameters::Hide(); - Parameters::Hide(); - Parameters::Hide(); - Parameters::Hide(); - Parameters::Hide(); - Parameters::Hide(); - Parameters::Hide(); - Parameters::Hide(); - Parameters::Hide(); - Parameters::Hide(); - Parameters::Hide(); - Parameters::Hide(); - Parameters::Hide(); - Parameters::Hide(); - Parameters::Hide(); - Parameters::Hide(); - Parameters::Hide(); - Parameters::Hide(); - Parameters::Hide(); - Parameters::Hide(); - Parameters::Hide(); - Parameters::Hide(); - Parameters::Hide(); - //} - Parameters::Hide(); - Parameters::Hide(); - Parameters::Hide(); - Parameters::Hide(); - Parameters::Hide(); - Parameters::Hide(); - Parameters::Hide(); - Parameters::Hide(); - - Parameters::Hide(); - Parameters::Hide(); - Parameters::Hide(); - - // hide average density option - Parameters::Hide(); + detail::hideUnusedParameters(); Parameters::endRegistration(); int mpiRank = comm.rank(); // read in the command line parameters - int status = ::Opm::setupParameters_(argc, const_cast(argv), /*doRegistration=*/false, /*allowUnused=*/true, /*handleHelp=*/(mpiRank==0)); + int status = ::Opm::setupParameters_(argc, + const_cast(argv), + /*doRegistration=*/false, + /*allowUnused=*/true, + /*handleHelp=*/(mpiRank==0)); if (status == 0) { // deal with unknown parameters. diff --git a/opm/simulators/flow/FlowUtils.cpp b/opm/simulators/flow/FlowUtils.cpp index fd66df829..135ac1005 100644 --- a/opm/simulators/flow/FlowUtils.cpp +++ b/opm/simulators/flow/FlowUtils.cpp @@ -20,12 +20,27 @@ along with OPM. If not, see . */ +#include "opm/simulators/flow/BlackoilModelParameters.hpp" +#include "opm/simulators/flow/FlowProblemParameters.hpp" +#include "opm/simulators/flow/VtkTracerModule.hpp" #include #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include #include #include @@ -164,4 +179,89 @@ void checkAllMPIProcesses() #endif } +template +void hideUnusedParameters() +{ + // hide the parameters unused by flow. TODO: this is a pain to maintain + Parameters::Hide(); + Parameters::Hide(); + + // this parameter is actually used in eWoms, but the flow well model + // hard-codes the assumption that the intensive quantities cache is enabled, + // so flow crashes. Let's hide the parameter for that reason. + Parameters::Hide(); + + // thermodynamic hints are not implemented/required by the eWoms blackoil + // model + Parameters::Hide(); + + // in flow only the deck file determines the end time of the simulation + Parameters::Hide>(); + + // time stepping is not done by the eWoms code in flow + Parameters::Hide>(); + Parameters::Hide(); + Parameters::Hide>(); + Parameters::Hide>(); + Parameters::Hide(); + + // flow also does not use the eWoms Newton method + Parameters::Hide>(); + Parameters::Hide>(); + Parameters::Hide(); + Parameters::Hide(); + Parameters::Hide(); + + // the default eWoms checkpoint/restart mechanism does not work with flow + Parameters::Hide>(); + Parameters::Hide(); + // hide all vtk related it is not currently possible to do this dependet on if the vtk writing is used + //if(not(Parameters::Get())){ + Parameters::Hide(); + Parameters::Hide(); + Parameters::Hide(); + Parameters::Hide(); + Parameters::Hide(); + Parameters::Hide(); + Parameters::Hide(); + Parameters::Hide(); + Parameters::Hide(); + Parameters::Hide(); + Parameters::Hide(); + Parameters::Hide(); + Parameters::Hide(); + Parameters::Hide(); + Parameters::Hide(); + Parameters::Hide(); + Parameters::Hide(); + Parameters::Hide(); + Parameters::Hide(); + Parameters::Hide(); + Parameters::Hide(); + Parameters::Hide(); + Parameters::Hide(); + Parameters::Hide(); + Parameters::Hide(); + Parameters::Hide(); + Parameters::Hide(); + //} + Parameters::Hide(); + Parameters::Hide(); + Parameters::Hide(); + Parameters::Hide(); + Parameters::Hide(); + Parameters::Hide(); + Parameters::Hide(); + Parameters::Hide(); + + Parameters::Hide(); + Parameters::Hide(); + Parameters::Hide(); + + // hide average density option + Parameters::Hide(); +} + +template void hideUnusedParameters(); + } // namespace Opm::detail diff --git a/opm/simulators/flow/FlowUtils.hpp b/opm/simulators/flow/FlowUtils.hpp index 1e6bc0874..ab8d00c05 100644 --- a/opm/simulators/flow/FlowUtils.hpp +++ b/opm/simulators/flow/FlowUtils.hpp @@ -40,6 +40,10 @@ void handleExtraConvergenceOutput(SimulatorReport& report, std::string_view output_dir, std::string_view base_name); +//! \brief Hides unused runtime parameters. +template +void hideUnusedParameters(); + } // namespace Opm::detail #endif // OPM_FLOW_UTILS_HEADER_INCLUDED