Merge pull request #5276 from akva2/adjust_get_param_removal

adjust to removal of EWOMS_GET_PARAM
This commit is contained in:
Bård Skaflestad 2024-04-05 17:04:18 +02:00 committed by GitHub
commit c2184219fa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
17 changed files with 206 additions and 204 deletions

View File

@ -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<TypeTag, Properties::DbhpMaxRel>();
dwell_fraction_max_ = Parameters::get<TypeTag, Properties::DwellFractionMax>();
max_residual_allowed_ = Parameters::get<TypeTag, Properties::MaxResidualAllowed>();
relaxed_max_pv_fraction_ = Parameters::get<TypeTag, Properties::RelaxedMaxPvFraction>();
tolerance_mb_ = Parameters::get<TypeTag, Properties::ToleranceMb>();
tolerance_mb_relaxed_ = Parameters::get<TypeTag, Properties::ToleranceMbRelaxed>();
tolerance_cnv_ = Parameters::get<TypeTag, Properties::ToleranceCnv>();
tolerance_cnv_relaxed_ = Parameters::get<TypeTag, Properties::ToleranceCnvRelaxed>();
tolerance_wells_ = Parameters::get<TypeTag, Properties::ToleranceWells>();
tolerance_well_control_ = Parameters::get<TypeTag, Properties::ToleranceWellControl>();
max_welleq_iter_ = Parameters::get<TypeTag, Properties::MaxWelleqIter>();
use_multisegment_well_ = Parameters::get<TypeTag, Properties::UseMultisegmentWell>();
tolerance_pressure_ms_wells_ = Parameters::get<TypeTag, Properties::TolerancePressureMsWells>();
relaxed_tolerance_flow_well_ = Parameters::get<TypeTag, Properties::RelaxedWellFlowTol>();
relaxed_tolerance_pressure_ms_well_ = Parameters::get<TypeTag, Properties::RelaxedPressureTolMsw>();
max_pressure_change_ms_wells_ = Parameters::get<TypeTag, Properties::MaxPressureChangeMsWells>();
max_inner_iter_ms_wells_ = Parameters::get<TypeTag, Properties::MaxInnerIterMsWells>();
strict_inner_iter_wells_ = Parameters::get<TypeTag, Properties::StrictInnerIterWells>();
strict_outer_iter_wells_ = Parameters::get<TypeTag, Properties::StrictOuterIterWells>();
regularization_factor_wells_ = Parameters::get<TypeTag, Properties::RegularizationFactorWells>();
max_niter_inner_well_iter_ = Parameters::get<TypeTag, Properties::MaxNewtonIterationsWithInnerWellIterations>();
shut_unsolvable_wells_ = Parameters::get<TypeTag, Properties::ShutUnsolvableWells>();
max_inner_iter_wells_ = Parameters::get<TypeTag, Properties::MaxInnerIterWells>();
maxSinglePrecisionTimeStep_ = Parameters::get<TypeTag, Properties::MaxSinglePrecisionDays>() * 24 * 60 * 60;
min_strict_cnv_iter_ = Parameters::get<TypeTag, Properties::MinStrictCnvIter>();
min_strict_mb_iter_ = Parameters::get<TypeTag, Properties::MinStrictMbIter>();
solve_welleq_initially_ = Parameters::get<TypeTag, Properties::SolveWelleqInitially>();
update_equations_scaling_ = Parameters::get<TypeTag, Properties::UpdateEquationsScaling>();
use_update_stabilization_ = Parameters::get<TypeTag, Properties::UseUpdateStabilization>();
matrix_add_well_contributions_ = Parameters::get<TypeTag, Properties::MatrixAddWellContributions>();
check_well_operability_ = Parameters::get<TypeTag, Properties::EnableWellOperabilityCheck>();
check_well_operability_iter_ = Parameters::get<TypeTag, Properties::EnableWellOperabilityCheckIter>();
max_number_of_well_switches_ = Parameters::get<TypeTag, Properties::MaximumNumberOfWellSwitches>();
use_average_density_ms_wells_ = Parameters::get<TypeTag, Properties::UseAverageDensityMsWells>();
local_well_solver_control_switching_ = Parameters::get<TypeTag, Properties::LocalWellSolveControlSwitching>();
use_implicit_ipr_ = Parameters::get<TypeTag, Properties::UseImplicitIpr>();
nonlinear_solver_ = Parameters::get<TypeTag, Properties::NonlinearSolver>();
const auto approach = Parameters::get<TypeTag, Properties::LocalSolveApproach>();
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<TypeTag, Properties::MaxLocalSolveIterations>();
local_tolerance_scaling_mb_ = Parameters::get<TypeTag, Properties::LocalToleranceScalingMb>();
local_tolerance_scaling_cnv_ = Parameters::get<TypeTag, Properties::LocalToleranceScalingCnv>();
nldd_num_initial_newton_iter_ = Parameters::get<TypeTag, Properties::NlddNumInitialNewtonIter>();
num_local_domains_ = Parameters::get<TypeTag, Properties::NumLocalDomains>();
local_domain_partition_imbalance_ = std::max(1.0, Parameters::get<TypeTag, Properties::LocalDomainsPartitioningImbalance>());
local_domain_partition_method_ = Parameters::get<TypeTag, Properties::LocalDomainsPartitioningMethod>();
deck_file_name_ = Parameters::get<TypeTag, Properties::EclDeckFileName>();
network_max_strict_iterations_ = Parameters::get<TypeTag, Properties::NetworkMaxStrictIterations>();
network_max_iterations_ = Parameters::get<TypeTag, Properties::NetworkMaxIterations>();
local_domain_ordering_ = domainOrderingMeasureFromString(Parameters::get<TypeTag, Properties::LocalDomainsOrderingMeasure>());
write_partitions_ = Parameters::get<TypeTag, Properties::DebugEmitCellPartition>();
}
static void registerParameters()

