mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-01-07 23:13:01 -06:00
move EnableTerminalOutput parameter to TypeTag-free parameter system
This commit is contained in:
parent
296c8ef73d
commit
aab40a32e2
@ -122,10 +122,6 @@ struct LinearSolverBackend<TypeTag, TTag::FlowExpTypeTag> {
|
||||
|
||||
namespace Opm::Parameters {
|
||||
|
||||
template<class TypeTag>
|
||||
struct EnableTerminalOutput<TypeTag, Properties::TTag::FlowExpTypeTag>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
// currently, flowexp uses the non-multisegment well model by default to avoid
|
||||
// regressions. the --use-multisegment-well=true|false command line parameter is still
|
||||
// available in flowexp, but hidden from view.
|
||||
@ -168,7 +164,7 @@ public:
|
||||
ParentType::registerParameters();
|
||||
|
||||
BlackoilModelParameters<TypeTag>::registerParameters();
|
||||
Parameters::registerParam<TypeTag, Parameters::EnableTerminalOutput>("Do *NOT* use!");
|
||||
Parameters::Register<Parameters::EnableTerminalOutput>("Do *NOT* use!");
|
||||
Parameters::hideParam<TypeTag, Parameters::DbhpMaxRel>();
|
||||
Parameters::hideParam<TypeTag, Parameters::DwellFractionMax>();
|
||||
Parameters::hideParam<TypeTag, Parameters::MaxResidualAllowed>();
|
||||
@ -192,7 +188,7 @@ public:
|
||||
Parameters::hideParam<TypeTag, Parameters::UpdateEquationsScaling>();
|
||||
Parameters::hideParam<TypeTag, Parameters::UseUpdateStabilization>();
|
||||
Parameters::hideParam<TypeTag, Parameters::MatrixAddWellContributions>();
|
||||
Parameters::hideParam<TypeTag, Parameters::EnableTerminalOutput>();
|
||||
Parameters::Hide<Parameters::EnableTerminalOutput>();
|
||||
|
||||
// if openMP is available, set the default the number of threads per process for the main
|
||||
// simulation to 2 (instead of grabbing everything that is available).
|
||||
@ -209,6 +205,7 @@ public:
|
||||
Parameters::SetDefault<Parameters::EclNewtonRelaxedTolerance<Scalar>>(1e-1);
|
||||
Parameters::SetDefault<Parameters::EclNewtonRelaxedVolumeFraction<Scalar>>(0.0);
|
||||
Parameters::SetDefault<Parameters::EclNewtonSumTolerance<Scalar>>(1e-5);
|
||||
Parameters::SetDefault<Parameters::EnableTerminalOutput>(false);
|
||||
}
|
||||
|
||||
// inherit the constructors
|
||||
|
@ -378,7 +378,7 @@ private:
|
||||
int mpiRank = FlowGenericVanguard::comm().rank();
|
||||
outputCout_ = false;
|
||||
if (mpiRank == 0)
|
||||
outputCout_ = Parameters::get<PreTypeTag, Parameters::EnableTerminalOutput>();
|
||||
outputCout_ = Parameters::Get<Parameters::EnableTerminalOutput>();
|
||||
|
||||
if (deckFilename.empty()) {
|
||||
if (mpiRank == 0) {
|
||||
|
@ -85,10 +85,6 @@ template <class TypeTag>
|
||||
struct OutputExtraConvergenceInfo<TypeTag, Properties::TTag::FlowProblem>
|
||||
{ static constexpr auto* value = "none"; };
|
||||
|
||||
template<class TypeTag>
|
||||
struct EnableTerminalOutput<TypeTag, Properties::TTag::FlowProblem>
|
||||
{ static constexpr bool value = true; };
|
||||
|
||||
template <class TypeTag>
|
||||
struct SaveStep<TypeTag, Properties::TTag::FlowProblem>
|
||||
{ static constexpr auto* value = ""; };
|
||||
@ -171,7 +167,7 @@ public:
|
||||
// Only rank 0 does print to std::cout, and only if specifically requested.
|
||||
this->terminalOutput_ = false;
|
||||
if (this->grid().comm().rank() == 0) {
|
||||
this->terminalOutput_ = Parameters::get<TypeTag, Parameters::EnableTerminalOutput>();
|
||||
this->terminalOutput_ = Parameters::Get<Parameters::EnableTerminalOutput>();
|
||||
|
||||
this->startConvergenceOutputThread(Parameters::get<TypeTag, Parameters::OutputExtraConvergenceInfo>(),
|
||||
R"(OutputExtraConvergenceInfo (--output-extra-convergence-info))");
|
||||
@ -190,7 +186,7 @@ public:
|
||||
SolverParameters::registerParameters();
|
||||
TimeStepper::registerParameters();
|
||||
|
||||
Parameters::registerParam<TypeTag, Parameters::EnableTerminalOutput>
|
||||
Parameters::Register<Parameters::EnableTerminalOutput>
|
||||
("Print high-level information about the simulation's progress to the terminal");
|
||||
Parameters::registerParam<TypeTag, Parameters::EnableAdaptiveTimeStepping>
|
||||
("Use adaptive time stepping between report steps");
|
||||
|
@ -80,8 +80,7 @@
|
||||
|
||||
namespace Opm::Parameters {
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct EnableTerminalOutput { using type = Properties::UndefinedProperty; };
|
||||
struct EnableTerminalOutput { static constexpr bool value = true; };
|
||||
|
||||
} // namespace Opm::Parameters
|
||||
|
||||
|
@ -77,7 +77,7 @@ namespace Opm {
|
||||
, simulator_(simulator)
|
||||
{
|
||||
this->terminal_output_ = ((simulator.gridView().comm().rank() == 0) &&
|
||||
Parameters::get<TypeTag, Parameters::EnableTerminalOutput>());
|
||||
Parameters::Get<Parameters::EnableTerminalOutput>());
|
||||
|
||||
local_num_cells_ = simulator_.gridView().size(0);
|
||||
|
||||
|
@ -97,10 +97,6 @@ struct LinearSolverBackend<TTag::TestTypeTag, TTag::FlowIstlSolverParams> {
|
||||
|
||||
namespace Opm::Parameters {
|
||||
|
||||
template<class TypeTag>
|
||||
struct EnableTerminalOutput<TypeTag, Properties::TTag::TestTypeTag>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
// set some parameters that are only required by the well model
|
||||
template<class TypeTag>
|
||||
struct MatrixAddWellContributions<TypeTag, Properties::TTag::TestTypeTag>
|
||||
|
@ -514,7 +514,7 @@ struct AquiferFixture {
|
||||
Opm::ThreadManager<TT>::registerParameters();
|
||||
AdaptiveTimeStepping<TT>::registerParameters();
|
||||
BlackoilModelParameters<TT>::registerParameters();
|
||||
Parameters::registerParam<TT, Parameters::EnableTerminalOutput>("Do *NOT* use!");
|
||||
Parameters::Register<Parameters::EnableTerminalOutput>("Do *NOT* use!");
|
||||
setupParameters_<TT>(2, argv, /*registerParams=*/true);
|
||||
Opm::FlowGenericVanguard::setCommunication(std::make_unique<Opm::Parallel::Communication>());
|
||||
}
|
||||
|
@ -98,15 +98,6 @@ struct EnableVapwat<TypeTag, TTag::TestEquilVapwatTypeTag> {
|
||||
|
||||
} // namespace Opm::Properties
|
||||
|
||||
namespace Opm::Parameters {
|
||||
|
||||
template<class TypeTag>
|
||||
struct EnableTerminalOutput<TypeTag, Properties::TTag::FlowBaseProblem> {
|
||||
static constexpr bool value = true;
|
||||
};
|
||||
|
||||
} // namespace Opm::Parameters
|
||||
|
||||
template <class TypeTag>
|
||||
std::unique_ptr<Opm::GetPropType<TypeTag, Opm::Properties::Simulator>>
|
||||
initSimulator(const char *filename)
|
||||
@ -242,8 +233,7 @@ struct EquilFixture {
|
||||
Opm::ThreadManager<TypeTag>::registerParameters();
|
||||
BlackoilModelParameters<TypeTag>::registerParameters();
|
||||
AdaptiveTimeStepping<TypeTag>::registerParameters();
|
||||
Parameters::registerParam<TypeTag,
|
||||
Parameters::EnableTerminalOutput>("Dummy added for the well model to compile.");
|
||||
Parameters::Register<Parameters::EnableTerminalOutput>("Dummy added for the well model to compile.");
|
||||
registerAllParameters_<TypeTag>();
|
||||
}
|
||||
|
||||
|
@ -89,7 +89,7 @@ initSimulator(const char *filename)
|
||||
registerAllParameters_<TypeTag>(false);
|
||||
registerEclTimeSteppingParameters<TypeTag>();
|
||||
BlackoilModelParameters<TypeTag>::registerParameters();
|
||||
Parameters::registerParam<TypeTag, Parameters::EnableTerminalOutput>("Do *NOT* use!");
|
||||
Parameters::Register<Parameters::EnableTerminalOutput>("Do *NOT* use!");
|
||||
Opm::Parameters::SetDefault<Opm::Parameters::ThreadsPerProcess>(2);
|
||||
Parameters::endRegistration();
|
||||
setupParameters_<TypeTag>(/*argc=*/sizeof(argv) / sizeof(argv[0]),
|
||||
|
Loading…
Reference in New Issue
Block a user