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