From 0161d696609bc7c5c0b9615ddb6a4d58c6937f8a Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Fri, 5 Apr 2024 12:53:20 +0200 Subject: [PATCH] adjust to removal of EWOMS_GET_PARAM --- .../flow/BlackoilModelParameters.hpp | 100 +++++++++--------- opm/simulators/flow/DamarisWriter.hpp | 4 +- opm/simulators/flow/EclWriter.hpp | 10 +- opm/simulators/flow/FlowBaseVanguard.hpp | 28 ++--- opm/simulators/flow/FlowMain.hpp | 16 +-- opm/simulators/flow/FlowProblem.hpp | 31 +++--- opm/simulators/flow/Main.hpp | 20 ++-- opm/simulators/flow/NonlinearSolver.hpp | 8 +- opm/simulators/flow/OutputBlackoilModule.hpp | 6 +- .../flow/SimulatorFullyImplicitBlackoil.hpp | 19 ++-- opm/simulators/flow/VtkTracerModule.hpp | 4 +- .../linalg/FlowLinearSolverParameters.hpp | 44 ++++---- opm/simulators/linalg/ISTLSolver.hpp | 6 +- opm/simulators/linalg/ISTLSolverBda.hpp | 16 +-- .../timestepping/AdaptiveTimeStepping.hpp | 70 ++++++------ opm/simulators/utils/DamarisKeywords.hpp | 24 ++--- .../wells/BlackoilWellModel_impl.hpp | 4 +- 17 files changed, 206 insertions(+), 204 deletions(-) diff --git a/opm/simulators/flow/BlackoilModelParameters.hpp b/opm/simulators/flow/BlackoilModelParameters.hpp index 6f3408cc9..91c4b90a9 100644 --- a/opm/simulators/flow/BlackoilModelParameters.hpp +++ b/opm/simulators/flow/BlackoilModelParameters.hpp @@ -619,44 +619,44 @@ namespace Opm /// Construct from user parameters or defaults. BlackoilModelParameters() { - dbhp_max_rel_= EWOMS_GET_PARAM(TypeTag, Scalar, DbhpMaxRel); - dwell_fraction_max_ = EWOMS_GET_PARAM(TypeTag, Scalar, DwellFractionMax); - max_residual_allowed_ = EWOMS_GET_PARAM(TypeTag, Scalar, MaxResidualAllowed); - relaxed_max_pv_fraction_ = EWOMS_GET_PARAM(TypeTag, Scalar, RelaxedMaxPvFraction); - tolerance_mb_ = EWOMS_GET_PARAM(TypeTag, Scalar, ToleranceMb); - tolerance_mb_relaxed_ = EWOMS_GET_PARAM(TypeTag, Scalar, ToleranceMbRelaxed); - tolerance_cnv_ = EWOMS_GET_PARAM(TypeTag, Scalar, ToleranceCnv); - tolerance_cnv_relaxed_ = EWOMS_GET_PARAM(TypeTag, Scalar, ToleranceCnvRelaxed); - tolerance_wells_ = EWOMS_GET_PARAM(TypeTag, Scalar, ToleranceWells); - tolerance_well_control_ = EWOMS_GET_PARAM(TypeTag, Scalar, ToleranceWellControl); - max_welleq_iter_ = EWOMS_GET_PARAM(TypeTag, int, MaxWelleqIter); - use_multisegment_well_ = EWOMS_GET_PARAM(TypeTag, bool, UseMultisegmentWell); - tolerance_pressure_ms_wells_ = EWOMS_GET_PARAM(TypeTag, Scalar, TolerancePressureMsWells); - relaxed_tolerance_flow_well_ = EWOMS_GET_PARAM(TypeTag, Scalar, RelaxedWellFlowTol); - relaxed_tolerance_pressure_ms_well_ = EWOMS_GET_PARAM(TypeTag, Scalar, RelaxedPressureTolMsw); - max_pressure_change_ms_wells_ = EWOMS_GET_PARAM(TypeTag, Scalar, MaxPressureChangeMsWells); - max_inner_iter_ms_wells_ = EWOMS_GET_PARAM(TypeTag, int, MaxInnerIterMsWells); - strict_inner_iter_wells_ = EWOMS_GET_PARAM(TypeTag, int, StrictInnerIterWells); - strict_outer_iter_wells_ = EWOMS_GET_PARAM(TypeTag, int, StrictOuterIterWells); - regularization_factor_wells_ = EWOMS_GET_PARAM(TypeTag, Scalar, RegularizationFactorWells); - max_niter_inner_well_iter_ = EWOMS_GET_PARAM(TypeTag, int, MaxNewtonIterationsWithInnerWellIterations); - shut_unsolvable_wells_ = EWOMS_GET_PARAM(TypeTag, bool, ShutUnsolvableWells); - max_inner_iter_wells_ = EWOMS_GET_PARAM(TypeTag, int, MaxInnerIterWells); - maxSinglePrecisionTimeStep_ = EWOMS_GET_PARAM(TypeTag, Scalar, MaxSinglePrecisionDays) *24*60*60; - min_strict_cnv_iter_ = EWOMS_GET_PARAM(TypeTag, int, MinStrictCnvIter); - min_strict_mb_iter_ = EWOMS_GET_PARAM(TypeTag, int, MinStrictMbIter); - solve_welleq_initially_ = EWOMS_GET_PARAM(TypeTag, bool, SolveWelleqInitially); - update_equations_scaling_ = EWOMS_GET_PARAM(TypeTag, bool, UpdateEquationsScaling); - use_update_stabilization_ = EWOMS_GET_PARAM(TypeTag, bool, UseUpdateStabilization); - matrix_add_well_contributions_ = EWOMS_GET_PARAM(TypeTag, bool, MatrixAddWellContributions); - check_well_operability_ = EWOMS_GET_PARAM(TypeTag, bool, EnableWellOperabilityCheck); - check_well_operability_iter_ = EWOMS_GET_PARAM(TypeTag, bool, EnableWellOperabilityCheckIter); - max_number_of_well_switches_ = EWOMS_GET_PARAM(TypeTag, int, MaximumNumberOfWellSwitches); - use_average_density_ms_wells_ = EWOMS_GET_PARAM(TypeTag, bool, UseAverageDensityMsWells); - local_well_solver_control_switching_ = EWOMS_GET_PARAM(TypeTag, bool, LocalWellSolveControlSwitching); - use_implicit_ipr_ = EWOMS_GET_PARAM(TypeTag, bool, UseImplicitIpr); - nonlinear_solver_ = EWOMS_GET_PARAM(TypeTag, std::string, NonlinearSolver); - const auto approach = EWOMS_GET_PARAM(TypeTag, std::string, LocalSolveApproach); + dbhp_max_rel_= Parameters::get(); + dwell_fraction_max_ = Parameters::get(); + max_residual_allowed_ = Parameters::get(); + relaxed_max_pv_fraction_ = Parameters::get(); + tolerance_mb_ = Parameters::get(); + tolerance_mb_relaxed_ = Parameters::get(); + tolerance_cnv_ = Parameters::get(); + tolerance_cnv_relaxed_ = Parameters::get(); + tolerance_wells_ = Parameters::get(); + tolerance_well_control_ = Parameters::get(); + max_welleq_iter_ = Parameters::get(); + use_multisegment_well_ = Parameters::get(); + tolerance_pressure_ms_wells_ = Parameters::get(); + relaxed_tolerance_flow_well_ = Parameters::get(); + relaxed_tolerance_pressure_ms_well_ = Parameters::get(); + max_pressure_change_ms_wells_ = Parameters::get(); + max_inner_iter_ms_wells_ = Parameters::get(); + strict_inner_iter_wells_ = Parameters::get(); + strict_outer_iter_wells_ = Parameters::get(); + regularization_factor_wells_ = Parameters::get(); + max_niter_inner_well_iter_ = Parameters::get(); + shut_unsolvable_wells_ = Parameters::get(); + max_inner_iter_wells_ = Parameters::get(); + maxSinglePrecisionTimeStep_ = Parameters::get() * 24 * 60 * 60; + min_strict_cnv_iter_ = Parameters::get(); + min_strict_mb_iter_ = Parameters::get(); + solve_welleq_initially_ = Parameters::get(); + update_equations_scaling_ = Parameters::get(); + use_update_stabilization_ = Parameters::get(); + matrix_add_well_contributions_ = Parameters::get(); + check_well_operability_ = Parameters::get(); + check_well_operability_iter_ = Parameters::get(); + max_number_of_well_switches_ = Parameters::get(); + use_average_density_ms_wells_ = Parameters::get(); + local_well_solver_control_switching_ = Parameters::get(); + use_implicit_ipr_ = Parameters::get(); + nonlinear_solver_ = Parameters::get(); + const auto approach = Parameters::get(); if (approach == "jacobi") { local_solve_approach_ = DomainSolveApproach::Jacobi; } else if (approach == "gauss-seidel") { @@ -665,18 +665,18 @@ namespace Opm throw std::runtime_error("Invalid domain solver approach '" + approach + "' specified."); } - max_local_solve_iterations_ = EWOMS_GET_PARAM(TypeTag, int, MaxLocalSolveIterations); - local_tolerance_scaling_mb_ = EWOMS_GET_PARAM(TypeTag, double, LocalToleranceScalingMb); - local_tolerance_scaling_cnv_ = EWOMS_GET_PARAM(TypeTag, double, LocalToleranceScalingCnv); - nldd_num_initial_newton_iter_ = EWOMS_GET_PARAM(TypeTag, int, NlddNumInitialNewtonIter); - num_local_domains_ = EWOMS_GET_PARAM(TypeTag, int, NumLocalDomains); - local_domain_partition_imbalance_ = std::max(1.0, EWOMS_GET_PARAM(TypeTag, double, LocalDomainsPartitioningImbalance)); - local_domain_partition_method_ = EWOMS_GET_PARAM(TypeTag, std::string, LocalDomainsPartitioningMethod); - deck_file_name_ = EWOMS_GET_PARAM(TypeTag, std::string, EclDeckFileName); - network_max_strict_iterations_ = EWOMS_GET_PARAM(TypeTag, int, NetworkMaxStrictIterations); - network_max_iterations_ = EWOMS_GET_PARAM(TypeTag, int, NetworkMaxIterations); - local_domain_ordering_ = domainOrderingMeasureFromString(EWOMS_GET_PARAM(TypeTag, std::string, LocalDomainsOrderingMeasure)); - write_partitions_ = EWOMS_GET_PARAM(TypeTag, bool, DebugEmitCellPartition); + max_local_solve_iterations_ = Parameters::get(); + local_tolerance_scaling_mb_ = Parameters::get(); + local_tolerance_scaling_cnv_ = Parameters::get(); + nldd_num_initial_newton_iter_ = Parameters::get(); + num_local_domains_ = Parameters::get(); + local_domain_partition_imbalance_ = std::max(1.0, Parameters::get()); + local_domain_partition_method_ = Parameters::get(); + deck_file_name_ = Parameters::get(); + network_max_strict_iterations_ = Parameters::get(); + network_max_iterations_ = Parameters::get(); + local_domain_ordering_ = domainOrderingMeasureFromString(Parameters::get()); + write_partitions_ = Parameters::get(); } static void registerParameters() diff --git a/opm/simulators/flow/DamarisWriter.hpp b/opm/simulators/flow/DamarisWriter.hpp index a09670426..de1014cd2 100644 --- a/opm/simulators/flow/DamarisWriter.hpp +++ b/opm/simulators/flow/DamarisWriter.hpp @@ -283,8 +283,8 @@ private: bool damarisUpdate_ = false; ///< Whenever this is true writeOutput() will set up Damaris mesh information and offsets of model fields static bool enableDamarisOutput_() - { - return EWOMS_GET_PARAM(TypeTag, bool, EnableDamarisOutput); + { + return Parameters::get(); } void setGlobalIndexForDamaris () diff --git a/opm/simulators/flow/EclWriter.hpp b/opm/simulators/flow/EclWriter.hpp index 3a1b6d3e2..ecd03c16f 100644 --- a/opm/simulators/flow/EclWriter.hpp +++ b/opm/simulators/flow/EclWriter.hpp @@ -147,8 +147,8 @@ public: ((simulator.vanguard().grid().comm().rank() == 0) ? &simulator.vanguard().equilCartesianIndexMapper() : nullptr), - EWOMS_GET_PARAM(TypeTag, bool, EnableAsyncEclOutput), - EWOMS_GET_PARAM(TypeTag, bool, EnableEsmry)) + Parameters::get(), + Parameters::get()) , simulator_(simulator) { #if HAVE_MPI @@ -463,7 +463,7 @@ public: this->summaryState(), this->simulator_.problem().thresholdPressure().getRestartVector(), curTime, nextStepSize, - EWOMS_GET_PARAM(TypeTag, bool, EclOutputDoublePrecision), + Parameters::get(), isFlowsn, std::move(flowsn), isFloresn, std::move(floresn)); } @@ -473,7 +473,7 @@ public: { bool enableHysteresis = simulator_.problem().materialLawManager()->enableHysteresis(); bool enableSwatinit = simulator_.vanguard().eclState().fieldProps().has_double("SWATINIT"); - bool opm_rst_file = EWOMS_GET_PARAM(TypeTag, bool, EnableOpmRstFile); + bool opm_rst_file = Parameters::get(); bool read_temp = enableEnergy || (opm_rst_file && enableTemperature); std::vector solutionKeys{ {"PRESSURE", UnitSystem::measure::pressure}, @@ -569,7 +569,7 @@ public: private: static bool enableEclOutput_() - { return EWOMS_GET_PARAM(TypeTag, bool, EnableEclOutput); } + { return Parameters::get(); } const EclipseState& eclState() const { return simulator_.vanguard().eclState(); } diff --git a/opm/simulators/flow/FlowBaseVanguard.hpp b/opm/simulators/flow/FlowBaseVanguard.hpp index e8e66762f..de236a7d7 100644 --- a/opm/simulators/flow/FlowBaseVanguard.hpp +++ b/opm/simulators/flow/FlowBaseVanguard.hpp @@ -302,26 +302,26 @@ public: FlowBaseVanguard(Simulator& simulator) : ParentType(simulator) { - fileName_ = EWOMS_GET_PARAM(TypeTag, std::string, EclDeckFileName); - edgeWeightsMethod_ = Dune::EdgeWeightMethod(EWOMS_GET_PARAM(TypeTag, int, EdgeWeightsMethod)); + fileName_ = Parameters::get(); + edgeWeightsMethod_ = Dune::EdgeWeightMethod(Parameters::get()); #if HAVE_OPENCL || HAVE_ROCSPARSE || HAVE_CUDA - numJacobiBlocks_ = EWOMS_GET_PARAM(TypeTag, int, NumJacobiBlocks); + numJacobiBlocks_ = Parameters::get(); #endif - ownersFirst_ = EWOMS_GET_PARAM(TypeTag, bool, OwnerCellsFirst); + ownersFirst_ = Parameters::get(); #if HAVE_MPI - serialPartitioning_ = EWOMS_GET_PARAM(TypeTag, bool, SerialPartitioning); - zoltanImbalanceTol_ = EWOMS_GET_PARAM(TypeTag, double, ZoltanImbalanceTol); - zoltanParams_ = EWOMS_GET_PARAM(TypeTag, std::string, ZoltanParams); - externalPartitionFile_ = EWOMS_GET_PARAM(TypeTag, std::string, ExternalPartition); + serialPartitioning_ = Parameters::get(); + zoltanImbalanceTol_ = Parameters::get(); + zoltanParams_ = Parameters::get(); + externalPartitionFile_ = Parameters::get(); #endif - enableDistributedWells_ = EWOMS_GET_PARAM(TypeTag, bool, AllowDistributedWells); - ignoredKeywords_ = EWOMS_GET_PARAM(TypeTag, std::string, IgnoreKeywords); - int output_param = EWOMS_GET_PARAM(TypeTag, int, EclOutputInterval); + enableDistributedWells_ = Parameters::get(); + ignoredKeywords_ = Parameters::get(); + int output_param = Parameters::get(); if (output_param >= 0) outputInterval_ = output_param; - useMultisegmentWell_ = EWOMS_GET_PARAM(TypeTag, bool, UseMultisegmentWell); + useMultisegmentWell_ = Parameters::get(); enableExperiments_ = enableExperiments; init(); @@ -517,8 +517,8 @@ protected: { asImp_().createGrids_(); asImp_().filterConnections_(); - std::string outputDir = EWOMS_GET_PARAM(TypeTag, std::string, OutputDir); - bool enableEclCompatFile = !EWOMS_GET_PARAM(TypeTag, bool, EnableOpmRstFile); + std::string outputDir = Parameters::get(); + bool enableEclCompatFile = !Parameters::get(); asImp_().updateOutputDir_(outputDir, enableEclCompatFile); asImp_().finalizeInit_(); } diff --git a/opm/simulators/flow/FlowMain.hpp b/opm/simulators/flow/FlowMain.hpp index 6bb256cf4..656c6e557 100644 --- a/opm/simulators/flow/FlowMain.hpp +++ b/opm/simulators/flow/FlowMain.hpp @@ -161,7 +161,7 @@ namespace Opm { Parameters::hideParam(); Parameters::hideParam(); // hide all vtk related it is not currently possible to do this dependet on if the vtk writing is used - //if(not(EWOMS_GET_PARAM(TypeTag,bool,EnableVtkOutput))){ + //if(not(Parameters::get())){ Parameters::hideParam(); Parameters::hideParam(); Parameters::hideParam(); @@ -244,13 +244,13 @@ namespace Opm { bool doExit = false; - if (EWOMS_GET_PARAM(TypeTag, int, PrintProperties) == 1) { + if (Parameters::get() == 1) { doExit = true; if (mpiRank == 0) Properties::printValues(std::cout); } - if (EWOMS_GET_PARAM(TypeTag, int, PrintParameters) == 1) { + if (Parameters::get() == 1) { doExit = true; if (mpiRank == 0) Parameters::printValues(); @@ -388,7 +388,7 @@ namespace Opm { if (!getenv("OMP_NUM_THREADS")) { int threads = 2; - const int requested_threads = EWOMS_GET_PARAM(TypeTag, int, ThreadsPerProcess); + const int requested_threads = Parameters::get(); if (requested_threads > 0) threads = requested_threads; @@ -413,8 +413,8 @@ namespace Opm { } detail::mergeParallelLogFiles(eclState().getIOConfig().getOutputDir(), - EWOMS_GET_PARAM(TypeTag, std::string, EclDeckFileName), - EWOMS_GET_PARAM(TypeTag, bool, EnableLoggingFalloutWarning)); + Parameters::get(), + Parameters::get()); } void setupModelSimulator() @@ -425,7 +425,7 @@ namespace Opm { try { // Possible to force initialization only behavior (NOSIM). - const std::string& dryRunString = EWOMS_GET_PARAM(TypeTag, std::string, EnableDryRun); + const std::string& dryRunString = Parameters::get(); if (dryRunString != "" && dryRunString != "auto") { bool yesno; if (dryRunString == "true" @@ -503,7 +503,7 @@ namespace Opm { printFlowTrailer(mpi_size_, threads, total_setup_time_, deck_read_time_, report, simulator_->model().localAccumulatedReports()); detail::handleExtraConvergenceOutput(report, - EWOMS_GET_PARAM(TypeTag, std::string, OutputExtraConvergenceInfo), + Parameters::get(), R"(OutputExtraConvergenceInfo (--output-extra-convergence-info))", eclState().getIOConfig().getOutputDir(), eclState().getIOConfig().getBaseName()); diff --git a/opm/simulators/flow/FlowProblem.hpp b/opm/simulators/flow/FlowProblem.hpp index c28200906..2989a2d63 100644 --- a/opm/simulators/flow/FlowProblem.hpp +++ b/opm/simulators/flow/FlowProblem.hpp @@ -309,15 +309,15 @@ public: #if HAVE_DAMARIS // create Damaris writer damarisWriter_ = std::make_unique(simulator); - enableDamarisOutput_ = EWOMS_GET_PARAM(TypeTag, bool, EnableDamarisOutput) ; + enableDamarisOutput_ = Parameters::get(); #endif - enableDriftCompensation_ = EWOMS_GET_PARAM(TypeTag, bool, EnableDriftCompensation); + enableDriftCompensation_ = Parameters::get(); - enableEclOutput_ = EWOMS_GET_PARAM(TypeTag, bool, EnableEclOutput); + enableEclOutput_ = Parameters::get(); - this->enableTuning_ = EWOMS_GET_PARAM(TypeTag, bool, EnableTuning); - this->initialTimeStepSize_ = EWOMS_GET_PARAM(TypeTag, Scalar, InitialTimeStepSize); - this->maxTimeStepAfterWellEvent_ = EWOMS_GET_PARAM(TypeTag, double, TimeStepAfterEventInDays)*24*60*60; + this->enableTuning_ = Parameters::get(); + this->initialTimeStepSize_ = Parameters::get(); + this->maxTimeStepAfterWellEvent_ = Parameters::get() * 24 * 60 * 60; // The value N for this parameter is defined in the following order of presedence: // 1. Command line value (--num-pressure-points-equil=N) @@ -325,7 +325,7 @@ public: // Default value is defined in opm-common/src/opm/input/eclipse/share/keywords/000_Eclipse100/E/EQLDIMS if (Parameters::isSet("NumPressurePointsEquil")) { - this->numPressurePointsEquil_ = EWOMS_GET_PARAM(TypeTag, int, NumPressurePointsEquil); + this->numPressurePointsEquil_ = Parameters::get(); } else { this->numPressurePointsEquil_ = simulator.vanguard().eclState().getTableManager().getEqldims().getNumDepthNodesP(); } @@ -360,7 +360,7 @@ public: // disables gravity, else the standard value of the gravity constant at sea level // on earth is used this->gravity_ = 0.0; - if (EWOMS_GET_PARAM(TypeTag, bool, EnableGravity)) + if (Parameters::get()) this->gravity_[dim - 1] = 9.80665; if (!eclState.getInitConfig().hasGravity()) this->gravity_[dim - 1] = 0.0; @@ -667,7 +667,8 @@ public: } } } - bool isSubStep = !EWOMS_GET_PARAM(TypeTag, bool, EnableWriteAllSolutions) && !this->simulator().episodeWillBeOver(); + bool isSubStep = !Parameters::get() && + !this->simulator().episodeWillBeOver(); // For CpGrid with LGRs, ecl/vtk output is not supported yet. const auto& grid = this->simulator().vanguard().gridView().grid(); using GridType = std::remove_cv_t< typename std::remove_reference::type>; @@ -736,11 +737,13 @@ public: OPM_TIMEBLOCK(problemWriteOutput); // use the generic code to prepare the output fields and to // write the desired VTK files. - if (EWOMS_GET_PARAM(TypeTag, bool, EnableWriteAllSolutions) || this->simulator().episodeWillBeOver()){ + if (Parameters::get() || + this->simulator().episodeWillBeOver()) { ParentType::writeOutput(verbose); } - bool isSubStep = !EWOMS_GET_PARAM(TypeTag, bool, EnableWriteAllSolutions) && !this->simulator().episodeWillBeOver(); + bool isSubStep = !Parameters::get() && + !this->simulator().episodeWillBeOver(); data::Solution localCellData = {}; #if HAVE_DAMARIS @@ -1705,7 +1708,7 @@ public: template LhsEval rockCompTransMultiplier(const IntensiveQuantities& intQuants, unsigned elementIdx) const { - bool implicit = !EWOMS_GET_PARAM(TypeTag, bool, ExplicitRockCompaction); + bool implicit = !Parameters::get(); return implicit ? this->simulator().problem().template computeRockCompTransMultiplier_(intQuants, elementIdx) : this->simulator().problem().getRockCompTransMultVal(elementIdx); } @@ -1738,7 +1741,7 @@ public: { OPM_TIMEBLOCK_LOCAL(wellTransMultiplier); - bool implicit = !EWOMS_GET_PARAM(TypeTag, bool, ExplicitRockCompaction); + bool implicit = !Parameters::get(); double trans_mult = implicit ? this->simulator().problem().template computeRockCompTransMultiplier_(intQuants, elementIdx) : this->simulator().problem().getRockCompTransMultVal(elementIdx); trans_mult *= this->simulator().problem().template permFactTransMultiplier(intQuants); @@ -2628,7 +2631,7 @@ private: int episodeIdx = simulator.episodeIndex(); // first thing in the morning, limit the time step size to the maximum size - Scalar maxTimeStepSize = EWOMS_GET_PARAM(TypeTag, double, SolverMaxTimeStepInDays)*24*60*60; + Scalar maxTimeStepSize = Parameters::get() * 24 * 60 * 60; int reportStepIdx = std::max(episodeIdx, 0); if (this->enableTuning_) { const auto& tuning = schedule[reportStepIdx].tuning(); diff --git a/opm/simulators/flow/Main.hpp b/opm/simulators/flow/Main.hpp index 4640602b1..4366445cf 100644 --- a/opm/simulators/flow/Main.hpp +++ b/opm/simulators/flow/Main.hpp @@ -333,12 +333,12 @@ private: outputDir = eclipseState_->getIOConfig().getOutputDir(); } else { - deckFilename = EWOMS_GET_PARAM(PreTypeTag, std::string, EclDeckFileName); - outputDir = EWOMS_GET_PARAM(PreTypeTag, std::string, OutputDir); + deckFilename = Parameters::get(); + outputDir = Parameters::get(); } #if HAVE_DAMARIS - enableDamarisOutput_ = EWOMS_GET_PARAM(PreTypeTag, bool, EnableDamarisOutput); + enableDamarisOutput_ = Parameters::get(); // Reset to false as we cannot use Damaris if there is only one rank. if ((enableDamarisOutput_ == true) && (FlowGenericVanguard::comm().size() == 1)) { @@ -374,7 +374,7 @@ private: int mpiRank = FlowGenericVanguard::comm().rank(); outputCout_ = false; if (mpiRank == 0) - outputCout_ = EWOMS_GET_PARAM(PreTypeTag, bool, EnableTerminalOutput); + outputCout_ = Parameters::get(); if (deckFilename.empty()) { if (mpiRank == 0) { @@ -413,12 +413,12 @@ private: try { this->readDeck(deckFilename, outputDir, - EWOMS_GET_PARAM(PreTypeTag, std::string, OutputMode), - !EWOMS_GET_PARAM(PreTypeTag, bool, SchedRestart), - EWOMS_GET_PARAM(PreTypeTag, bool, EnableLoggingFalloutWarning), - EWOMS_GET_PARAM(PreTypeTag, std::string, ParsingStrictness), + Parameters::get(), + !Parameters::get(), + Parameters::get(), + Parameters::get(), getNumThreads(), - EWOMS_GET_PARAM(PreTypeTag, int, EclOutputInterval), + Parameters::get(), cmdline_params, Opm::moduleVersion(), Opm::compileTimestamp()); @@ -715,7 +715,7 @@ private: else { threads = 2; - const int input_threads = EWOMS_GET_PARAM(TypeTag, int, ThreadsPerProcess); + const int input_threads = Parameters::get(); if (input_threads > 0) threads = input_threads; diff --git a/opm/simulators/flow/NonlinearSolver.hpp b/opm/simulators/flow/NonlinearSolver.hpp index a13bb7203..c5a881c61 100644 --- a/opm/simulators/flow/NonlinearSolver.hpp +++ b/opm/simulators/flow/NonlinearSolver.hpp @@ -127,11 +127,11 @@ void stabilizeNonlinearUpdate(BVector& dx, BVector& dxOld, reset(); // overload with given parameters - relaxMax_ = EWOMS_GET_PARAM(TypeTag, Scalar, NewtonMaxRelax); - maxIter_ = EWOMS_GET_PARAM(TypeTag, int, NewtonMaxIterations); - minIter_ = EWOMS_GET_PARAM(TypeTag, int, NewtonMinIterations); + relaxMax_ = Parameters::get(); + maxIter_ = Parameters::get(); + minIter_ = Parameters::get(); - const auto& relaxationTypeString = EWOMS_GET_PARAM(TypeTag, std::string, NewtonRelaxationType); + const auto& relaxationTypeString = Parameters::get(); if (relaxationTypeString == "dampen") { relaxType_ = NonlinearRelaxType::Dampen; } else if (relaxationTypeString == "sor") { diff --git a/opm/simulators/flow/OutputBlackoilModule.hpp b/opm/simulators/flow/OutputBlackoilModule.hpp index 61edaf7a6..bfbef470c 100644 --- a/opm/simulators/flow/OutputBlackoilModule.hpp +++ b/opm/simulators/flow/OutputBlackoilModule.hpp @@ -173,12 +173,12 @@ public: this->setupBlockData(isCartIdxOnThisRank); this->forceDisableFipOutput_ = - EWOMS_GET_PARAM(TypeTag, bool, ForceDisableFluidInPlaceOutput); + Parameters::get(); this->forceDisableFipresvOutput_ = - EWOMS_GET_PARAM(TypeTag, bool, ForceDisableResvFluidInPlaceOutput); + Parameters::get(); - if (! EWOMS_GET_PARAM(TypeTag, bool, OwnerCellsFirst)) { + if (! Parameters::get()) { const std::string msg = "The output code does not support --owner-cells-first=false."; if (collectToIORank.isIORank()) { OpmLog::error(msg); diff --git a/opm/simulators/flow/SimulatorFullyImplicitBlackoil.hpp b/opm/simulators/flow/SimulatorFullyImplicitBlackoil.hpp index b3d2db07d..59cb54903 100644 --- a/opm/simulators/flow/SimulatorFullyImplicitBlackoil.hpp +++ b/opm/simulators/flow/SimulatorFullyImplicitBlackoil.hpp @@ -189,20 +189,19 @@ public: , serializer_(*this, FlowGenericVanguard::comm(), simulator_.vanguard().eclState().getIOConfig(), - EWOMS_GET_PARAM(TypeTag, std::string, SaveStep), - EWOMS_GET_PARAM(TypeTag, int, LoadStep), - EWOMS_GET_PARAM(TypeTag, std::string, SaveFile), - EWOMS_GET_PARAM(TypeTag, std::string, LoadFile)) + Parameters::get(), + Parameters::get(), + Parameters::get(), + Parameters::get()) { phaseUsage_ = phaseUsageFromDeck(eclState()); // Only rank 0 does print to std::cout, and only if specifically requested. this->terminalOutput_ = false; if (this->grid().comm().rank() == 0) { - this->terminalOutput_ = EWOMS_GET_PARAM(TypeTag, bool, EnableTerminalOutput); + this->terminalOutput_ = Parameters::get(); - this->startConvergenceOutputThread(EWOMS_GET_PARAM(TypeTag, std::string, - OutputExtraConvergenceInfo), + this->startConvergenceOutputThread(Parameters::get(), R"(OutputExtraConvergenceInfo (--output-extra-convergence-info))"); } } @@ -282,8 +281,8 @@ public: totalTimer_->start(); // adaptive time stepping - bool enableAdaptive = EWOMS_GET_PARAM(TypeTag, bool, EnableAdaptiveTimeStepping); - bool enableTUNING = EWOMS_GET_PARAM(TypeTag, bool, EnableTuning); + bool enableAdaptive = Parameters::get(); + bool enableTUNING = Parameters::get(); if (enableAdaptive) { const UnitSystem& unitSystem = this->simulator_.vanguard().eclState().getUnits(); const auto& sched_state = schedule()[timer.currentStepNum()]; @@ -370,7 +369,7 @@ public: simulator_.model().invalidateAndUpdateIntensiveQuantities(/*timeIdx=*/0); } solver_->model().beginReportStep(); - bool enableTUNING = EWOMS_GET_PARAM(TypeTag, bool, EnableTuning); + bool enableTUNING = Parameters::get(); // If sub stepping is enabled allow the solver to sub cycle // in case the report steps are too large for the solver to converge diff --git a/opm/simulators/flow/VtkTracerModule.hpp b/opm/simulators/flow/VtkTracerModule.hpp index fe3f3f18f..3d45089e0 100644 --- a/opm/simulators/flow/VtkTracerModule.hpp +++ b/opm/simulators/flow/VtkTracerModule.hpp @@ -122,7 +122,7 @@ namespace Opm { */ void processElement(const ElementContext& elemCtx) { - if (!EWOMS_GET_PARAM(TypeTag, bool, EnableVtkOutput)) + if (!Parameters::get()) return; const auto& tracerModel = elemCtx.problem().tracerModel(); @@ -162,7 +162,7 @@ namespace Opm { private: static bool eclTracerConcentrationOutput_() { - static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteTracerConcentration); + static bool val = Parameters::get(); return val; } diff --git a/opm/simulators/linalg/FlowLinearSolverParameters.hpp b/opm/simulators/linalg/FlowLinearSolverParameters.hpp index 4af576e89..b231a72e0 100644 --- a/opm/simulators/linalg/FlowLinearSolverParameters.hpp +++ b/opm/simulators/linalg/FlowLinearSolverParameters.hpp @@ -261,34 +261,34 @@ namespace Opm void init(bool cprRequestedInDataFile) { // TODO: these parameters have undocumented non-trivial dependencies - linear_solver_reduction_ = EWOMS_GET_PARAM(TypeTag, double, LinearSolverReduction); - relaxed_linear_solver_reduction_ = EWOMS_GET_PARAM(TypeTag, double, RelaxedLinearSolverReduction); - linear_solver_maxiter_ = EWOMS_GET_PARAM(TypeTag, int, LinearSolverMaxIter); - linear_solver_restart_ = EWOMS_GET_PARAM(TypeTag, int, LinearSolverRestart); - linear_solver_verbosity_ = EWOMS_GET_PARAM(TypeTag, int, LinearSolverVerbosity); - ilu_relaxation_ = EWOMS_GET_PARAM(TypeTag, double, IluRelaxation); - ilu_fillin_level_ = EWOMS_GET_PARAM(TypeTag, int, IluFillinLevel); - ilu_milu_ = convertString2Milu(EWOMS_GET_PARAM(TypeTag, std::string, MiluVariant)); - ilu_redblack_ = EWOMS_GET_PARAM(TypeTag, bool, IluRedblack); - ilu_reorder_sphere_ = EWOMS_GET_PARAM(TypeTag, bool, IluReorderSpheres); - newton_use_gmres_ = EWOMS_GET_PARAM(TypeTag, bool, UseGmres); - ignoreConvergenceFailure_ = EWOMS_GET_PARAM(TypeTag, bool, LinearSolverIgnoreConvergenceFailure); - scale_linear_system_ = EWOMS_GET_PARAM(TypeTag, bool, ScaleLinearSystem); - linsolver_ = EWOMS_GET_PARAM(TypeTag, std::string, LinearSolver); - linear_solver_print_json_definition_ = EWOMS_GET_PARAM(TypeTag, bool, LinearSolverPrintJsonDefinition); - cpr_reuse_setup_ = EWOMS_GET_PARAM(TypeTag, int, CprReuseSetup); - cpr_reuse_interval_ = EWOMS_GET_PARAM(TypeTag, int, CprReuseInterval); + linear_solver_reduction_ = Parameters::get(); + relaxed_linear_solver_reduction_ = Parameters::get(); + linear_solver_maxiter_ = Parameters::get(); + linear_solver_restart_ = Parameters::get(); + linear_solver_verbosity_ = Parameters::get(); + ilu_relaxation_ = Parameters::get(); + ilu_fillin_level_ = Parameters::get(); + ilu_milu_ = convertString2Milu(Parameters::get()); + ilu_redblack_ = Parameters::get(); + ilu_reorder_sphere_ = Parameters::get(); + newton_use_gmres_ = Parameters::get(); + ignoreConvergenceFailure_ = Parameters::get(); + scale_linear_system_ = Parameters::get(); + linsolver_ = Parameters::get(); + linear_solver_print_json_definition_ = Parameters::get(); + cpr_reuse_setup_ = Parameters::get(); + cpr_reuse_interval_ = Parameters::get(); if (!Parameters::isSet("LinearSolver") && cprRequestedInDataFile) { linsolver_ = "cpr"; } else { - linsolver_ = EWOMS_GET_PARAM(TypeTag, std::string, LinearSolver); + linsolver_ = Parameters::get(); } - accelerator_mode_ = EWOMS_GET_PARAM(TypeTag, std::string, AcceleratorMode); - bda_device_id_ = EWOMS_GET_PARAM(TypeTag, int, BdaDeviceId); - opencl_platform_id_ = EWOMS_GET_PARAM(TypeTag, int, OpenclPlatformId); - opencl_ilu_parallel_ = EWOMS_GET_PARAM(TypeTag, bool, OpenclIluParallel); + accelerator_mode_ = Parameters::get(); + bda_device_id_ = Parameters::get(); + opencl_platform_id_ = Parameters::get(); + opencl_ilu_parallel_ = Parameters::get(); } template diff --git a/opm/simulators/linalg/ISTLSolver.hpp b/opm/simulators/linalg/ISTLSolver.hpp index ddcdcb8ae..3fa327299 100644 --- a/opm/simulators/linalg/ISTLSolver.hpp +++ b/opm/simulators/linalg/ISTLSolver.hpp @@ -258,8 +258,8 @@ std::unique_ptr blockJacobiAdjacency(const Grid& grid, // Set it up manually ElementMapper elemMapper(simulator_.vanguard().gridView(), Dune::mcmgElementLayout()); detail::findOverlapAndInterior(simulator_.vanguard().grid(), elemMapper, overlapRows_, interiorRows_); - useWellConn_ = EWOMS_GET_PARAM(TypeTag, bool, MatrixAddWellContributions); - const bool ownersFirst = EWOMS_GET_PARAM(TypeTag, bool, OwnerCellsFirst); + useWellConn_ = Parameters::get(); + const bool ownersFirst = Parameters::get(); if (!ownersFirst) { const std::string msg = "The linear solver no longer supports --owner-cells-first=false."; if (on_io_rank) { @@ -324,7 +324,7 @@ std::unique_ptr blockJacobiAdjacency(const Grid& grid, // Outch! We need to be able to scale the linear system! Hence const_cast matrix_ = const_cast(&M); - useWellConn_ = EWOMS_GET_PARAM(TypeTag, bool, MatrixAddWellContributions); + useWellConn_ = Parameters::get(); // setup sparsity pattern for jacobi matrix for preconditioner (only used for openclSolver) } else { // Pointers should not change diff --git a/opm/simulators/linalg/ISTLSolverBda.hpp b/opm/simulators/linalg/ISTLSolverBda.hpp index 8789c6152..ca64d5494 100644 --- a/opm/simulators/linalg/ISTLSolverBda.hpp +++ b/opm/simulators/linalg/ISTLSolverBda.hpp @@ -150,7 +150,7 @@ public: { OPM_TIMEBLOCK(initializeBda); - std::string accelerator_mode = EWOMS_GET_PARAM(TypeTag, std::string, AcceleratorMode); + std::string accelerator_mode = Parameters::get(); // Force accelerator mode to none if using MPI. if ((this->simulator_.vanguard().grid().comm().size() > 1) && (accelerator_mode != "none")) { const bool on_io_rank = (this->simulator_.gridView().comm().rank() == 0); @@ -165,13 +165,13 @@ public: } // Initialize the BdaBridge - const int platformID = EWOMS_GET_PARAM(TypeTag, int, OpenclPlatformId); - const int deviceID = EWOMS_GET_PARAM(TypeTag, int, BdaDeviceId); - const int maxit = EWOMS_GET_PARAM(TypeTag, int, LinearSolverMaxIter); - const double tolerance = EWOMS_GET_PARAM(TypeTag, double, LinearSolverReduction); - const bool opencl_ilu_parallel = EWOMS_GET_PARAM(TypeTag, bool, OpenclIluParallel); + const int platformID = Parameters::get(); + const int deviceID = Parameters::get(); + const int maxit = Parameters::get(); + const double tolerance = Parameters::get(); + const bool opencl_ilu_parallel = Parameters::get(); const int linear_solver_verbosity = this->parameters_[0].linear_solver_verbosity_; - std::string linsolver = EWOMS_GET_PARAM(TypeTag, std::string, LinearSolver); + std::string linsolver = Parameters::get(); bdaBridge_ = std::make_unique>(accelerator_mode, linear_solver_verbosity, maxit, @@ -202,7 +202,7 @@ public: // to the original one with a deleter that does nothing. // Outch! We need to be able to scale the linear system! Hence const_cast // setup sparsity pattern for jacobi matrix for preconditioner (only used for openclSolver) - bdaBridge_->numJacobiBlocks_ = EWOMS_GET_PARAM(TypeTag, int, NumJacobiBlocks); + bdaBridge_->numJacobiBlocks_ = Parameters::get(); bdaBridge_->prepare(this->simulator_.vanguard().grid(), this->simulator_.vanguard().cartesianIndexMapper(), this->simulator_.vanguard().schedule().getWellsatEnd(), diff --git a/opm/simulators/timestepping/AdaptiveTimeStepping.hpp b/opm/simulators/timestepping/AdaptiveTimeStepping.hpp index ff1ae6700..b7a30e38a 100644 --- a/opm/simulators/timestepping/AdaptiveTimeStepping.hpp +++ b/opm/simulators/timestepping/AdaptiveTimeStepping.hpp @@ -254,20 +254,20 @@ std::set consistentlyFailingWells(const std::vector& sr const double max_next_tstep = -1.0, const bool terminalOutput = true) : timeStepControl_() - , restartFactor_(EWOMS_GET_PARAM(TypeTag, double, SolverRestartFactor)) // 0.33 - , growthFactor_(EWOMS_GET_PARAM(TypeTag, double, SolverGrowthFactor)) // 2.0 - , maxGrowth_(EWOMS_GET_PARAM(TypeTag, double, SolverMaxGrowth)) // 3.0 - , maxTimeStep_(EWOMS_GET_PARAM(TypeTag, double, SolverMaxTimeStepInDays)*24*60*60) // 365.25 - , minTimeStep_(unitSystem.to_si(UnitSystem::measure::time, EWOMS_GET_PARAM(TypeTag, double, SolverMinTimeStep))) // 1e-12; - , ignoreConvergenceFailure_(EWOMS_GET_PARAM(TypeTag, bool, SolverContinueOnConvergenceFailure)) // false; - , solverRestartMax_(EWOMS_GET_PARAM(TypeTag, int, SolverMaxRestarts)) // 10 - , solverVerbose_(EWOMS_GET_PARAM(TypeTag, int, SolverVerbosity) > 0 && terminalOutput) // 2 - , timestepVerbose_(EWOMS_GET_PARAM(TypeTag, int, TimeStepVerbosity) > 0 && terminalOutput) // 2 - , suggestedNextTimestep_((max_next_tstep <= 0 ? EWOMS_GET_PARAM(TypeTag, double, InitialTimeStepInDays) : max_next_tstep)*24*60*60) // 1.0 - , fullTimestepInitially_(EWOMS_GET_PARAM(TypeTag, bool, FullTimeStepInitially)) // false - , timestepAfterEvent_(EWOMS_GET_PARAM(TypeTag, double, TimeStepAfterEventInDays)*24*60*60) // 1e30 + , restartFactor_(Parameters::get()) // 0.33 + , growthFactor_(Parameters::get()) // 2.0 + , maxGrowth_(Parameters::get()) // 3.0 + , maxTimeStep_(Parameters::get() * 24 * 60 * 60) // 365.25 + , minTimeStep_(unitSystem.to_si(UnitSystem::measure::time, Parameters::get())) // 1e-12; + , ignoreConvergenceFailure_(Parameters::get()) // false; + , solverRestartMax_(Parameters::get()) // 10 + , solverVerbose_(Parameters::get() > 0 && terminalOutput) // 2 + , timestepVerbose_(Parameters::get() > 0 && terminalOutput) // 2 + , suggestedNextTimestep_((max_next_tstep <= 0 ? Parameters::get() : max_next_tstep) * 24 * 60 * 60) // 1.0 + , fullTimestepInitially_(Parameters::get()) // false + , timestepAfterEvent_(Parameters::get() * 24 * 60 * 60) // 1e30 , useNewtonIteration_(false) - , minTimeStepBeforeShuttingProblematicWells_(EWOMS_GET_PARAM(TypeTag, double, MinTimeStepBeforeShuttingProblematicWellsInDays)*unit::day) + , minTimeStepBeforeShuttingProblematicWells_(Parameters::get() * unit::day) { init_(unitSystem); @@ -289,14 +289,14 @@ std::set consistentlyFailingWells(const std::vector& sr , maxTimeStep_(tuning.TSMAXZ) // 365.25 , minTimeStep_(tuning.TSFMIN) // 0.1; , ignoreConvergenceFailure_(true) - , solverRestartMax_(EWOMS_GET_PARAM(TypeTag, int, SolverMaxRestarts)) // 10 - , solverVerbose_(EWOMS_GET_PARAM(TypeTag, int, SolverVerbosity) > 0 && terminalOutput) // 2 - , timestepVerbose_(EWOMS_GET_PARAM(TypeTag, int, TimeStepVerbosity) > 0 && terminalOutput) // 2 - , suggestedNextTimestep_(max_next_tstep <= 0 ? EWOMS_GET_PARAM(TypeTag, double, InitialTimeStepInDays)*24*60*60 : max_next_tstep) // 1.0 - , fullTimestepInitially_(EWOMS_GET_PARAM(TypeTag, bool, FullTimeStepInitially)) // false + , solverRestartMax_(Parameters::get()) // 10 + , solverVerbose_(Parameters::get() > 0 && terminalOutput) // 2 + , timestepVerbose_(Parameters::get() > 0 && terminalOutput) // 2 + , suggestedNextTimestep_(max_next_tstep <= 0 ? Parameters::get() * 24 * 60 * 60 : max_next_tstep) // 1.0 + , fullTimestepInitially_(Parameters::get()) // false , timestepAfterEvent_(tuning.TMAXWC) // 1e30 , useNewtonIteration_(false) - , minTimeStepBeforeShuttingProblematicWells_(EWOMS_GET_PARAM(TypeTag, double, MinTimeStepBeforeShuttingProblematicWellsInDays)*unit::day) + , minTimeStepBeforeShuttingProblematicWells_(Parameters::get() * unit::day) { init_(unitSystem); } @@ -815,25 +815,25 @@ std::set consistentlyFailingWells(const std::vector& sr void init_(const UnitSystem& unitSystem) { // valid are "pid" and "pid+iteration" - std::string control = EWOMS_GET_PARAM(TypeTag, std::string, TimeStepControl); // "pid" + std::string control = Parameters::get(); // "pid" - const double tol = EWOMS_GET_PARAM(TypeTag, double, TimeStepControlTolerance); // 1e-1 + const double tol = Parameters::get(); // 1e-1 if (control == "pid") { timeStepControl_ = std::make_unique(tol); timeStepControlType_ = TimeStepControlType::PID; } else if (control == "pid+iteration") { - const int iterations = EWOMS_GET_PARAM(TypeTag, int, TimeStepControlTargetIterations); // 30 - const double decayDampingFactor = EWOMS_GET_PARAM(TypeTag, double, TimeStepControlDecayDampingFactor); // 1.0 - const double growthDampingFactor = EWOMS_GET_PARAM(TypeTag, double, TimeStepControlGrowthDampingFactor); // 3.2 + const int iterations = Parameters::get(); // 30 + const double decayDampingFactor = Parameters::get(); // 1.0 + const double growthDampingFactor = Parameters::get(); // 3.2 timeStepControl_ = std::make_unique(iterations, decayDampingFactor, growthDampingFactor, tol); timeStepControlType_ = TimeStepControlType::PIDAndIterationCount; } else if (control == "pid+newtoniteration") { - const int iterations = EWOMS_GET_PARAM(TypeTag, int, TimeStepControlTargetNewtonIterations); // 8 - const double decayDampingFactor = EWOMS_GET_PARAM(TypeTag, double, TimeStepControlDecayDampingFactor); // 1.0 - const double growthDampingFactor = EWOMS_GET_PARAM(TypeTag, double, TimeStepControlGrowthDampingFactor); // 3.2 - const double nonDimensionalMinTimeStepIterations = EWOMS_GET_PARAM(TypeTag, double, MinTimeStepBasedOnNewtonIterations); // 0.0 by default + const int iterations = Parameters::get(); // 8 + const double decayDampingFactor = Parameters::get(); // 1.0 + const double growthDampingFactor = Parameters::get(); // 3.2 + const double nonDimensionalMinTimeStepIterations = Parameters::get(); // 0.0 by default // the min time step can be reduced by the newton iteration numbers double minTimeStepReducedByIterations = unitSystem.to_si(UnitSystem::measure::time, nonDimensionalMinTimeStepIterations); timeStepControl_ = std::make_unique(iterations, decayDampingFactor, @@ -842,22 +842,22 @@ std::set consistentlyFailingWells(const std::vector& sr useNewtonIteration_ = true; } else if (control == "iterationcount") { - const int iterations = EWOMS_GET_PARAM(TypeTag, int, TimeStepControlTargetIterations); // 30 - const double decayrate = EWOMS_GET_PARAM(TypeTag, double, TimeStepControlDecayRate); // 0.75 - const double growthrate = EWOMS_GET_PARAM(TypeTag, double, TimeStepControlGrowthRate); // 1.25 + const int iterations = Parameters::get(); // 30 + const double decayrate = Parameters::get(); // 0.75 + const double growthrate = Parameters::get(); // 1.25 timeStepControl_ = std::make_unique(iterations, decayrate, growthrate); timeStepControlType_ = TimeStepControlType::SimpleIterationCount; } else if (control == "newtoniterationcount") { - const int iterations = EWOMS_GET_PARAM(TypeTag, int, TimeStepControlTargetNewtonIterations); // 8 - const double decayrate = EWOMS_GET_PARAM(TypeTag, double, TimeStepControlDecayRate); // 0.75 - const double growthrate = EWOMS_GET_PARAM(TypeTag, double, TimeStepControlGrowthRate); // 1.25 + const int iterations = Parameters::get(); // 8 + const double decayrate = Parameters::get(); // 0.75 + const double growthrate = Parameters::get(); // 1.25 timeStepControl_ = std::make_unique(iterations, decayrate, growthrate); useNewtonIteration_ = true; timeStepControlType_ = TimeStepControlType::SimpleIterationCount; } else if (control == "hardcoded") { - const std::string filename = EWOMS_GET_PARAM(TypeTag, std::string, TimeStepControlFileName); // "timesteps" + const std::string filename = Parameters::get(); // "timesteps" timeStepControl_ = std::make_unique(filename); timeStepControlType_ = TimeStepControlType::HardCodedTimeStep; } diff --git a/opm/simulators/utils/DamarisKeywords.hpp b/opm/simulators/utils/DamarisKeywords.hpp index 38204b949..dd63d1357 100644 --- a/opm/simulators/utils/DamarisKeywords.hpp +++ b/opm/simulators/utils/DamarisKeywords.hpp @@ -89,18 +89,18 @@ getDamarisKeywords(const Parallel::Communication& comm, const std::string& Outpu // which is used in simulators/flow/Main.hpp) // These command line arguments are defined in opm/simulators/flow/DamarisWriter.hpp and // defaults are set in opm/simulators/flow/FlowProblemProperties.hpp - settings.enableDamarisOutputCollective_ = EWOMS_GET_PARAM(TypeTag, bool, DamarisOutputHdfCollective); - settings.saveMeshToHDF5_ = EWOMS_GET_PARAM(TypeTag, bool, DamarisSaveMeshToHdf); - settings.saveToDamarisHDF5_ = EWOMS_GET_PARAM(TypeTag, bool, DamarisSaveToHdf); - settings.pythonFilename_ = EWOMS_GET_PARAM(TypeTag, std::string, DamarisPythonScript); - settings.paraviewPythonFilename_ = EWOMS_GET_PARAM(TypeTag, std::string, DamarisPythonParaviewScript); - settings.damarisSimName_ = EWOMS_GET_PARAM(TypeTag, std::string, DamarisSimName); - settings.nDamarisCores_ = EWOMS_GET_PARAM(TypeTag, int, DamarisDedicatedCores); - settings.nDamarisNodes_ = EWOMS_GET_PARAM(TypeTag, int, DamarisDedicatedNodes); - settings.shmemSizeBytes_ = EWOMS_GET_PARAM(TypeTag, long, DamarisSharedMemorySizeBytes); - settings.shmemName_ = EWOMS_GET_PARAM(TypeTag, std::string, DamarisSharedMemoryName); - settings.damarisLogLevel_ = EWOMS_GET_PARAM(TypeTag, std::string, DamarisLogLevel); - settings.damarisDaskFile_ = EWOMS_GET_PARAM(TypeTag, std::string, DamarisDaskFile); + settings.enableDamarisOutputCollective_ = Parameters::get(); + settings.saveMeshToHDF5_ = Parameters::get(); + settings.saveToDamarisHDF5_ = Parameters::get(); + settings.pythonFilename_ = Parameters::get(); + settings.paraviewPythonFilename_ = Parameters::get(); + settings.damarisSimName_ = Parameters::get(); + settings.nDamarisCores_ = Parameters::get(); + settings.nDamarisNodes_ = Parameters::get(); + settings.shmemSizeBytes_ = Parameters::get(); + settings.shmemName_ = Parameters::get(); + settings.damarisLogLevel_ = Parameters::get(); + settings.damarisDaskFile_ = Parameters::get(); return settings.getKeywords(comm, OutputDir); } diff --git a/opm/simulators/wells/BlackoilWellModel_impl.hpp b/opm/simulators/wells/BlackoilWellModel_impl.hpp index cb8c0bff8..0fb4daaa9 100644 --- a/opm/simulators/wells/BlackoilWellModel_impl.hpp +++ b/opm/simulators/wells/BlackoilWellModel_impl.hpp @@ -59,7 +59,7 @@ namespace Opm { , simulator_(simulator) { terminal_output_ = ((simulator.gridView().comm().rank() == 0) && - EWOMS_GET_PARAM(TypeTag, bool, EnableTerminalOutput)); + Parameters::get()); local_num_cells_ = simulator_.gridView().size(0); @@ -76,7 +76,7 @@ namespace Opm { } this->alternative_well_rate_init_ = - EWOMS_GET_PARAM(TypeTag, bool, AlternativeWellRateInit); + Parameters::get(); this->wbpCalculationService_ .localCellIndex([this](const std::size_t globalIndex)