View File

@ -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<TypeTag, Properties::EnableDamarisOutput>();
}
void setGlobalIndexForDamaris ()

View File

@ -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<TypeTag, Properties::EnableAsyncEclOutput>(),
Parameters::get<TypeTag, Properties::EnableEsmry>())
, 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<TypeTag, Properties::EclOutputDoublePrecision>(),
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<TypeTag, Properties::EnableOpmRstFile>();
bool read_temp = enableEnergy || (opm_rst_file && enableTemperature);
std::vector<RestartKey> solutionKeys{
{"PRESSURE", UnitSystem::measure::pressure},
@ -569,7 +569,7 @@ public:
private:
static bool enableEclOutput_()
{ return EWOMS_GET_PARAM(TypeTag, bool, EnableEclOutput); }
{ return Parameters::get<TypeTag, Properties::EnableEclOutput>(); }
const EclipseState& eclState() const
{ return simulator_.vanguard().eclState(); }

View File

@ -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<TypeTag, Properties::EclDeckFileName>();
edgeWeightsMethod_ = Dune::EdgeWeightMethod(Parameters::get<TypeTag, Properties::EdgeWeightsMethod>());
#if HAVE_OPENCL || HAVE_ROCSPARSE || HAVE_CUDA
numJacobiBlocks_ = EWOMS_GET_PARAM(TypeTag, int, NumJacobiBlocks);
numJacobiBlocks_ = Parameters::get<TypeTag, Properties::NumJacobiBlocks>();
#endif
ownersFirst_ = EWOMS_GET_PARAM(TypeTag, bool, OwnerCellsFirst);
ownersFirst_ = Parameters::get<TypeTag, Properties::OwnerCellsFirst>();
#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<TypeTag, Properties::SerialPartitioning>();
zoltanImbalanceTol_ = Parameters::get<TypeTag, Properties::ZoltanImbalanceTol>();
zoltanParams_ = Parameters::get<TypeTag, Properties::ZoltanParams>();
externalPartitionFile_ = Parameters::get<TypeTag, Properties::ExternalPartition>();
#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<TypeTag, Properties::AllowDistributedWells>();
ignoredKeywords_ = Parameters::get<TypeTag, Properties::IgnoreKeywords>();
int output_param = Parameters::get<TypeTag, Properties::EclOutputInterval>();
if (output_param >= 0)
outputInterval_ = output_param;
useMultisegmentWell_ = EWOMS_GET_PARAM(TypeTag, bool, UseMultisegmentWell);
useMultisegmentWell_ = Parameters::get<TypeTag, Properties::UseMultisegmentWell>();
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<TypeTag, Properties::OutputDir>();
bool enableEclCompatFile = !Parameters::get<TypeTag, Properties::EnableOpmRstFile>();
asImp_().updateOutputDir_(outputDir, enableEclCompatFile);
asImp_().finalizeInit_();
}

View File

@ -161,7 +161,7 @@ namespace Opm {
Parameters::hideParam<TypeTag, Properties::RestartTime>();
Parameters::hideParam<TypeTag, Properties::RestartWritingInterval>();
// 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<TypeTag,Properties::EnableVtkOutput>())){
Parameters::hideParam<TypeTag, Properties::VtkWriteOilFormationVolumeFactor>();
Parameters::hideParam<TypeTag, Properties::VtkWriteOilSaturationPressure>();
Parameters::hideParam<TypeTag, Properties::VtkWriteOilVaporizationFactor>();
@ -244,13 +244,13 @@ namespace Opm {
bool doExit = false;
if (EWOMS_GET_PARAM(TypeTag, int, PrintProperties) == 1) {
if (Parameters::get<TypeTag, Properties::PrintProperties>() == 1) {
doExit = true;
if (mpiRank == 0)
Properties::printValues<TypeTag>(std::cout);
}
if (EWOMS_GET_PARAM(TypeTag, int, PrintParameters) == 1) {
if (Parameters::get<TypeTag, Properties::PrintParameters>() == 1) {
doExit = true;
if (mpiRank == 0)
Parameters::printValues<TypeTag>();
@ -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<TypeTag, Properties::ThreadsPerProcess>();
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<TypeTag, Properties::EclDeckFileName>(),
Parameters::get<TypeTag, Properties::EnableLoggingFalloutWarning>());
}
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<TypeTag, Properties::EnableDryRun>();
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<TypeTag, Properties::OutputExtraConvergenceInfo>(),
R"(OutputExtraConvergenceInfo (--output-extra-convergence-info))",
eclState().getIOConfig().getOutputDir(),
eclState().getIOConfig().getBaseName());

View File

@ -309,15 +309,15 @@ public:
#if HAVE_DAMARIS
// create Damaris writer
damarisWriter_ = std::make_unique<DamarisWriterType>(simulator);
enableDamarisOutput_ = EWOMS_GET_PARAM(TypeTag, bool, EnableDamarisOutput) ;
enableDamarisOutput_ = Parameters::get<TypeTag, Properties::EnableDamarisOutput>();
#endif
enableDriftCompensation_ = EWOMS_GET_PARAM(TypeTag, bool, EnableDriftCompensation);
enableDriftCompensation_ = Parameters::get<TypeTag, Properties::EnableDriftCompensation>();
enableEclOutput_ = EWOMS_GET_PARAM(TypeTag, bool, EnableEclOutput);
enableEclOutput_ = Parameters::get<TypeTag, Properties::EnableEclOutput>();
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<TypeTag, Properties::EnableTuning>();
this->initialTimeStepSize_ = Parameters::get<TypeTag, Properties::InitialTimeStepSize>();
this->maxTimeStepAfterWellEvent_ = Parameters::get<TypeTag, Properties::TimeStepAfterEventInDays>() * 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<TypeTag,int>("NumPressurePointsEquil"))
{
this->numPressurePointsEquil_ = EWOMS_GET_PARAM(TypeTag, int, NumPressurePointsEquil);
this->numPressurePointsEquil_ = Parameters::get<TypeTag, Properties::NumPressurePointsEquil>();
} 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<TypeTag, Properties::EnableGravity>())
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<TypeTag, Properties::EnableWriteAllSolutions>() &&
!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<decltype(grid)>::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<TypeTag, Properties::EnableWriteAllSolutions>() ||
this->simulator().episodeWillBeOver()) {
ParentType::writeOutput(verbose);
}
bool isSubStep = !EWOMS_GET_PARAM(TypeTag, bool, EnableWriteAllSolutions) && !this->simulator().episodeWillBeOver();
bool isSubStep = !Parameters::get<TypeTag, Properties::EnableWriteAllSolutions>() &&
!this->simulator().episodeWillBeOver();
data::Solution localCellData = {};
#if HAVE_DAMARIS
@ -1705,7 +1708,7 @@ public:
template <class LhsEval>
LhsEval rockCompTransMultiplier(const IntensiveQuantities& intQuants, unsigned elementIdx) const
{
bool implicit = !EWOMS_GET_PARAM(TypeTag, bool, ExplicitRockCompaction);
bool implicit = !Parameters::get<TypeTag, Properties::ExplicitRockCompaction>();
return implicit ? this->simulator().problem().template computeRockCompTransMultiplier_<LhsEval>(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<TypeTag, Properties::ExplicitRockCompaction>();
double trans_mult = implicit ? this->simulator().problem().template computeRockCompTransMultiplier_<double>(intQuants, elementIdx)
: this->simulator().problem().getRockCompTransMultVal(elementIdx);
trans_mult *= this->simulator().problem().template permFactTransMultiplier<double>(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<TypeTag, Properties::SolverMaxTimeStepInDays>() * 24 * 60 * 60;
int reportStepIdx = std::max(episodeIdx, 0);
if (this->enableTuning_) {
const auto& tuning = schedule[reportStepIdx].tuning();

View File

@ -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<PreTypeTag, Properties::EclDeckFileName>();
outputDir = Parameters::get<PreTypeTag, Properties::OutputDir>();
}
#if HAVE_DAMARIS
enableDamarisOutput_ = EWOMS_GET_PARAM(PreTypeTag, bool, EnableDamarisOutput);
enableDamarisOutput_ = Parameters::get<PreTypeTag, Properties::EnableDamarisOutput>();
// 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<PreTypeTag, Properties::EnableTerminalOutput>();
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<PreTypeTag, Properties::OutputMode>(),
!Parameters::get<PreTypeTag, Properties::SchedRestart>(),
Parameters::get<PreTypeTag, Properties::EnableLoggingFalloutWarning>(),
Parameters::get<PreTypeTag, Properties::ParsingStrictness>(),
getNumThreads<PreTypeTag>(),
EWOMS_GET_PARAM(PreTypeTag, int, EclOutputInterval),
Parameters::get<PreTypeTag, Properties::EclOutputInterval>(),
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<TypeTag, Properties::ThreadsPerProcess>();
if (input_threads > 0)
threads = input_threads;

View File

@ -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<TypeTag, Properties::NewtonMaxRelax>();
maxIter_ = Parameters::get<TypeTag, Properties::NewtonMaxIterations>();
minIter_ = Parameters::get<TypeTag, Properties::NewtonMinIterations>();
const auto& relaxationTypeString = EWOMS_GET_PARAM(TypeTag, std::string, NewtonRelaxationType);
const auto& relaxationTypeString = Parameters::get<TypeTag, Properties::NewtonRelaxationType>();
if (relaxationTypeString == "dampen") {
relaxType_ = NonlinearRelaxType::Dampen;
} else if (relaxationTypeString == "sor") {

View File

@ -173,12 +173,12 @@ public:
this->setupBlockData(isCartIdxOnThisRank);
this->forceDisableFipOutput_ =
EWOMS_GET_PARAM(TypeTag, bool, ForceDisableFluidInPlaceOutput);
Parameters::get<TypeTag, Properties::ForceDisableFluidInPlaceOutput>();
this->forceDisableFipresvOutput_ =
EWOMS_GET_PARAM(TypeTag, bool, ForceDisableResvFluidInPlaceOutput);
Parameters::get<TypeTag, Properties::ForceDisableResvFluidInPlaceOutput>();
if (! EWOMS_GET_PARAM(TypeTag, bool, OwnerCellsFirst)) {
if (! Parameters::get<TypeTag, Properties::OwnerCellsFirst>()) {
const std::string msg = "The output code does not support --owner-cells-first=false.";
if (collectToIORank.isIORank()) {
OpmLog::error(msg);

View File

@ -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<TypeTag, Properties::SaveStep>(),
Parameters::get<TypeTag, Properties::LoadStep>(),
Parameters::get<TypeTag, Properties::SaveFile>(),
Parameters::get<TypeTag, Properties::LoadFile>())
{
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<TypeTag, Properties::EnableTerminalOutput>();
this->startConvergenceOutputThread(EWOMS_GET_PARAM(TypeTag, std::string,
OutputExtraConvergenceInfo),
this->startConvergenceOutputThread(Parameters::get<TypeTag, Properties::OutputExtraConvergenceInfo>(),
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<TypeTag, Properties::EnableAdaptiveTimeStepping>();
bool enableTUNING = Parameters::get<TypeTag, Properties::EnableTuning>();
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<TypeTag, Properties::EnableTuning>();
// If sub stepping is enabled allow the solver to sub cycle
// in case the report steps are too large for the solver to converge

View File

@ -122,7 +122,7 @@ namespace Opm {
*/
void processElement(const ElementContext& elemCtx)
{
if (!EWOMS_GET_PARAM(TypeTag, bool, EnableVtkOutput))
if (!Parameters::get<TypeTag, Properties::EnableVtkOutput>())
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<TypeTag, Properties::VtkWriteTracerConcentration>();
return val;
}

View File

@ -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<TypeTag, Properties::LinearSolverReduction>();
relaxed_linear_solver_reduction_ = Parameters::get<TypeTag, Properties::RelaxedLinearSolverReduction>();
linear_solver_maxiter_ = Parameters::get<TypeTag, Properties::LinearSolverMaxIter>();
linear_solver_restart_ = Parameters::get<TypeTag, Properties::LinearSolverRestart>();
linear_solver_verbosity_ = Parameters::get<TypeTag, Properties::LinearSolverVerbosity>();
ilu_relaxation_ = Parameters::get<TypeTag, Properties::IluRelaxation>();
ilu_fillin_level_ = Parameters::get<TypeTag, Properties::IluFillinLevel>();
ilu_milu_ = convertString2Milu(Parameters::get<TypeTag, Properties::MiluVariant>());
ilu_redblack_ = Parameters::get<TypeTag, Properties::IluRedblack>();
ilu_reorder_sphere_ = Parameters::get<TypeTag, Properties::IluReorderSpheres>();
newton_use_gmres_ = Parameters::get<TypeTag, Properties::UseGmres>();
ignoreConvergenceFailure_ = Parameters::get<TypeTag, Properties::LinearSolverIgnoreConvergenceFailure>();
scale_linear_system_ = Parameters::get<TypeTag, Properties::ScaleLinearSystem>();
linsolver_ = Parameters::get<TypeTag, Properties::LinearSolver>();
linear_solver_print_json_definition_ = Parameters::get<TypeTag, Properties::LinearSolverPrintJsonDefinition>();
cpr_reuse_setup_ = Parameters::get<TypeTag, Properties::CprReuseSetup>();
cpr_reuse_interval_ = Parameters::get<TypeTag, Properties::CprReuseInterval>();
if (!Parameters::isSet<TypeTag, std::string>("LinearSolver") && cprRequestedInDataFile) {
linsolver_ = "cpr";
} else {
linsolver_ = EWOMS_GET_PARAM(TypeTag, std::string, LinearSolver);
linsolver_ = Parameters::get<TypeTag, Properties::LinearSolver>();
}
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<TypeTag, Properties::AcceleratorMode>();
bda_device_id_ = Parameters::get<TypeTag, Properties::BdaDeviceId>();
opencl_platform_id_ = Parameters::get<TypeTag, Properties::OpenclPlatformId>();
opencl_ilu_parallel_ = Parameters::get<TypeTag, Properties::OpenclIluParallel>();
}
template <class TypeTag>

View File

@ -258,8 +258,8 @@ std::unique_ptr<Matrix> 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<TypeTag, Properties::MatrixAddWellContributions>();
const bool ownersFirst = Parameters::get<TypeTag, Properties::OwnerCellsFirst>();
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<Matrix> blockJacobiAdjacency(const Grid& grid,
// Outch! We need to be able to scale the linear system! Hence const_cast
matrix_ = const_cast<Matrix*>(&M);
useWellConn_ = EWOMS_GET_PARAM(TypeTag, bool, MatrixAddWellContributions);
useWellConn_ = Parameters::get<TypeTag, Properties::MatrixAddWellContributions>();
// setup sparsity pattern for jacobi matrix for preconditioner (only used for openclSolver)
} else {
// Pointers should not change

View File

@ -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<TypeTag, Properties::AcceleratorMode>();
// 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<TypeTag, Properties::OpenclPlatformId>();
const int deviceID = Parameters::get<TypeTag, Properties::BdaDeviceId>();
const int maxit = Parameters::get<TypeTag, Properties::LinearSolverMaxIter>();
const double tolerance = Parameters::get<TypeTag, Properties::LinearSolverReduction>();
const bool opencl_ilu_parallel = Parameters::get<TypeTag, Properties::OpenclIluParallel>();
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<TypeTag, Properties::LinearSolver>();
bdaBridge_ = std::make_unique<detail::BdaSolverInfo<Matrix,Vector>>(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<TypeTag, Properties::NumJacobiBlocks>();
bdaBridge_->prepare(this->simulator_.vanguard().grid(),
this->simulator_.vanguard().cartesianIndexMapper(),
this->simulator_.vanguard().schedule().getWellsatEnd(),

View File

@ -254,20 +254,20 @@ std::set<std::string> consistentlyFailingWells(const std::vector<StepReport>& 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<TypeTag, Properties::SolverRestartFactor>()) // 0.33
, growthFactor_(Parameters::get<TypeTag, Properties::SolverGrowthFactor>()) // 2.0
, maxGrowth_(Parameters::get<TypeTag, Properties::SolverMaxGrowth>()) // 3.0
, maxTimeStep_(Parameters::get<TypeTag, Properties::SolverMaxTimeStepInDays>() * 24 * 60 * 60) // 365.25
, minTimeStep_(unitSystem.to_si(UnitSystem::measure::time, Parameters::get<TypeTag, Properties::SolverMinTimeStep>())) // 1e-12;
, ignoreConvergenceFailure_(Parameters::get<TypeTag, Properties::SolverContinueOnConvergenceFailure>()) // false;
, solverRestartMax_(Parameters::get<TypeTag, Properties::SolverMaxRestarts>()) // 10
, solverVerbose_(Parameters::get<TypeTag, Properties::SolverVerbosity>() > 0 && terminalOutput) // 2
, timestepVerbose_(Parameters::get<TypeTag, Properties::TimeStepVerbosity>() > 0 && terminalOutput) // 2
, suggestedNextTimestep_((max_next_tstep <= 0 ? Parameters::get<TypeTag, Properties::InitialTimeStepInDays>() : max_next_tstep) * 24 * 60 * 60) // 1.0
, fullTimestepInitially_(Parameters::get<TypeTag, Properties::FullTimeStepInitially>()) // false
, timestepAfterEvent_(Parameters::get<TypeTag, Properties::TimeStepAfterEventInDays>() * 24 * 60 * 60) // 1e30
, useNewtonIteration_(false)
, minTimeStepBeforeShuttingProblematicWells_(EWOMS_GET_PARAM(TypeTag, double, MinTimeStepBeforeShuttingProblematicWellsInDays)*unit::day)
, minTimeStepBeforeShuttingProblematicWells_(Parameters::get<TypeTag, Properties::MinTimeStepBeforeShuttingProblematicWellsInDays>() * unit::day)
{
init_(unitSystem);
@ -289,14 +289,14 @@ std::set<std::string> consistentlyFailingWells(const std::vector<StepReport>& 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<TypeTag, Properties::SolverMaxRestarts>()) // 10
, solverVerbose_(Parameters::get<TypeTag, Properties::SolverVerbosity>() > 0 && terminalOutput) // 2
, timestepVerbose_(Parameters::get<TypeTag, Properties::TimeStepVerbosity>() > 0 && terminalOutput) // 2
, suggestedNextTimestep_(max_next_tstep <= 0 ? Parameters::get<TypeTag, Properties::InitialTimeStepInDays>() * 24 * 60 * 60 : max_next_tstep) // 1.0
, fullTimestepInitially_(Parameters::get<TypeTag, Properties::FullTimeStepInitially>()) // false
, timestepAfterEvent_(tuning.TMAXWC) // 1e30
, useNewtonIteration_(false)
, minTimeStepBeforeShuttingProblematicWells_(EWOMS_GET_PARAM(TypeTag, double, MinTimeStepBeforeShuttingProblematicWellsInDays)*unit::day)
, minTimeStepBeforeShuttingProblematicWells_(Parameters::get<TypeTag, Properties::MinTimeStepBeforeShuttingProblematicWellsInDays>() * unit::day)
{
init_(unitSystem);
}
@ -815,25 +815,25 @@ std::set<std::string> consistentlyFailingWells(const std::vector<StepReport>& 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<TypeTag, Properties::TimeStepControl>(); // "pid"
const double tol = EWOMS_GET_PARAM(TypeTag, double, TimeStepControlTolerance); // 1e-1
const double tol = Parameters::get<TypeTag, Properties::TimeStepControlTolerance>(); // 1e-1
if (control == "pid") {
timeStepControl_ = std::make_unique<PIDTimeStepControl>(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<TypeTag, Properties::TimeStepControlTargetIterations>(); // 30
const double decayDampingFactor = Parameters::get<TypeTag, Properties::TimeStepControlDecayDampingFactor>(); // 1.0
const double growthDampingFactor = Parameters::get<TypeTag, Properties::TimeStepControlGrowthDampingFactor>(); // 3.2
timeStepControl_ = std::make_unique<PIDAndIterationCountTimeStepControl>(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<TypeTag, Properties::TimeStepControlTargetNewtonIterations>(); // 8
const double decayDampingFactor = Parameters::get<TypeTag, Properties::TimeStepControlDecayDampingFactor>(); // 1.0
const double growthDampingFactor = Parameters::get<TypeTag, Properties::TimeStepControlGrowthDampingFactor>(); // 3.2
const double nonDimensionalMinTimeStepIterations = Parameters::get<TypeTag, Properties::MinTimeStepBasedOnNewtonIterations>(); // 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<PIDAndIterationCountTimeStepControl>(iterations, decayDampingFactor,
@ -842,22 +842,22 @@ std::set<std::string> consistentlyFailingWells(const std::vector<StepReport>& 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<TypeTag, Properties::TimeStepControlTargetIterations>(); // 30
const double decayrate = Parameters::get<TypeTag, Properties::TimeStepControlDecayRate>(); // 0.75
const double growthrate = Parameters::get<TypeTag, Properties::TimeStepControlGrowthRate>(); // 1.25
timeStepControl_ = std::make_unique<SimpleIterationCountTimeStepControl>(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<TypeTag, Properties::TimeStepControlTargetNewtonIterations>(); // 8
const double decayrate = Parameters::get<TypeTag, Properties::TimeStepControlDecayRate>(); // 0.75
const double growthrate = Parameters::get<TypeTag, Properties::TimeStepControlGrowthRate>(); // 1.25
timeStepControl_ = std::make_unique<SimpleIterationCountTimeStepControl>(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<TypeTag, Properties::TimeStepControlFileName>(); // "timesteps"
timeStepControl_ = std::make_unique<HardcodedTimeStepControl>(filename);
timeStepControlType_ = TimeStepControlType::HardCodedTimeStep;
}

View File

@ -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<TypeTag, Properties::DamarisOutputHdfCollective>();
settings.saveMeshToHDF5_ = Parameters::get<TypeTag, Properties::DamarisSaveMeshToHdf>();
settings.saveToDamarisHDF5_ = Parameters::get<TypeTag, Properties::DamarisSaveToHdf>();
settings.pythonFilename_ = Parameters::get<TypeTag, Properties::DamarisPythonScript>();
settings.paraviewPythonFilename_ = Parameters::get<TypeTag, Properties::DamarisPythonParaviewScript>();
settings.damarisSimName_ = Parameters::get<TypeTag, Properties::DamarisSimName>();
settings.nDamarisCores_ = Parameters::get<TypeTag, Properties::DamarisDedicatedCores>();
settings.nDamarisNodes_ = Parameters::get<TypeTag, Properties::DamarisDedicatedNodes>();
settings.shmemSizeBytes_ = Parameters::get<TypeTag, Properties::DamarisSharedMemorySizeBytes>();
settings.shmemName_ = Parameters::get<TypeTag, Properties::DamarisSharedMemoryName>();
settings.damarisLogLevel_ = Parameters::get<TypeTag, Properties::DamarisLogLevel>();
settings.damarisDaskFile_ = Parameters::get<TypeTag, Properties::DamarisDaskFile>();
return settings.getKeywords(comm, OutputDir);
}

View File

@ -59,7 +59,7 @@ namespace Opm {
, simulator_(simulator)
{
terminal_output_ = ((simulator.gridView().comm().rank() == 0) &&
EWOMS_GET_PARAM(TypeTag, bool, EnableTerminalOutput));
Parameters::get<TypeTag, Properties::EnableTerminalOutput>());
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<TypeTag, Properties::AlternativeWellRateInit>();
this->wbpCalculationService_
.localCellIndex([this](const std::size_t globalIndex)